<Controls version="1.0"> <ContentsTypes> <ContentType Id="DOCUMENT_SOC" Value="Document société"> <SecretsLevels> <SecretLevel label="Confidentiel">100</SecretLevel> <SecretLevel label ="Public">500</SecretLevel> </SecretsLevels> <Index> <Control> <Id>1</Id> <Code>NOM</Code> <Type>TextBox</Type> <Mandatory>true</Mandatory> <Label>Nom société</Label> <Values></Values> <DefaultValue></DefaultValue> </Control> <Control> <Id>2</Id> <Code>AL_TYPE_SOC</Code> <Type>ComboBox</Type> <Mandatory>true</Mandatory> <Label>Type société<Label> <Values> <Value Id="COR">Correspondance</Value> <Value Id="BAN">Banque</Value> <Value Id="FIN">Finance</Value> <Value Id="COM">Comptes</Value> <Value Id="PRE">Prêt</Value> </Values> <DefaultValue></DefaultValue> </Control> <Control> <Id>3</Id> <Code>SOUS_DOS</Code> <Type>TextBox</Type> <Mandatory>false</Mandatory> <Label>Sous dossier</Label> <Values></Values> <DefaultValue></DefaultValue> </Control> </Index> </ContentType> <ContentType Id="DOCUMENT_FRN" Value="Document RH"> <SecretsLevels> <SecretLevel label="Confidentiel RH">600</SecretLevel> </SecretsLevels> <Index> <Control> <Id>1</Id> <Code>NOM</Code> <Type>TextBox</Type> <Mandatory>true</Mandatory> <Label>Nom collaborateur</Label> <Values></Values> <DefaultValue></DefaultValue> </Control> <Control> <Id>2</Id> <Code>AL_TYPE_DOC</Code> <Type>ComboBox</Type> <Mandatory>true</Mandatory> <Label>Type document</Label> <Values> <Value Id="CV">CV</Value> <Value Id="FP">Fiche de paie</Value> <Value Id="DIV">Divers</Value> </Values> <DefaultValue></DefaultValue> </Control> </Index> </ContentType> </ContentsTypes> </Controls>
var query = from device in loaded.Descendants("ContentType") select new { ContTypeId = device.Attribute("Id").Value, ContTypeValue = device.Attribute("Value").Value, SecretsLvl = from deviceSecrets in device.Descendants("SecretsLevels") select new { SecretsLevel_Label = deviceSecrets.Attribute("label").Value, SecretsLevel_Value = deviceSecrets.Attribute("Value").Value, Index = from deviceIndex in deviceSecrets.Descendants("Index/Control") let valuesDig = deviceIndex.Element("Values").Elements("Value") let valuesAtt = deviceIndex.Element("Values").Elements("Value").Attributes("Id") select new { AttribDig = from attrDig in valuesAtt select attrDig.Value, IdDig = deviceIndex.Element("Id").Value, CodeDig = deviceIndex.Element("Code").Value, TypeDig = deviceIndex.Element("Type").Value, LabelDig = deviceIndex.Element("Label").Value, MandaDig = deviceIndex.Element("Mandatory").Value, DefaultValueDig = deviceIndex.Element("DefaultValue").Value, } } };
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)