I think I got it.
I've added a where clause to the Linq query in my helper class. Fingers 
crossed. :)
Module module = (from m in xml.DescendantsAndSelf()
                     where m.Attribute("Name").Value.Equals("masterpage_")
                     select new Module
{
       ...

From: ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] On Behalf Of 
Paul Noone
Sent: Friday, 26 September 2014 2:54 PM
To: ozMOSS
Subject: Get specific element file from feature element definitions

Hi all,

In my feature receiver I get the collection of element definitions and then 
check for the element type of Module.

var ElementDefinitions = 
properties.Definition.GetElementDefinitions(CultureInfo.CurrentCulture);

foreach (SPElementDefinition ElementDefinition in ElementDefinitions)
{
       if (ElementDefinition.ElementType == "Module")
       {

But this seems to be as deep as I can go using the SPElementDefinition class 
and I'm really only concerned with the Module within a specific elements file.

Is there a way to either get this file directly, or filter my Module collection 
above to get its Name attribute??

<Module Name="masterpage_" ... >

Regards,

Paul

The content of this email is confidential to the intended recipient at the 
email address to which it has been addressed. It may not be disclosed to, or 
used by, anyone other than this addressee, nor may it be copied in any way. If 
received in error, please contact the author and then delete the message from 
your system.
Please note that neither Keller Australia nor the sender accepts any 
responsibility for viruses and it is your responsibility to scan the email and 
attachments (if any).
Visit http://www.keller.com.au/ for more information.

________________________________

This e-mail message has been scanned for Viruses and Content and cleared by 
MailMarshal

________________________________

The content of this email is confidential to the intended recipient at the 
email address to which it has been addressed. It may not be disclosed to, or 
used by, anyone other than this addressee, nor may it be copied in any way. If 
received in error, please contact the author and then delete the message from 
your system. 
Please note that neither Keller Australia nor the sender accepts any 
responsibility for viruses and it is your responsibility to scan the email and 
attachments (if any).
Visit http://www.keller.com.au/ for more information. 

--------------------------------------------------------------------------------
This e-mail message has been scanned for Viruses and Content and cleared by 
MailMarshal 
--------------------------------------------------------------------------------
_______________________________________________
Sponsored by Infotext - Amazing Search for Microsoft SharePoint - 
http://www.infotext.com/
ozmoss mailing list
ozmoss@ozmoss.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss

Reply via email to