84 instantiations of XElement
System.Activities.Presentation (3)
System.Activities.Presentation\System\Activities\Presentation\View\NamespaceDisplayAutomationPeer.cs (1)
27XElement itemStatus = new XElement("NamespaceStatus",
System.Activities.Presentation\System\Activities\Presentation\View\VBIdentifierDesigner.xaml.cs (1)
203XElement itemStatus = new XElement("VBIdentifierStatus",
System.Activities.Presentation\System\Activities\Presentation\View\VisualBasicEditorAutomationPeer.cs (1)
26XElement itemStatus = new XElement("VisualBasicEditorItemStatus",
System.Data.Services (1)
System\Data\Services\Serializers\SyndicationSerializer.cs (1)
277XElement rowCountElement = new XElement(
System.Data.Services.Client (1)
System\Data\Services\Client\DataServiceContext.cs (1)
3343XElement complexProperty = new XElement(((XNamespace)this.DataNamespace) + property.PropertyName);
System.ServiceModel.Discovery (1)
System\ServiceModel\Discovery\FindCriteria.cs (1)
432findCriteriaClone.Extensions.Add(new XElement(extension));
System.ServiceModel.Web (60)
System\ServiceModel\Dispatcher\HelpHtmlBuilder.cs (60)
59XElement table = new XElement(HtmlTableElementName, 60new XElement(HtmlTrElementName, 61new XElement(HtmlThElementName, SR2.GetString(SR2.HelpPageUri)), 62new XElement(HtmlThElementName, SR2.GetString(SR2.HelpPageMethod)), 63new XElement(HtmlThElementName, SR2.GetString(SR2.HelpPageDescription)))); 76XElement tr = new XElement(HtmlTrElementName, 77new XElement(HtmlTdElementName, new XAttribute(HtmlTitleAttributeName, BuildFullUriTemplate(baseUri, operationHelpInfo.UriTemplate)), 78new XElement(HtmlAElementName, 81new XElement(HtmlTdElementName, description)); 85XElement td = new XElement(HtmlTdElementName, operationUri == lastOperation ? String.Empty : operationUri); 101document.Descendants(HtmlBodyElementName).First().Add(new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass), 102new XElement(HtmlPElementName, new XAttribute(HtmlClassAttributeName, HtmlHeading1Class), SR2.GetString(SR2.HelpPageOperationsAt, baseUri)), 103new XElement(HtmlPElementName, SR2.GetString(SR2.HelpPageStaticText)), 111XElement table = new XElement(HtmlTableElementName, 112new XElement(HtmlTrElementName, 113new XElement(HtmlThElementName, SR2.GetString(SR2.HelpPageMessageDirection)), 114new XElement(HtmlThElementName, SR2.GetString(SR2.HelpPageFormat)), 115new XElement(HtmlThElementName, SR2.GetString(SR2.HelpPageBody)))); 120XElement div = new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass), 121new XElement(HtmlPElementName, new XAttribute(HtmlClassAttributeName, HtmlHeading1Class), SR2.GetString(SR2.HelpPageReferenceFor, BuildFullUriTemplate(baseUri, operationInfo.UriTemplate))), 122new XElement(HtmlPElementName, operationInfo.Description), 144XElement div = new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass), 145new XElement(HtmlPElementName, new XAttribute(HtmlClassAttributeName, HtmlHeading1Class), SR2.GetString(SR2.HelpPageTitleText))); 148div.Add(new XElement(HtmlPElementName, SR2.GetString(SR2.HelpPageMethodNotAllowed))); 162XElement div = new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass), 163new XElement(HtmlPElementName, new XAttribute(HtmlClassAttributeName, HtmlHeading1Class), SR2.GetString(SR2.HelpPageRequestErrorTitle))); 169div.Add(new XElement(HtmlPElementName, SR2.GetString(SR2.HelpServerErrorProcessingRequestWithDetails, error.Message))); 170div.Add(new XElement(HtmlPElementName, error.StackTrace ?? String.Empty)); 174div.Add(new XElement(HtmlPElementName, SR2.GetString(SR2.HelpServerErrorProcessingRequest))); 185div.Add(new XElement(HtmlPElementName, error.StackTrace ?? String.Empty)); 201XElement div = new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass), 202new XElement(HtmlPElementName, new XAttribute(HtmlClassAttributeName, HtmlHeading1Class), SR2.GetString(SR2.HelpPageTitleText))); 205div.Add(new XElement(HtmlPElementName, SR2.GetString(SR2.HelpPageEndpointNotFound))); 219XElement div = new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass), 220new XElement(HtmlPElementName, new XAttribute(HtmlClassAttributeName, HtmlHeading1Class), SR2.GetString(SR2.HelpPageTitleText)), 230new XElement(HtmlHtmlElementName, 231new XElement(HtmlHeadElementName, 232new XElement(HtmlTitleElementName, title), 233new XElement("{http://www.w3.org/1999/xhtml}style", SR2.GetString(SR2.HelpPageHtml))), 234new XElement(HtmlBodyElementName))); 255table.Add(new XElement(HtmlTrElementName, 256new XElement(HtmlTdElementName, direction), 257new XElement(HtmlTdElementName, info.FormatString), 258new XElement(HtmlTdElementName, info.BodyDescription))); 265table.Add(new XElement(HtmlTrElementName, 266new XElement(HtmlTdElementName, direction), 267new XElement(HtmlTdElementName, "Xml"), 268contentTd = new XElement(HtmlTdElementName))); 272contentTd.Add(new XElement(HtmlAElementName, new XAttribute(HtmlHrefAttributeName, "#" + (isRequest ? HtmlRequestXmlId : HtmlResponseXmlId)), SR2.GetString(SR2.HelpPageExample))); 280contentTd.Add(new XElement(HtmlAElementName, new XAttribute(HtmlHrefAttributeName, "#" + (isRequest ? HtmlRequestSchemaId : HtmlResponseSchemaId)), SR2.GetString(SR2.HelpPageSchema))); 285table.Add(new XElement(HtmlTrElementName, 286new XElement(HtmlTdElementName, direction), 287new XElement(HtmlTdElementName, "Json"), 288new XElement(HtmlTdElementName, 289new XElement(HtmlAElementName, new XAttribute(HtmlHrefAttributeName, "#" + (isRequest ? HtmlRequestJsonId : HtmlResponseJsonId)), SR2.GetString(SR2.HelpPageExample))))); 360return new XElement(HtmlPElementName, 361new XElement(HtmlPreElementName, new XAttribute(HtmlClassAttributeName, label), content)); 365return new XElement(HtmlPElementName, 366new XElement(HtmlAElementName, new XAttribute(HtmlNameAttributeName, label), title), 367new XElement(HtmlPreElementName, new XAttribute(HtmlClassAttributeName, label), content));
System.Xml.Linq (10)
System\Xml\Linq\XLinq.cs (10)
1844return new XElement(reader); 2442AddNode(new XElement(x)); 2732AddNodeSkipNotify(new XElement(x)); 3036XElement e = new XElement(eCache.Get(r.NamespaceURI).GetName(r.LocalName)); 3104XElement e = new XElement(eCache.Get(r.NamespaceURI).GetName(r.LocalName)); 3339AddNode(new XElement(x)); 4032XElement e = new XElement(reader, options); 4393AddNode(new XElement(name, GetStringValue(value))); 5019return new XElement(this); 8003AddNode(new XElement(XNamespace.Get(namespaceName).GetName(localName)));
XamlBuildTask (8)
Microsoft\Build\Tasks\Xaml\GenerateTemporaryAssemblyTask.cs (8)
154XElement newItemGroup = new XElement(XName.Get("ItemGroup", MSBuildNamespace)); 158XElement newElement = new XElement(XName.Get(itemName, MSBuildNamespace)); 176XElement newItemGroup = new XElement(XName.Get("ItemGroup", MSBuildNamespace)); 180XElement newResource = new XElement(XName.Get("EmbeddedResource", MSBuildNamespace)); 183XElement type = new XElement(XName.Get("Type", MSBuildNamespace), "Non-Resx"); 186XElement withCulture = new XElement(XName.Get("WithCulture", MSBuildNamespace), "false"); 207XElement newPropertyGroup = new XElement(XName.Get("PropertyGroup", MSBuildNamespace)); 213XElement newElement = new XElement(XName.Get(prop.Name, MSBuildNamespace));
802 references to XElement
System.Activities.Core.Presentation (1)
System\ServiceModel\Activities\Presentation\ContentCorrelationTypeExpander.xaml.cs (1)
67typeof(XElement),
System.Activities.Presentation (3)
System.Activities.Presentation\System\Activities\Presentation\View\NamespaceDisplayAutomationPeer.cs (1)
27XElement itemStatus = new XElement("NamespaceStatus",
System.Activities.Presentation\System\Activities\Presentation\View\VBIdentifierDesigner.xaml.cs (1)
203XElement itemStatus = new XElement("VBIdentifierStatus",
System.Activities.Presentation\System\Activities\Presentation\View\VisualBasicEditorAutomationPeer.cs (1)
26XElement itemStatus = new XElement("VisualBasicEditorItemStatus",
System.Data.Entity (2)
System\Data\EntityModel\SchemaObjectModel\SchemaElement.cs (2)
693XElement element = XElement.Load(new StringReader(subtree.ReadOuterXml()));
System.Data.Entity.Design (1)
System\Data\Entity\Design\EntityCodeGenerator.cs (1)
562typeof(System.Xml.Linq.XElement).Assembly.Location, // System.Xml.Linq.dll
System.Data.Linq (2)
SqlClient\SqlTypeSystemProvider.cs (2)
1455type == typeof(System.Xml.Linq.XElement)) 1575type == typeof(System.Xml.Linq.XElement))
System.Data.Services (17)
System\Data\Services\Parsing\WebConvert.cs (7)
118return type == typeof(System.Xml.Linq.XElement) || type == typeof(string); 481Debug.Assert(typeof(System.Xml.Linq.XElement) == targetType, "XElement == " + targetType); 482targetValue = System.Xml.Linq.XElement.Parse(text, System.Xml.Linq.LoadOptions.PreserveWhitespace); 558else if (typeof(System.Xml.Linq.XElement) == targetType) 560targetValue = System.Xml.Linq.XElement.Parse(text, System.Xml.Linq.LoadOptions.PreserveWhitespace); 689else if (typeof(System.Xml.Linq.XElement) == valueType) 691result = ((System.Xml.Linq.XElement)value).ToString(System.Xml.Linq.SaveOptions.None);
System\Data\Services\Providers\ObjectContextServiceProvider.cs (4)
1631if (!writeCustomElements && (metadataProperty.Value == null || metadataProperty.Value.GetType() != typeof(XElement))) 1635else if (writeCustomElements && metadataProperty.Value != null && metadataProperty.Value.GetType() == typeof(XElement)) 1637XElement annotation = (XElement)metadataProperty.Value;
System\Data\Services\Serializers\JsonDeserializer.cs (2)
97else if (propertyType == typeof(System.Xml.Linq.XElement)) 99return System.Xml.Linq.XElement.Parse(stringValue, System.Xml.Linq.LoadOptions.PreserveWhitespace);
System\Data\Services\Serializers\JsonSerializer.cs (2)
321else if (typeof(System.Xml.Linq.XElement) == valueType) 323this.writer.WriteValue(((System.Xml.Linq.XElement)value).ToString(System.Xml.Linq.SaveOptions.None));
System\Data\Services\Serializers\SyndicationSerializer.cs (1)
277XElement rowCountElement = new XElement(
System\Data\Services\WebUtil.cs (1)
95new KeyValuePair<Type, string>(typeof(XElement), XmlConstants.EdmStringTypeName),
System.Data.Services.Client (29)
parent\Server\System\Data\Services\Parsing\WebConvert.cs (3)
118return type == typeof(System.Xml.Linq.XElement) || type == typeof(string); 689else if (typeof(System.Xml.Linq.XElement) == valueType) 691result = ((System.Xml.Linq.XElement)value).ToString(System.Xml.Linq.SaveOptions.None);
System\Data\Services\Client\AtomMaterializer.cs (8)
1435Debug.Assert(entry.Tag is XElement, "entry.Tag is XElement"); 1445XElement entryElement = entry.Tag as XElement; 1461private static void ApplyEntityPropertyMappings(AtomEntry entry, XElement entryElement, EpmTargetPathSegment target) 1468Stack<XElement> elements = new Stack<XElement>(); 1476XElement element = elements.Pop(); 1505var child = element.Element(XName.Get(item.SegmentName, item.SegmentNamespaceUri));
System\Data\Services\Client\AtomParser.cs (3)
157/// Creates an <see cref="XElement"/> instance for ATOM entries. 177XElement element = XElement.Load(reader.ReadSubtree(), LoadOptions.None);
System\Data\Services\Client\ClientConvert.cs (3)
188return System.Xml.Linq.XElement.Parse(propertyValue); 353return ((System.Xml.Linq.XElement)propertyValue).ToString(); 486types[(int)StorageType.XElement] = typeof(System.Xml.Linq.XElement);
System\Data\Services\Client\DataServiceContext.cs (2)
2239internal void FireReadingEntityEvent(object entity, XElement data) 3343XElement complexProperty = new XElement(((XNamespace)this.DataNamespace) + property.PropertyName);
System\Data\Services\Client\MaterializeFromAtom.cs (5)
135XElement data = (XElement)tag; 506XElement element = XElement.Load(this.reader); 510XElement countNode = element.Descendants(XNamespace.Get(XmlConstants.DataWebMetadataNamespace) + XmlConstants.RowCountElement).FirstOrDefault();
System\Data\Services\Client\ReadingWritingEntityEventArgs.cs (3)
27private XElement data; 34internal ReadingWritingEntityEventArgs(object entity, XElement data) 47public XElement Data
System\Data\Services\Client\XmlUtil.cs (2)
234internal static void RemoveDuplicateNamespaceAttributes(System.Xml.Linq.XElement element) 241foreach (System.Xml.Linq.XElement e in element.DescendantsAndSelf())
System.Data.Services.Design (32)
System\Data\EntityModel\EntityClassGenerator.cs (19)
198/// <returns>A new <see cref="XElement"/> that fits the specified <paramref name="targetNamespace"/>.</returns> 199private static XElement FitElementToSchema(XElement element, string schemaNamespace, string targetNamespace) 209XElement result = UpdateNamespaces(element, schemaNamespace, targetNamespace); 356List<XElement> schemaElements = new List<XElement>(); 378XElement fitted = FitElementToSchema(schemaElements[i], schemaNamespace, XmlConstants.EdmV1dot1Namespace); 405foreach (var element in sourceDocument.XPathSelectElements("//edmv1:Schema", namespaceManager)) 411foreach (var element in sourceDocument.XPathSelectElements("//edmv1_1:Schema", namespaceManager)) 434private static bool IsSchemaV2(XElement element) 446private static bool TryCreateReadersV2(XDocument sourceDocument, List<XElement> schemaElements) 454var root = sourceDocument.Root; 464XElement dataServiceElement = root.Elements().Where(e => e.Name.LocalName == XmlConstants.EdmxDataServicesElement).FirstOrDefault(); 498private static XElement UpdateNamespaces(XElement element, string oldNamespaceName, string newNamespaceName) 507Stack<XElement> pending = new Stack<XElement>(); 511XElement e = pending.Pop(); 558foreach (var child in e.Elements())
System\Data\Services\Design\Xml\XNodeSchemaApplier.cs (13)
91internal static void Apply(XmlSchemaSet schemas, XElement element) 111private static bool IsElementExpected(XElement element, XmlQualifiedName elementName, XmlSchemaParticle expected) 194private static bool IsElementExpected(XElement element, XmlSchemaParticle[] expectedParticles) 269private void Validate(XElement element) 290private void PushAncestorsAndSelf(XElement element) 311element = element.Parent as XElement; 319private void PushElement(XElement element, ref string xsiType, ref string xsiNil) 352private void ValidateAttributes(XElement element) 370private void ValidateElement(XElement e) 401private void TrimAttributes(XElement element, XmlSchemaAnyAttribute anyAttribute) 437private void TrimAndValidateNodes(XElement parent) 453XElement element = node as XElement;
System.ServiceModel.Discovery (28)
System\ServiceModel\Discovery\Configuration\EndpointDiscoveryElement.cs (1)
153behavior.Extensions.Add(XElement.Parse(xmlElement.XmlElement.OuterXml));
System\ServiceModel\Discovery\Configuration\FindCriteriaElement.cs (1)
186findCriteria.Extensions.Add(XElement.Parse(xmlElement.XmlElement.OuterXml));
System\ServiceModel\Discovery\EndpointDiscoveryBehavior.cs (4)
21NonNullItemCollection<XElement> extensions; 67public Collection<XElement> Extensions 73this.extensions = new NonNullItemCollection<XElement>(); 96internal Collection<XElement> InternalExtensions
System\ServiceModel\Discovery\EndpointDiscoveryMetadata.cs (7)
25OpenableCollection<XElement> extensions; 67public Collection<XElement> Extensions 73this.extensions = new OpenableCollection<XElement>(this.isOpen); 246foreach (XElement xElement in endpointDiscoveryBehavior.InternalExtensions) 400this.Extensions.Add(XElement.ReadFrom(reader) as XElement); 435foreach (XElement xElement in Extensions)
System\ServiceModel\Discovery\FindCriteria.cs (8)
38NonNullItemCollection<XElement> extensions; 75public Collection<XElement> Extensions 81this.extensions = new NonNullItemCollection<XElement>(); 347XElement xElement = XElement.ReadFrom(reader) as XElement; 391foreach (XElement xElement in Extensions) 430foreach (XElement extension in this.Extensions)
System\ServiceModel\Discovery\ResolveCriteria.cs (7)
21NonNullItemCollection<XElement> extensions; 73public Collection<XElement> Extensions 79this.extensions = new NonNullItemCollection<XElement>(); 126XElement xElement = XElement.ReadFrom(reader) as XElement; 159foreach (XElement xElement in Extensions)
System.ServiceModel.Web (31)
System\ServiceModel\Dispatcher\HelpHtmlBuilder.cs (27)
59XElement table = new XElement(HtmlTableElementName, 66XElement firstTr = null; 76XElement tr = new XElement(HtmlTrElementName, 85XElement td = new XElement(HtmlTdElementName, operationUri == lastOperation ? String.Empty : operationUri); 111XElement table = new XElement(HtmlTableElementName, 120XElement div = new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass), 123XElement.Parse(SR2.GetString(SR2.HelpPageOperationUri, HttpUtility.HtmlEncode(BuildFullUriTemplate(baseUri, operationInfo.UriTemplate)))), 124XElement.Parse(SR2.GetString(SR2.HelpPageOperationMethod, HttpUtility.HtmlEncode(operationInfo.Method)))); 127div.Add(XElement.Parse(SR2.GetString(SR2.HelpPageCallbackText, HttpUtility.HtmlEncode(operationInfo.JavascriptCallbackParameterName))), table); 144XElement div = new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass), 152div.Add(XElement.Parse(SR2.GetString(SR2.HelpPageMethodNotAllowedWithLink, HttpUtility.HtmlEncode(helpUri.AbsoluteUri)))); 162XElement div = new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass), 184div.Add(XElement.Parse(SR2.GetString(SR2.HelpServerErrorProcessingRequestWithDetailsAndLink, encodedHelpLink, errorMessage))); 189div.Add(XElement.Parse(SR2.GetString(SR2.HelpServerErrorProcessingRequestWithLink, encodedHelpLink))); 201XElement div = new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass), 209div.Add(XElement.Parse(SR2.GetString(SR2.HelpPageEndpointNotFoundWithLink, HttpUtility.HtmlEncode(helpUri.AbsoluteUri)))); 219XElement div = new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass), 221XElement.Parse(SR2.GetString(SR2.HelpPageRedirect, HttpUtility.HtmlEncode(originalTo), HttpUtility.HtmlEncode(newLocation)))); 247static void RenderMessageInformation(XElement table, OperationHelpInformation operationInfo, bool isRequest) 264XElement contentTd; 294static void CreateOperationSamples(XElement element, OperationHelpInformation operationInfo) 339private static XElement XmlSchemaToXElement(XmlSchema schema) 356static XElement AddSample(object content, string title, string label) 371static XElement GenerateSampleXml(XElement content, string title, string label) 381static XElement AddSampleJson(XElement content, string title, string label)
System\ServiceModel\Dispatcher\HelpPage.cs (3)
289public XElement XmlExample { get; private set; } 290public XElement JsonExample { get; private set; } 348else if (typeof(XElement).IsAssignableFrom(type) || typeof(XmlElement).IsAssignableFrom(type))
System\ServiceModel\Web\WebOperationContext.cs (1)
164public Message CreateXmlResponse(XElement element)
System.Web.DynamicData (1)
DynamicData\ModelProviders\DLinqColumnProvider.cs (1)
106if (memberType == typeof(XElement)) {
System.Xml.Linq (639)
System\Xml\Linq\XComponentModel.cs (52)
35if (typeof(T) == typeof(XElement)) { 116class XElementAttributePropertyDescriptor : XPropertyDescriptor<XElement, object> 125return value = new XDeferredSingleton<XAttribute>((e, n) => e.Attribute(n), component as XElement, null); 158class XElementDescendantsPropertyDescriptor : XPropertyDescriptor<XElement, IEnumerable<XElement>> 160XDeferredAxis<XElement> value; 167return value = new XDeferredAxis<XElement>((e, n) => n != null ? e.Descendants(n) : e.Descendants(), component as XElement, null); 175XElement e = sender as XElement; 181e = sender as XElement; 194XElement e = sender as XElement; 201class XElementElementPropertyDescriptor : XPropertyDescriptor<XElement, object> 203XDeferredSingleton<XElement> value; 204XElement changeState; 210return value = new XDeferredSingleton<XElement>((e, n) => e.Element(n), component as XElement, null); 217XElement e = sender as XElement; 223e = sender as XElement; 230e = sender as XElement; 249XElement e = sender as XElement; 256class XElementElementsPropertyDescriptor : XPropertyDescriptor<XElement, IEnumerable<XElement>> 258XDeferredAxis<XElement> value; 265return value = new XDeferredAxis<XElement>((e, n) => n != null ? e.Elements(n) : e.Elements(), component as XElement, null); 272XElement e = sender as XElement; 278e = sender as XElement; 285e = sender as XElement; 298XElement e = sender as XElement; 302e = sender as XElement; 309class XElementValuePropertyDescriptor : XPropertyDescriptor<XElement, string> 311XElement element; 321element = component as XElement; 327element = component as XElement; 337if (sender is XElement || sender is XText) { 350class XElementXmlPropertyDescriptor : XPropertyDescriptor<XElement, string> 352XElement element; 358element = component as XElement; 402Func<XElement, XName, IEnumerable<T>> func; 403internal XElement element; 406public XDeferredAxis(Func<XElement, XName, IEnumerable<T>> func, XElement element, XName name) { 438Func<XElement, XName, T> func; 439internal XElement element; 442public XDeferredSingleton(Func<XElement, XName, T> func, XElement element, XName name) {
System\Xml\Linq\XLinq.cs (517)
970/// Gets the parent <see cref="XElement"/> of this <see cref="XObject"/>. 973/// If this <see cref="XObject"/> has no parent <see cref="XElement"/>, this property returns null. 975public XElement Parent { 976get { return parent as XElement; } 1449/// <see cref="XElement"/>, 1619public IEnumerable<XElement> Ancestors() { 1635public IEnumerable<XElement> Ancestors(XName name) { 1636return name != null ? GetAncestors(name, false) : XElement.EmptySequence; 1757public IEnumerable<XElement> ElementsAfterSelf() { 1770public IEnumerable<XElement> ElementsAfterSelf(XName name) { 1771return name != null ? GetElementsAfterSelf(name) : XElement.EmptySequence; 1781public IEnumerable<XElement> ElementsBeforeSelf() { 1794public IEnumerable<XElement> ElementsBeforeSelf(XName name) { 1795return name != null ? GetElementsBeforeSelf(name) : XElement.EmptySequence; 1923/// <see cref="XElement"/> nodes are equal if they have the same tag name, the same 1951internal IEnumerable<XElement> GetAncestors(XName name, bool self) { 1952XElement e = (self ? this : parent) as XElement; 1955e = e.parent as XElement; 1959IEnumerable<XElement> GetElementsAfterSelf(XName name) { 1963XElement e = n as XElement; 1968IEnumerable<XElement> GetElementsBeforeSelf(XName name) { 1974XElement e = n as XElement; 2099/// <see cref="XElement"/> nodes are equal if they have the same tag name, the same 2137/// <see cref="XElement"/> nodes are equal if they have the same tag name, the same 2314/// <see cref="XDocument"/> and <see cref="XElement"/>. 2512/// applies only for <see cref="XElement"/>. 2530/// Returns the descendant <see cref="XElement"/>s of this <see cref="XContainer"/>. Note this method will 2531/// not return itself in the resulting IEnumerable. See <see cref="XElement.DescendantsAndSelf()"/> if you 2532/// need to include the current <see cref="XElement"/> in the results. 2533/// <seealso cref="XElement.DescendantsAndSelf()"/> 2536/// An IEnumerable of <see cref="XElement"/> with all of the descendants below this <see cref="XContainer"/> in the XML tree. 2538public IEnumerable<XElement> Descendants() { 2543/// Returns the Descendant <see cref="XElement"/>s with the passed in <see cref="XName"/> as an IEnumerable 2546/// <param name="name">The <see cref="XName"/> to match against descendant <see cref="XElement"/>s.</param> 2547/// <returns>An <see cref="IEnumerable"/> of <see cref="XElement"/></returns> 2548public IEnumerable<XElement> Descendants(XName name) { 2549return name != null ? GetDescendants(name, false) : XElement.EmptySequence; 2561/// An <see cref="XElement"/> child that matches the <see cref="XName"/> passed in, or null. 2563public XElement Element(XName name) { 2568XElement e = n as XElement; 2576/// Returns the child <see cref="XElement"/>s of this <see cref="XContainer"/>. 2582/// An <see cref="IEnumerable"/> over all of this <see cref="XContainer"/>'s child <see cref="XElement"/>s. 2584public IEnumerable<XElement> Elements() { 2592/// The <see cref="XName"/> to match against the <see cref="XElement"/> children of this <see cref="XContainer"/>. 2595/// An <see cref="IEnumerable"/> of <see cref="XElement"/> children of this <see cref="XContainer"/> that have 2598public IEnumerable<XElement> Elements(XName name) { 2599return name != null ? GetElements(name) : XElement.EmptySequence; 2605/// <seealso cref="XElement.Attributes()"/> 2610/// <seealso cref="XElement.Attributes()"/> 2625/// methods does not remove attributes. See <see cref="XElement.RemoveAttributes()"/>. 2626/// <seealso cref="XElement.RemoveAttributes()"/> 2640if (this is XElement) { 2783if (this is XElement) { 2959internal IEnumerable<XElement> GetDescendants(XName name, bool self) { 2961XElement e = (XElement)this; 2975XElement e = n as XElement; 2981IEnumerable<XElement> GetElements(XName name) { 2986XElement e = n as XElement; 3036XElement e = new XElement(eCache.Get(r.NamespaceURI).GetName(r.LocalName)); 3104XElement e = new XElement(eCache.Get(r.NamespaceURI).GetName(r.LocalName)); 3136XElement e = c as XElement; 3299if (parent is XElement) { 3429/// An <see cref="XElement"/> can contain the following types of content: 3432/// <item><see cref="XElement"/></item> 3439[System.ComponentModel.TypeDescriptionProvider(typeof(MS.Internal.Xml.Linq.ComponentModel.XTypeDescriptionProvider<XElement>))] 3443static IEnumerable<XElement> emptySequence; 3448public static IEnumerable<XElement> EmptySequence { 3450if (emptySequence == null) emptySequence = new XElement[0]; 3508public XElement(XElement other) : base(other) { 3564if (n is XElement) return true; 3637/// Returns this <see cref="XElement"/> and all of it's ancestors up 3643/// Returns this <see cref="XElement"/> and all of it's ancestors up to 3648/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing all of 3649/// this <see cref="XElement"/>'s ancestors up to the root node (including 3650/// this <see cref="XElement"/>. 3652public IEnumerable<XElement> AncestorsAndSelf() { 3657/// Returns the ancestor(s) of this <see cref="XElement"/> with the matching 3658/// <see cref="XName"/>. If this <see cref="XElement"/>'s <see cref="XName"/> 3660/// resulting <see cref="IEnumerable"/> or <see cref="XElement"/>. 3667/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 3668/// ancestors of this <see cref="XElement"/> with a matching <see cref="XName"/>. 3670public IEnumerable<XElement> AncestorsAndSelf(XName name) { 3671return name != null ? GetAncestors(name, true) : XElement.EmptySequence; 3675/// Returns the <see cref="XAttribute"/> associated with this <see cref="XElement"/> that has this 3697/// Returns the <see cref="XAttribute"/> associated with this <see cref="XElement"/>. Optionally 3701/// Returns all of the <see cref="XAttribute"/>s associated with this <see cref="XElement"/>. 3706/// associated with this <see cref="XElement"/>. 3713/// Returns the <see cref="XAttribute"/>(s) associated with this <see cref="XElement"/> that has the passed 3715/// <seealso cref="XElement.Attributes()"/> 3728/// Get the self and descendant nodes for an <see cref="XElement"/> 3736/// Returns this <see cref="XElement"/> and all of it's descendants. Overloads allow 3738/// of a descendant <see cref="XElement"/> to match. 3741/// Returns this <see cref="XElement"/> and all of it's descendant <see cref="XElement"/>s 3742/// as an <see cref="IEnumerable"/> of <see cref="XElement"/>. 3743/// <seealso cref="XElement.DescendantsAndSelf()"/> 3746/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing this <see cref="XElement"/> 3749public IEnumerable<XElement> DescendantsAndSelf() { 3754/// Returns the descendants of this <see cref="XElement"/> that have a matching <see cref="XName"/> 3755/// to the one passed in, including, potentially, this <see cref="XElement"/>. 3756/// <seealso cref="XElement.DescendantsAndSelf(XName)"/> 3759/// The <see cref="XName"/> of the descendant <see cref="XElement"/> that is being targeted. 3762/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing all of the descendant 3763/// <see cref="XElement"/>s that have this <see cref="XName"/>. 3765public IEnumerable<XElement> DescendantsAndSelf(XName name) { 3766return name != null ? GetDescendants(name, true) : XElement.EmptySequence; 3770/// Returns the default <see cref="XNamespace"/> of an <see cref="XElement"/> 3778/// Get the namespace associated with a particular prefix for this <see cref="XElement"/> 3802XElement e = this; 3823e = e.parent as XElement; 3837/// <see cref="XElement"/> and initializing it from a data source containing 3843/// <seealso cref="XElement.Parse(string)"/> 3846/// Create a new <see cref="XElement"/> based on the contents of the file 3848/// <see cref="XElement.Parse(string)"/> to create an <see cref="XElement"/> from 3851/// <seealso cref="XElement.Parse(string)"/> 3860/// A URI string referencing the file to load into a new <see cref="XElement"/>. 3863/// An <see cref="XElement"/> initialized with the contents of the file referenced 3871public static XElement Load(string uri) { 3876/// Create a new <see cref="XElement"/> based on the contents of the file 3889/// A string representing the URI of the file to be loaded into a new <see cref="XElement"/>. 3895/// An <see cref="XElement"/> initialized with the contents of the file referenced 3904public static XElement Load(string uri, LoadOptions options) { 3912/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using 3917/// created <see cref="XElement"/>. 3920/// A new <see cref="XElement"/> containing the contents of the passed in 3923public static XElement Load(Stream stream) { 3928/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using 3939/// created <see cref="XElement"/>. 3945/// A new <see cref="XElement"/> containing the contents of the passed in 3948public static XElement Load(Stream stream, LoadOptions options) { 3955/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using 3960/// created <see cref="XElement"/>. 3963/// A new <see cref="XElement"/> containing the contents of the passed in 3966public static XElement Load(TextReader textReader) { 3971/// Create a new <see cref="XElement"/> and initialize its underlying XML tree using 3982/// created <see cref="XElement"/>. 3988/// A new <see cref="XElement"/> containing the contents of the passed in 3991public static XElement Load(TextReader textReader, LoadOptions options) { 3999/// Create a new <see cref="XElement"/> containing the contents of the 4004/// <see cref="XElement"/>. 4007/// A new <see cref="XElement"/> containing the contents of the passed 4010public static XElement Load(XmlReader reader) { 4015/// Create a new <see cref="XElement"/> containing the contents of the 4020/// <see cref="XElement"/>. 4026/// A new <see cref="XElement"/> containing the contents of the passed 4029public static XElement Load(XmlReader reader, LoadOptions options) { 4032XElement e = new XElement(reader, options); 4039/// Parses a string containing XML into an <see cref="XElement"/>. Optionally 4043/// Parses a string containing XML into an <see cref="XElement"/>. 4049/// A string containing the XML to parse into an <see cref="XElement"/>. 4052/// An <see cref="XElement"/> created from the XML string passed in. 4054public static XElement Parse(string text) { 4059/// Parses a string containing XML into an <see cref="XElement"/> and 4073/// A string containing the XML to parse into an <see cref="XElement"/>. 4079/// An <see cref="XElement"/> created from the XML string passed in. 4081public static XElement Parse(string text, LoadOptions options) { 4091/// Removes content and attributes from this <see cref="XElement"/>. 4092/// <seealso cref="XElement.RemoveAttributes"/> 4101/// Removes that attributes of this <see cref="XElement"/>. 4102/// <seealso cref="XElement.RemoveAll"/> 4103/// <seealso cref="XElement.RemoveAttributes"/> 4198/// Outputs this <see cref="XElement"/>'s underlying XML tree. The output can 4203/// Output this <see cref="XElement"/> to a file. 4208/// <see cref="XElement.Save(string, SaveOptions)"/>) enabling 4225/// Output this <see cref="XElement"/> to a file. 4247/// Output this <see cref="XElement"/> to the passed in <see cref="Stream"/>. 4252/// <see cref="XElement.Save(Stream, SaveOptions)"/>) enabling 4258/// The <see cref="Stream"/> to output this <see cref="XElement"/> to. 4265/// Output this <see cref="XElement"/> to a <see cref="Stream"/>. 4282/// Output this <see cref="XElement"/> to the passed in <see cref="TextWriter"/>. 4287/// <see cref="XElement.Save(TextWriter, SaveOptions)"/>) enabling 4293/// The <see cref="TextWriter"/> to output this <see cref="XElement"/> to. 4300/// Output this <see cref="XElement"/> to a <see cref="TextWriter"/>. 4317/// Output this <see cref="XElement"/> to an <see cref="XmlWriter"/>. 4334/// <seealso cref="XElement.SetElementValue"/> 4335/// <seealso cref="XElement.SetValue"/> 4369/// <seealso cref="XElement.SetAttributeValue"/> 4370/// <seealso cref="XElement.SetValue"/> 4384XElement e = Element(name); 4401/// <seealso cref="XElement.SetAttributeValue"/> 4402/// <seealso cref="XElement.SetElementValue"/> 4417/// Write this <see cref="XElement"/> to the passed in <see cref="XmlTextWriter"/>. 4420/// The <see cref="XmlTextWriter"/> to write this <see cref="XElement"/> to. 4428/// Cast the value of this <see cref="XElement"/> to a <see cref="string"/>. 4431/// If the <see cref="XElement"/> is a subtre (an <see cref="XElement"/> 4432/// that has <see cref="XElement"/> children. The concatenated string 4433/// value of all of the <see cref="XElement"/>'s text and descendants 4437/// The <see cref="XElement"/> to cast to a string. 4440/// The content of this <see cref="XElement"/> as a <see cref="string"/>. 4444public static explicit operator string(XElement element) { 4450/// Cast the value of this <see cref="XElement"/> to a <see cref="bool"/>. 4453/// The <see cref="XElement"/> to cast to <see cref="bool"/>. 4456/// The content of this <see cref="XElement"/> as a <see cref="bool"/>. 4466public static explicit operator bool(XElement element) { 4472/// Cast the value of this <see cref="XElement"/> to a <see cref="bool"/>?. 4475/// The <see cref="XElement"/> to cast to <see cref="bool"/>?. 4478/// The content of this <see cref="XElement"/> as a <see cref="bool"/>?. 4485public static explicit operator bool?(XElement element) { 4491/// Cast the value of this <see cref="XElement"/> to an <see cref="int"/>. 4494/// The <see cref="XElement"/> to cast to <see cref="int"/>. 4497/// The content of this <see cref="XElement"/> as a <see cref="int"/>. 4507public static explicit operator int(XElement element) { 4513/// Cast the value of this <see cref="XElement"/> to an <see cref="int"/>?. 4516/// The <see cref="XElement"/> to cast to <see cref="int"/>?. 4519/// The content of this <see cref="XElement"/> as a <see cref="int"/>?. 4526public static explicit operator int?(XElement element) { 4532/// Cast the value of this <see cref="XElement"/> to an <see cref="uint"/>. 4535/// The <see cref="XElement"/> to cast to <see cref="uint"/>. 4538/// The content of this <see cref="XElement"/> as a <see cref="uint"/>. 4548public static explicit operator uint(XElement element) { 4554/// Cast the value of this <see cref="XElement"/> to an <see cref="uint"/>?. 4557/// The <see cref="XElement"/> to cast to <see cref="uint"/>?. 4560/// The content of this <see cref="XElement"/> as a <see cref="uint"/>?. 4567public static explicit operator uint?(XElement element) { 4573/// Cast the value of this <see cref="XElement"/> to a <see cref="long"/>. 4576/// The <see cref="XElement"/> to cast to <see cref="long"/>. 4579/// The content of this <see cref="XElement"/> as a <see cref="long"/>. 4589public static explicit operator long(XElement element) { 4595/// Cast the value of this <see cref="XElement"/> to a <see cref="long"/>?. 4598/// The <see cref="XElement"/> to cast to <see cref="long"/>?. 4601/// The content of this <see cref="XElement"/> as a <see cref="long"/>?. 4608public static explicit operator long?(XElement element) { 4614/// Cast the value of this <see cref="XElement"/> to an <see cref="ulong"/>. 4617/// The <see cref="XElement"/> to cast to <see cref="ulong"/>. 4620/// The content of this <see cref="XElement"/> as a <see cref="ulong"/>. 4630public static explicit operator ulong(XElement element) { 4636/// Cast the value of this <see cref="XElement"/> to an <see cref="ulong"/>?. 4639/// The <see cref="XElement"/> to cast to <see cref="ulong"/>?. 4642/// The content of this <see cref="XElement"/> as a <see cref="ulong"/>?. 4649public static explicit operator ulong?(XElement element) { 4655/// Cast the value of this <see cref="XElement"/> to a <see cref="float"/>. 4658/// The <see cref="XElement"/> to cast to <see cref="float"/>. 4661/// The content of this <see cref="XElement"/> as a <see cref="float"/>. 4671public static explicit operator float(XElement element) { 4677/// Cast the value of this <see cref="XElement"/> to an <see cref="float"/>?. 4680/// The <see cref="XElement"/> to cast to <see cref="float"/>?. 4683/// The content of this <see cref="XElement"/> as a <see cref="float"/>?. 4690public static explicit operator float?(XElement element) { 4696/// Cast the value of this <see cref="XElement"/> to a <see cref="double"/>. 4699/// The <see cref="XElement"/> to cast to <see cref="double"/>. 4702/// The content of this <see cref="XElement"/> as a <see cref="double"/>. 4712public static explicit operator double(XElement element) { 4718/// Cast the value of this <see cref="XElement"/> to an <see cref="double"/>?. 4721/// The <see cref="XElement"/> to cast to <see cref="double"/>?. 4724/// The content of this <see cref="XElement"/> as a <see cref="double"/>?. 4731public static explicit operator double?(XElement element) { 4737/// Cast the value of this <see cref="XElement"/> to a <see cref="decimal"/>. 4740/// The <see cref="XElement"/> to cast to <see cref="decimal"/>. 4743/// The content of this <see cref="XElement"/> as a <see cref="decimal"/>. 4753public static explicit operator decimal(XElement element) { 4759/// Cast the value of this <see cref="XElement"/> to an <see cref="decimal"/>?. 4762/// The <see cref="XElement"/> to cast to <see cref="decimal"/>?. 4765/// The content of this <see cref="XElement"/> as a <see cref="decimal"/>?. 4772public static explicit operator decimal?(XElement element) { 4778/// Cast the value of this <see cref="XElement"/> to a <see cref="DateTime"/>. 4781/// The <see cref="XElement"/> to cast to <see cref="DateTime"/>. 4784/// The content of this <see cref="XElement"/> as a <see cref="DateTime"/>. 4794public static explicit operator DateTime(XElement element) { 4800/// Cast the value of this <see cref="XElement"/> to an <see cref="DateTime"/>?. 4803/// The <see cref="XElement"/> to cast to <see cref="DateTime"/>?. 4806/// The content of this <see cref="XElement"/> as a <see cref="DateTime"/>?. 4813public static explicit operator DateTime?(XElement element) { 4819/// Cast the value of this <see cref="XElement"/> to a <see cref="DateTimeOffset"/>. 4822/// The <see cref="XElement"/> to cast to <see cref="DateTimeOffset"/>. 4825/// The content of this <see cref="XElement"/> as a <see cref="DateTimeOffset"/>. 4835public static explicit operator DateTimeOffset(XElement element) { 4841/// Cast the value of this <see cref="XElement"/> to an <see cref="DateTimeOffset"/>?. 4844/// The <see cref="XElement"/> to cast to <see cref="DateTimeOffset"/>?. 4847/// The content of this <see cref="XElement"/> as a <see cref="DateTimeOffset"/>?. 4854public static explicit operator DateTimeOffset?(XElement element) { 4860/// Cast the value of this <see cref="XElement"/> to a <see cref="TimeSpan"/>. 4863/// The <see cref="XElement"/> to cast to <see cref="TimeSpan"/>. 4866/// The content of this <see cref="XElement"/> as a <see cref="TimeSpan"/>. 4876public static explicit operator TimeSpan(XElement element) { 4882/// Cast the value of this <see cref="XElement"/> to an <see cref="TimeSpan"/>?. 4885/// The <see cref="XElement"/> to cast to <see cref="TimeSpan"/>?. 4888/// The content of this <see cref="XElement"/> as a <see cref="TimeSpan"/>?. 4895public static explicit operator TimeSpan?(XElement element) { 4901/// Cast the value of this <see cref="XElement"/> to a <see cref="Guid"/>. 4904/// The <see cref="XElement"/> to cast to <see cref="Guid"/>. 4907/// The content of this <see cref="XElement"/> as a <see cref="Guid"/>. 4917public static explicit operator Guid(XElement element) { 4923/// Cast the value of this <see cref="XElement"/> to an <see cref="Guid"/>?. 4926/// The <see cref="XElement"/> to cast to <see cref="Guid"/>?. 4929/// The content of this <see cref="XElement"/> as a <see cref="Guid"/>?. 4936public static explicit operator Guid?(XElement element) { 4949/// Generates a <see cref="XElement"/> from its XML respresentation. 4952/// The <see cref="XmlReader"/> stream from which the <see cref="XElement"/> 4963/// Converts a <see cref="XElement"/> into its XML representation. 4966/// The <see cref="XmlWriter"/> stream to which the <see cref="XElement"/> 5004bool AttributesEqual(XElement e) { 5023XElement e = node as XElement; 5037string GetNamespaceOfPrefixInScope(string prefix, XElement outOfScope) { 5038XElement e = this; 5048e = e.parent as XElement; 5149public void WriteElement(XElement e) { 5151XElement root = e; 5154e = n as XElement; 5195void PushAncestors(XElement e) { 5197e = e.parent as XElement; 5211void PushElement(XElement e) { 5234void WriteStartElement(XElement e) { 5514public XElement Root { 5516return GetFirstNode<XElement>(); 6621get { return parent != null && ((XElement)parent).lastAttr != this ? next : null; } 6646XAttribute a = ((XElement)parent).lastAttr; 6650return a != ((XElement)parent).lastAttr ? a : null; 6681((XElement)parent).RemoveAttribute(this); 6686/// <seealso cref="XElement.SetValue"/> 6687/// <seealso cref="XElement.SetAttributeValue"/> 6688/// <seealso cref="XElement.SetElementValue"/> 7135if (parent != null) return ((XElement)parent).GetPrefixOfNamespace(ns); 7517/// Returns all of the <see cref="XAttribute"/>s for each <see cref="XElement"/> of 7518/// this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7522/// Attributes for every <see cref="XElement"/> in the target <see cref="IEnumerable"/> 7523/// of <see cref="XElement"/>. 7525public static IEnumerable<XAttribute> Attributes(this IEnumerable<XElement> source) { 7532/// <see cref="XElement"/>'s <see cref="XAttribute"/>s in the target <see cref="IEnumerable"/> 7533/// of <see cref="XElement"/> are scanned for a matching <see cref="XName"/>. 7537/// Attributes with a matching <see cref="XName"/> for every <see cref="XElement"/> in 7538/// the target <see cref="IEnumerable"/> of <see cref="XElement"/>. 7540public static IEnumerable<XAttribute> Attributes(this IEnumerable<XElement> source, XName name) { 7546/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the ancestors (parent 7547/// and it's parent up to the root) of each of the <see cref="XElement"/>s in this 7548/// <see cref="IEnumerable"/> of <see cref="XElement"/>. 7551/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the ancestors (parent 7552/// and it's parent up to the root) of each of the <see cref="XElement"/>s in this 7553/// <see cref="IEnumerable"/> of <see cref="XElement"/>. 7555public static IEnumerable<XElement> Ancestors<T>(this IEnumerable<T> source) where T: XNode { 7561/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the ancestors (parent 7563/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7566/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the ancestors (parent 7568/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7570public static IEnumerable<XElement> Ancestors<T>(this IEnumerable<T> source, XName name) where T: XNode { 7572return name != null ? GetAncestors(source, name, false) : XElement.EmptySequence; 7576/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 7577/// <see cref="XElement"/> and it's ancestors (parent and it's parent up to the root). 7578/// This is done for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of 7579/// <see cref="XElement"/>. 7582/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 7583/// <see cref="XElement"/> and it's ancestors (parent and it's parent up to the root). 7584/// This is done for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of 7585/// <see cref="XElement"/>. 7587public static IEnumerable<XElement> AncestorsAndSelf(this IEnumerable<XElement> source) { 7593/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 7594/// <see cref="XElement"/> and it's ancestors (parent and it's parent up to the root) 7596/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7599/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 7600/// <see cref="XElement"/> and it's ancestors (parent and it's parent up to the root) 7602/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7604public static IEnumerable<XElement> AncestorsAndSelf(this IEnumerable<XElement> source, XName name) { 7606return name != null ? GetAncestors(source, name, true) : XElement.EmptySequence; 7636/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the descendants (children 7637/// and their children down to the leaf level). This is done for each <see cref="XElement"/> in 7638/// this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7641/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the descendants (children 7642/// and their children down to the leaf level). This is done for each <see cref="XElement"/> in 7643/// this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7645public static IEnumerable<XElement> Descendants<T>(this IEnumerable<T> source) where T: XContainer { 7651/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the descendants (children 7653/// for each <see cref="XElement"/> in the target <see cref="IEnumerable"/> of <see cref="XElement"/>. 7656/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the descendants (children 7658/// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7660public static IEnumerable<XElement> Descendants<T>(this IEnumerable<T> source, XName name) where T: XContainer { 7662return name != null ? GetDescendants(source, name, false) : XElement.EmptySequence; 7666/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 7667/// <see cref="XElement"/> and it's descendants 7669/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7672/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 7673/// <see cref="XElement"/> and descendants. 7675/// <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7677public static IEnumerable<XNode> DescendantNodesAndSelf(this IEnumerable<XElement> source) { 7683/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 7684/// <see cref="XElement"/> and it's descendants (children and children's children down 7685/// to the leaf nodes). This is done for each <see cref="XElement"/> in this <see cref="IEnumerable"/> 7686/// of <see cref="XElement"/>. 7689/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 7690/// <see cref="XElement"/> and it's descendants (children and children's children down 7691/// to the leaf nodes). This is done for each <see cref="XElement"/> in this <see cref="IEnumerable"/> 7692/// of <see cref="XElement"/>. 7694public static IEnumerable<XElement> DescendantsAndSelf(this IEnumerable<XElement> source) { 7700/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 7701/// <see cref="XElement"/> and it's descendants (children and children's children down 7703/// each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7706/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the 7707/// <see cref="XElement"/> and it's descendants (children and children's children down 7709/// each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7711public static IEnumerable<XElement> DescendantsAndSelf(this IEnumerable<XElement> source, XName name) { 7713return name != null ? GetDescendants(source, name, true) : XElement.EmptySequence; 7717/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements 7718/// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7721/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements 7722/// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7724public static IEnumerable<XElement> Elements<T>(this IEnumerable<T> source) where T: XContainer { 7730/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements 7731/// with a matching for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7734/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements 7735/// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7737public static IEnumerable<XElement> Elements<T>(this IEnumerable<T> source, XName name) where T: XContainer { 7739return name != null ? GetElements(source, name) : XElement.EmptySequence; 7743/// Returns an <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements 7744/// with a matching for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7747/// An <see cref="IEnumerable"/> of <see cref="XElement"/> containing the child elements 7748/// for each <see cref="XElement"/> in this <see cref="IEnumerable"/> of <see cref="XElement"/>. 7777static IEnumerable<XAttribute> GetAttributes(IEnumerable<XElement> source, XName name) { 7778foreach (XElement e in source) { 7791static IEnumerable<XElement> GetAncestors<T>(IEnumerable<T> source, XName name, bool self) where T: XNode { 7794XElement e = (self ? node : node.parent) as XElement; 7797e = e.parent as XElement; 7825static IEnumerable<XElement> GetDescendants<T>(IEnumerable<T> source, XName name, bool self) where T: XContainer { 7829XElement e = (XElement)root; 7843XElement e = n as XElement; 7851static IEnumerable<XElement> GetElements<T>(IEnumerable<T> source, XName name) where T: XContainer { 7858XElement e = n as XElement; 7942parent = ((XElement)parent).parent; 7968XElement e = (XElement)parent; 8096XElement e = GetElementInAttributeScope(); 8164XElement e = GetElementInAttributeScope(); 8207XElement e = source as XElement; 8220XElement e = source as XElement; 8257XElement e = source as XElement; 8310XElement e = source as XElement; 8372XElement e = GetElementInScope(); 8380e = e.parent as XElement; 8392XElement e = GetElementInScope(); 8407e = e.parent as XElement; 8425XElement e = GetElementInAttributeScope(); 8461XElement e = GetElementInAttributeScope(); 8496XElement e = GetElementInAttributeScope(); 8520XElement e = GetElementInScope(); 8534XElement e = GetElementInAttributeScope(); 8564XElement e = GetElementInAttributeScope(); 8601XElement e = GetElementInAttributeScope(); 8643XElement e = GetElementInAttributeScope(); 8666XElement e = source as XElement; 8694if (a.parent != null && ((XElement)a.parent).lastAttr != a) { 8747XElement c = source as XElement; 8752foreach (XElement e in c.Descendants()) { 8766XElement e = source as XElement; 8785foreach (XElement e in n.ElementsAfterSelf()) { 8793if (n.parent is XElement) { 8800if (parent is XElement) { 8859XElement e = source as XElement; 8878XElement e = source as XElement; 8901XElement e = source as XElement; 8936XElement GetElementInAttributeScope() { 8937XElement e = source as XElement; 8946return (XElement)a.parent; 8950return (XElement)a.parent; 8955XElement GetElementInScope() { 8956XElement e = source as XElement; 8962return n.parent as XElement; 8966return (XElement)a.parent; 8968e = parent as XElement; 8974return (XElement)a.parent; 8979static void GetNameInAttributeScope(string qualifiedName, XElement e, out string localName, out string namespaceName) { 9001XElement e = source as XElement; 9036bool ReadIntoElement(XElement e) { 9064XElement e = (XElement)a.parent; 9094if (parent is XElement) { 9140XElement element = candidateAttribute.parent as XElement; 9145element = element.parent as XElement; 9173element = element.parent as XElement; 9190XElement e = candidate.parent as XElement;
System\Xml\Linq\XNodeNavigator.cs (54)
43XElement parent; 73XElement e = source as XElement; 104if (s.Length != 0 && (c.parent != null || c is XElement)) { 114XElement e = source as XElement; 124XElement e = source as XElement; 157XElement e = source as XElement; 206XElement e = source as XElement; 244return ((XElement)o).Value; 248XElement root = ((XDocument)o).Root; 292XElement e = source as XElement; 317XElement e = n as XElement; 356parent = (XElement)c; 365XElement e = source as XElement; 396if (s.Length != 0 && (c.parent != null || c is XElement)) { 398parent = (XElement)c; 406XElement e = source as XElement; 440XElement e = source as XElement; 491XElement e = n as XElement; 529XElement e = (XElement)a.parent; 672if (c.parent != null || c is XElement) { 704static XAttribute GetFirstNamespaceDeclarationGlobal(XElement e) { 710e = e.parent as XElement; 715static XAttribute GetFirstNamespaceDeclarationLocal(XElement e) { 729XElement e = (XElement)a.parent; 737e = e.parent as XElement; 745XElement e = (XElement)a.parent; 765static bool HasNamespaceDeclarationInScope(XAttribute a, XElement e) { 771e = e.parent as XElement; 864/// Select an <see cref="XElement"/> using a XPath expression 868/// <returns>An <see cref="XElement"> or null</see></returns> 869public static XElement XPathSelectElement(this XNode node, string expression) { 874/// Select an <see cref="XElement"/> using a XPath expression 880/// <returns>An <see cref="XElement"> or null</see></returns> 881public static XElement XPathSelectElement(this XNode node, string expression, IXmlNamespaceResolver resolver) { 886/// Select a set of <see cref="XElement"/> using a XPath expression 891public static IEnumerable<XElement> XPathSelectElements(this XNode node, string expression) { 896/// Select a set of <see cref="XElement"/> using a XPath expression 903public static IEnumerable<XElement> XPathSelectElements(this XNode node, string expression, IXmlNamespaceResolver resolver) { 905return (IEnumerable<XElement>)new XPathEvaluator().Evaluate<XElement>(node, expression, resolver);
System\Xml\Linq\XNodeValidator.cs (16)
72ValidateElement((XElement)source); 144void PushAncestorsAndSelf(XElement e) { 161e = e.parent as XElement; 165void PushElement(XElement e, ref string xsiType, ref string xsiNil) { 213void ValidateAttributes(XElement e) { 247void ValidateElement(XElement e) { 269void ValidateNodes(XElement e) { 275XElement c = n as XElement; 362/// Gets the schema information that has been assigned to the <see cref="XElement"/> as a result of schema validation. 366public static IXmlSchemaInfo GetSchemaInfo(this XElement source) { 412/// Validate a <see cref="XElement"/> 422public static void Validate(this XElement source, XmlSchemaObject partialValidationType, XmlSchemaSet schemas, ValidationEventHandler validationEventHandler) { 427/// Validate a <see cref="XElement"/> 437/// <param name="addSchemaInfo">If enabled the <see cref="XElement"/> and the corresponding 441public static void Validate(this XElement source, XmlSchemaObject partialValidationType, XmlSchemaSet schemas, ValidationEventHandler validationEventHandler, bool addSchemaInfo) {
XamlBuildTask (16)
Microsoft\Build\Tasks\Xaml\GenerateTemporaryAssemblyTask.cs (16)
90XElement projectElement = projectDocument.Element(XName.Get("Project", MSBuildNamespace)); 141void RemoveItemsByName(XElement project, string itemName) 145IEnumerable<XElement> itemGroups = project.Elements(XName.Get("ItemGroup", MSBuildNamespace)); 150void AddNewItems(XElement project, string itemName, ITaskItem[] items) 154XElement newItemGroup = new XElement(XName.Get("ItemGroup", MSBuildNamespace)); 158XElement newElement = new XElement(XName.Get(itemName, MSBuildNamespace)); 172void AddNewResourceItems(XElement project, ITaskItem[] items) 176XElement newItemGroup = new XElement(XName.Get("ItemGroup", MSBuildNamespace)); 180XElement newResource = new XElement(XName.Get("EmbeddedResource", MSBuildNamespace)); 183XElement type = new XElement(XName.Get("Type", MSBuildNamespace), "Non-Resx"); 186XElement withCulture = new XElement(XName.Get("WithCulture", MSBuildNamespace), "false"); 194void RemovePropertyByName(XElement project, string propertyName) 198IEnumerable<XElement> itemGroups = project.Elements(XName.Get("PropertyGroup", MSBuildNamespace)); 203void AddNewProperties(XElement project, IEnumerable<ProjectProperty> properties) 207XElement newPropertyGroup = new XElement(XName.Get("PropertyGroup", MSBuildNamespace)); 213XElement newElement = new XElement(XName.Get(prop.Name, MSBuildNamespace));