84 instantiations of XElement
System.Activities.Presentation (3)
System.Activities.Presentation\System\Activities\Presentation\View\NamespaceDisplayAutomationPeer.cs (1)
27
XElement itemStatus = new
XElement
("NamespaceStatus",
System.Activities.Presentation\System\Activities\Presentation\View\VBIdentifierDesigner.xaml.cs (1)
203
XElement itemStatus = new
XElement
("VBIdentifierStatus",
System.Activities.Presentation\System\Activities\Presentation\View\VisualBasicEditorAutomationPeer.cs (1)
26
XElement itemStatus = new
XElement
("VisualBasicEditorItemStatus",
System.Data.Services (1)
System\Data\Services\Serializers\SyndicationSerializer.cs (1)
277
XElement rowCountElement = new
XElement
(
System.Data.Services.Client (1)
System\Data\Services\Client\DataServiceContext.cs (1)
3343
XElement complexProperty = new
XElement
(((XNamespace)this.DataNamespace) + property.PropertyName);
System.ServiceModel.Discovery (1)
System\ServiceModel\Discovery\FindCriteria.cs (1)
432
findCriteriaClone.Extensions.Add(new
XElement
(extension));
System.ServiceModel.Web (60)
System\ServiceModel\Dispatcher\HelpHtmlBuilder.cs (60)
59
XElement table = new
XElement
(HtmlTableElementName,
60
new
XElement
(HtmlTrElementName,
61
new
XElement
(HtmlThElementName, SR2.GetString(SR2.HelpPageUri)),
62
new
XElement
(HtmlThElementName, SR2.GetString(SR2.HelpPageMethod)),
63
new
XElement
(HtmlThElementName, SR2.GetString(SR2.HelpPageDescription))));
76
XElement tr = new
XElement
(HtmlTrElementName,
77
new
XElement
(HtmlTdElementName, new XAttribute(HtmlTitleAttributeName, BuildFullUriTemplate(baseUri, operationHelpInfo.UriTemplate)),
78
new
XElement
(HtmlAElementName,
81
new
XElement
(HtmlTdElementName, description));
85
XElement td = new
XElement
(HtmlTdElementName, operationUri == lastOperation ? String.Empty : operationUri);
101
document.Descendants(HtmlBodyElementName).First().Add(new
XElement
(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass),
102
new
XElement
(HtmlPElementName, new XAttribute(HtmlClassAttributeName, HtmlHeading1Class), SR2.GetString(SR2.HelpPageOperationsAt, baseUri)),
103
new
XElement
(HtmlPElementName, SR2.GetString(SR2.HelpPageStaticText)),
111
XElement table = new
XElement
(HtmlTableElementName,
112
new
XElement
(HtmlTrElementName,
113
new
XElement
(HtmlThElementName, SR2.GetString(SR2.HelpPageMessageDirection)),
114
new
XElement
(HtmlThElementName, SR2.GetString(SR2.HelpPageFormat)),
115
new
XElement
(HtmlThElementName, SR2.GetString(SR2.HelpPageBody))));
120
XElement div = new
XElement
(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass),
121
new
XElement
(HtmlPElementName, new XAttribute(HtmlClassAttributeName, HtmlHeading1Class), SR2.GetString(SR2.HelpPageReferenceFor, BuildFullUriTemplate(baseUri, operationInfo.UriTemplate))),
122
new
XElement
(HtmlPElementName, operationInfo.Description),
144
XElement div = new
XElement
(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass),
145
new
XElement
(HtmlPElementName, new XAttribute(HtmlClassAttributeName, HtmlHeading1Class), SR2.GetString(SR2.HelpPageTitleText)));
148
div.Add(new
XElement
(HtmlPElementName, SR2.GetString(SR2.HelpPageMethodNotAllowed)));
162
XElement div = new
XElement
(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass),
163
new
XElement
(HtmlPElementName, new XAttribute(HtmlClassAttributeName, HtmlHeading1Class), SR2.GetString(SR2.HelpPageRequestErrorTitle)));
169
div.Add(new
XElement
(HtmlPElementName, SR2.GetString(SR2.HelpServerErrorProcessingRequestWithDetails, error.Message)));
170
div.Add(new
XElement
(HtmlPElementName, error.StackTrace ?? String.Empty));
174
div.Add(new
XElement
(HtmlPElementName, SR2.GetString(SR2.HelpServerErrorProcessingRequest)));
185
div.Add(new
XElement
(HtmlPElementName, error.StackTrace ?? String.Empty));
201
XElement div = new
XElement
(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass),
202
new
XElement
(HtmlPElementName, new XAttribute(HtmlClassAttributeName, HtmlHeading1Class), SR2.GetString(SR2.HelpPageTitleText)));
205
div.Add(new
XElement
(HtmlPElementName, SR2.GetString(SR2.HelpPageEndpointNotFound)));
219
XElement div = new
XElement
(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass),
220
new
XElement
(HtmlPElementName, new XAttribute(HtmlClassAttributeName, HtmlHeading1Class), SR2.GetString(SR2.HelpPageTitleText)),
230
new
XElement
(HtmlHtmlElementName,
231
new
XElement
(HtmlHeadElementName,
232
new
XElement
(HtmlTitleElementName, title),
233
new
XElement
("{http://www.w3.org/1999/xhtml}style", SR2.GetString(SR2.HelpPageHtml))),
234
new
XElement
(HtmlBodyElementName)));
255
table.Add(new
XElement
(HtmlTrElementName,
256
new
XElement
(HtmlTdElementName, direction),
257
new
XElement
(HtmlTdElementName, info.FormatString),
258
new
XElement
(HtmlTdElementName, info.BodyDescription)));
265
table.Add(new
XElement
(HtmlTrElementName,
266
new
XElement
(HtmlTdElementName, direction),
267
new
XElement
(HtmlTdElementName, "Xml"),
268
contentTd = new
XElement
(HtmlTdElementName)));
272
contentTd.Add(new
XElement
(HtmlAElementName, new XAttribute(HtmlHrefAttributeName, "#" + (isRequest ? HtmlRequestXmlId : HtmlResponseXmlId)), SR2.GetString(SR2.HelpPageExample)));
280
contentTd.Add(new
XElement
(HtmlAElementName, new XAttribute(HtmlHrefAttributeName, "#" + (isRequest ? HtmlRequestSchemaId : HtmlResponseSchemaId)), SR2.GetString(SR2.HelpPageSchema)));
285
table.Add(new
XElement
(HtmlTrElementName,
286
new
XElement
(HtmlTdElementName, direction),
287
new
XElement
(HtmlTdElementName, "Json"),
288
new
XElement
(HtmlTdElementName,
289
new
XElement
(HtmlAElementName, new XAttribute(HtmlHrefAttributeName, "#" + (isRequest ? HtmlRequestJsonId : HtmlResponseJsonId)), SR2.GetString(SR2.HelpPageExample)))));
360
return new
XElement
(HtmlPElementName,
361
new
XElement
(HtmlPreElementName, new XAttribute(HtmlClassAttributeName, label), content));
365
return new
XElement
(HtmlPElementName,
366
new
XElement
(HtmlAElementName, new XAttribute(HtmlNameAttributeName, label), title),
367
new
XElement
(HtmlPreElementName, new XAttribute(HtmlClassAttributeName, label), content));
System.Xml.Linq (10)
System\Xml\Linq\XLinq.cs (10)
1844
return new
XElement
(reader);
2442
AddNode(new
XElement
(x));
2732
AddNodeSkipNotify(new
XElement
(x));
3036
XElement e = new
XElement
(eCache.Get(r.NamespaceURI).GetName(r.LocalName));
3104
XElement e = new
XElement
(eCache.Get(r.NamespaceURI).GetName(r.LocalName));
3339
AddNode(new
XElement
(x));
4032
XElement e = new
XElement
(reader, options);
4393
AddNode(new
XElement
(name, GetStringValue(value)));
5019
return new
XElement
(this);
8003
AddNode(new
XElement
(XNamespace.Get(namespaceName).GetName(localName)));
XamlBuildTask (8)
Microsoft\Build\Tasks\Xaml\GenerateTemporaryAssemblyTask.cs (8)
154
XElement newItemGroup = new
XElement
(XName.Get("ItemGroup", MSBuildNamespace));
158
XElement newElement = new
XElement
(XName.Get(itemName, MSBuildNamespace));
176
XElement newItemGroup = new
XElement
(XName.Get("ItemGroup", MSBuildNamespace));
180
XElement newResource = new
XElement
(XName.Get("EmbeddedResource", MSBuildNamespace));
183
XElement type = new
XElement
(XName.Get("Type", MSBuildNamespace), "Non-Resx");
186
XElement withCulture = new
XElement
(XName.Get("WithCulture", MSBuildNamespace), "false");
207
XElement newPropertyGroup = new
XElement
(XName.Get("PropertyGroup", MSBuildNamespace));
213
XElement 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)
67
typeof(
XElement
),
System.Activities.Presentation (3)
System.Activities.Presentation\System\Activities\Presentation\View\NamespaceDisplayAutomationPeer.cs (1)
27
XElement
itemStatus = new XElement("NamespaceStatus",
System.Activities.Presentation\System\Activities\Presentation\View\VBIdentifierDesigner.xaml.cs (1)
203
XElement
itemStatus = new XElement("VBIdentifierStatus",
System.Activities.Presentation\System\Activities\Presentation\View\VisualBasicEditorAutomationPeer.cs (1)
26
XElement
itemStatus = new XElement("VisualBasicEditorItemStatus",
System.Data.Entity (2)
System\Data\EntityModel\SchemaObjectModel\SchemaElement.cs (2)
693
XElement
element =
XElement
.Load(new StringReader(subtree.ReadOuterXml()));
System.Data.Entity.Design (1)
System\Data\Entity\Design\EntityCodeGenerator.cs (1)
562
typeof(System.Xml.Linq.
XElement
).Assembly.Location, // System.Xml.Linq.dll
System.Data.Linq (2)
SqlClient\SqlTypeSystemProvider.cs (2)
1455
type == typeof(System.Xml.Linq.
XElement
))
1575
type == typeof(System.Xml.Linq.
XElement
))
System.Data.Services (17)
System\Data\Services\Parsing\WebConvert.cs (7)
118
return type == typeof(System.Xml.Linq.
XElement
) || type == typeof(string);
481
Debug.Assert(typeof(System.Xml.Linq.
XElement
) == targetType, "XElement == " + targetType);
482
targetValue = System.Xml.Linq.
XElement
.Parse(text, System.Xml.Linq.LoadOptions.PreserveWhitespace);
558
else if (typeof(System.Xml.Linq.
XElement
) == targetType)
560
targetValue = System.Xml.Linq.
XElement
.Parse(text, System.Xml.Linq.LoadOptions.PreserveWhitespace);
689
else if (typeof(System.Xml.Linq.
XElement
) == valueType)
691
result = ((System.Xml.Linq.
XElement
)value).ToString(System.Xml.Linq.SaveOptions.None);
System\Data\Services\Providers\ObjectContextServiceProvider.cs (4)
1631
if (!writeCustomElements && (metadataProperty.Value == null || metadataProperty.Value.GetType() != typeof(
XElement
)))
1635
else if (writeCustomElements && metadataProperty.Value != null && metadataProperty.Value.GetType() == typeof(
XElement
))
1637
XElement
annotation = (
XElement
)metadataProperty.Value;
System\Data\Services\Serializers\JsonDeserializer.cs (2)
97
else if (propertyType == typeof(System.Xml.Linq.
XElement
))
99
return System.Xml.Linq.
XElement
.Parse(stringValue, System.Xml.Linq.LoadOptions.PreserveWhitespace);
System\Data\Services\Serializers\JsonSerializer.cs (2)
321
else if (typeof(System.Xml.Linq.
XElement
) == valueType)
323
this.writer.WriteValue(((System.Xml.Linq.
XElement
)value).ToString(System.Xml.Linq.SaveOptions.None));
System\Data\Services\Serializers\SyndicationSerializer.cs (1)
277
XElement
rowCountElement = new XElement(
System\Data\Services\WebUtil.cs (1)
95
new KeyValuePair<Type, string>(typeof(
XElement
), XmlConstants.EdmStringTypeName),
System.Data.Services.Client (29)
parent\Server\System\Data\Services\Parsing\WebConvert.cs (3)
118
return type == typeof(System.Xml.Linq.
XElement
) || type == typeof(string);
689
else if (typeof(System.Xml.Linq.
XElement
) == valueType)
691
result = ((System.Xml.Linq.
XElement
)value).ToString(System.Xml.Linq.SaveOptions.None);
System\Data\Services\Client\AtomMaterializer.cs (8)
1435
Debug.Assert(entry.Tag is
XElement
, "entry.Tag is XElement");
1445
XElement
entryElement = entry.Tag as
XElement
;
1461
private static void ApplyEntityPropertyMappings(AtomEntry entry,
XElement
entryElement, EpmTargetPathSegment target)
1468
Stack<
XElement
> elements = new Stack<
XElement
>();
1476
XElement
element = elements.Pop();
1505
var
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.
177
XElement
element =
XElement
.Load(reader.ReadSubtree(), LoadOptions.None);
System\Data\Services\Client\ClientConvert.cs (3)
188
return System.Xml.Linq.
XElement
.Parse(propertyValue);
353
return ((System.Xml.Linq.
XElement
)propertyValue).ToString();
486
types[(int)StorageType.XElement] = typeof(System.Xml.Linq.
XElement
);
System\Data\Services\Client\DataServiceContext.cs (2)
2239
internal void FireReadingEntityEvent(object entity,
XElement
data)
3343
XElement
complexProperty = new XElement(((XNamespace)this.DataNamespace) + property.PropertyName);
System\Data\Services\Client\MaterializeFromAtom.cs (5)
135
XElement
data = (
XElement
)tag;
506
XElement
element =
XElement
.Load(this.reader);
510
XElement
countNode = element.Descendants(XNamespace.Get(XmlConstants.DataWebMetadataNamespace) + XmlConstants.RowCountElement).FirstOrDefault();
System\Data\Services\Client\ReadingWritingEntityEventArgs.cs (3)
27
private
XElement
data;
34
internal ReadingWritingEntityEventArgs(object entity,
XElement
data)
47
public
XElement
Data
System\Data\Services\Client\XmlUtil.cs (2)
234
internal static void RemoveDuplicateNamespaceAttributes(System.Xml.Linq.
XElement
element)
241
foreach (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>
199
private static
XElement
FitElementToSchema(
XElement
element, string schemaNamespace, string targetNamespace)
209
XElement
result = UpdateNamespaces(element, schemaNamespace, targetNamespace);
356
List<
XElement
> schemaElements = new List<
XElement
>();
378
XElement
fitted = FitElementToSchema(schemaElements[i], schemaNamespace, XmlConstants.EdmV1dot1Namespace);
405
foreach (
var
element in sourceDocument.XPathSelectElements("//edmv1:Schema", namespaceManager))
411
foreach (
var
element in sourceDocument.XPathSelectElements("//edmv1_1:Schema", namespaceManager))
434
private static bool IsSchemaV2(
XElement
element)
446
private static bool TryCreateReadersV2(XDocument sourceDocument, List<
XElement
> schemaElements)
454
var
root = sourceDocument.Root;
464
XElement
dataServiceElement = root.Elements().Where(e => e.Name.LocalName == XmlConstants.EdmxDataServicesElement).FirstOrDefault();
498
private static
XElement
UpdateNamespaces(
XElement
element, string oldNamespaceName, string newNamespaceName)
507
Stack<
XElement
> pending = new Stack<
XElement
>();
511
XElement
e = pending.Pop();
558
foreach (
var
child in e.Elements())
System\Data\Services\Design\Xml\XNodeSchemaApplier.cs (13)
91
internal static void Apply(XmlSchemaSet schemas,
XElement
element)
111
private static bool IsElementExpected(
XElement
element, XmlQualifiedName elementName, XmlSchemaParticle expected)
194
private static bool IsElementExpected(
XElement
element, XmlSchemaParticle[] expectedParticles)
269
private void Validate(
XElement
element)
290
private void PushAncestorsAndSelf(
XElement
element)
311
element = element.Parent as
XElement
;
319
private void PushElement(
XElement
element, ref string xsiType, ref string xsiNil)
352
private void ValidateAttributes(
XElement
element)
370
private void ValidateElement(
XElement
e)
401
private void TrimAttributes(
XElement
element, XmlSchemaAnyAttribute anyAttribute)
437
private void TrimAndValidateNodes(
XElement
parent)
453
XElement
element = node as
XElement
;
System.ServiceModel.Discovery (28)
System\ServiceModel\Discovery\Configuration\EndpointDiscoveryElement.cs (1)
153
behavior.Extensions.Add(
XElement
.Parse(xmlElement.XmlElement.OuterXml));
System\ServiceModel\Discovery\Configuration\FindCriteriaElement.cs (1)
186
findCriteria.Extensions.Add(
XElement
.Parse(xmlElement.XmlElement.OuterXml));
System\ServiceModel\Discovery\EndpointDiscoveryBehavior.cs (4)
21
NonNullItemCollection<
XElement
> extensions;
67
public Collection<
XElement
> Extensions
73
this.extensions = new NonNullItemCollection<
XElement
>();
96
internal Collection<
XElement
> InternalExtensions
System\ServiceModel\Discovery\EndpointDiscoveryMetadata.cs (7)
25
OpenableCollection<
XElement
> extensions;
67
public Collection<
XElement
> Extensions
73
this.extensions = new OpenableCollection<
XElement
>(this.isOpen);
246
foreach (
XElement
xElement in endpointDiscoveryBehavior.InternalExtensions)
400
this.Extensions.Add(
XElement
.ReadFrom(reader) as
XElement
);
435
foreach (
XElement
xElement in Extensions)
System\ServiceModel\Discovery\FindCriteria.cs (8)
38
NonNullItemCollection<
XElement
> extensions;
75
public Collection<
XElement
> Extensions
81
this.extensions = new NonNullItemCollection<
XElement
>();
347
XElement
xElement =
XElement
.ReadFrom(reader) as
XElement
;
391
foreach (
XElement
xElement in Extensions)
430
foreach (
XElement
extension in this.Extensions)
System\ServiceModel\Discovery\ResolveCriteria.cs (7)
21
NonNullItemCollection<
XElement
> extensions;
73
public Collection<
XElement
> Extensions
79
this.extensions = new NonNullItemCollection<
XElement
>();
126
XElement
xElement =
XElement
.ReadFrom(reader) as
XElement
;
159
foreach (
XElement
xElement in Extensions)
System.ServiceModel.Web (31)
System\ServiceModel\Dispatcher\HelpHtmlBuilder.cs (27)
59
XElement
table = new XElement(HtmlTableElementName,
66
XElement
firstTr = null;
76
XElement
tr = new XElement(HtmlTrElementName,
85
XElement
td = new XElement(HtmlTdElementName, operationUri == lastOperation ? String.Empty : operationUri);
111
XElement
table = new XElement(HtmlTableElementName,
120
XElement
div = new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass),
123
XElement
.Parse(SR2.GetString(SR2.HelpPageOperationUri, HttpUtility.HtmlEncode(BuildFullUriTemplate(baseUri, operationInfo.UriTemplate)))),
124
XElement
.Parse(SR2.GetString(SR2.HelpPageOperationMethod, HttpUtility.HtmlEncode(operationInfo.Method))));
127
div.Add(
XElement
.Parse(SR2.GetString(SR2.HelpPageCallbackText, HttpUtility.HtmlEncode(operationInfo.JavascriptCallbackParameterName))), table);
144
XElement
div = new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass),
152
div.Add(
XElement
.Parse(SR2.GetString(SR2.HelpPageMethodNotAllowedWithLink, HttpUtility.HtmlEncode(helpUri.AbsoluteUri))));
162
XElement
div = new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass),
184
div.Add(
XElement
.Parse(SR2.GetString(SR2.HelpServerErrorProcessingRequestWithDetailsAndLink, encodedHelpLink, errorMessage)));
189
div.Add(
XElement
.Parse(SR2.GetString(SR2.HelpServerErrorProcessingRequestWithLink, encodedHelpLink)));
201
XElement
div = new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass),
209
div.Add(
XElement
.Parse(SR2.GetString(SR2.HelpPageEndpointNotFoundWithLink, HttpUtility.HtmlEncode(helpUri.AbsoluteUri))));
219
XElement
div = new XElement(HtmlDivElementName, new XAttribute(HtmlIdAttributeName, HtmlContentClass),
221
XElement
.Parse(SR2.GetString(SR2.HelpPageRedirect, HttpUtility.HtmlEncode(originalTo), HttpUtility.HtmlEncode(newLocation))));
247
static void RenderMessageInformation(
XElement
table, OperationHelpInformation operationInfo, bool isRequest)
264
XElement
contentTd;
294
static void CreateOperationSamples(
XElement
element, OperationHelpInformation operationInfo)
339
private static
XElement
XmlSchemaToXElement(XmlSchema schema)
356
static
XElement
AddSample(object content, string title, string label)
371
static
XElement
GenerateSampleXml(
XElement
content, string title, string label)
381
static
XElement
AddSampleJson(
XElement
content, string title, string label)
System\ServiceModel\Dispatcher\HelpPage.cs (3)
289
public
XElement
XmlExample { get; private set; }
290
public
XElement
JsonExample { get; private set; }
348
else if (typeof(
XElement
).IsAssignableFrom(type) || typeof(XmlElement).IsAssignableFrom(type))
System\ServiceModel\Web\WebOperationContext.cs (1)
164
public Message CreateXmlResponse(
XElement
element)
System.Web.DynamicData (1)
DynamicData\ModelProviders\DLinqColumnProvider.cs (1)
106
if (memberType == typeof(
XElement
)) {
System.Xml.Linq (639)
System\Xml\Linq\XComponentModel.cs (52)
35
if (typeof(T) == typeof(
XElement
)) {
116
class XElementAttributePropertyDescriptor : XPropertyDescriptor<
XElement
, object>
125
return value = new XDeferredSingleton<XAttribute>((e, n) => e.Attribute(n), component as
XElement
, null);
158
class XElementDescendantsPropertyDescriptor : XPropertyDescriptor<
XElement
, IEnumerable<
XElement
>>
160
XDeferredAxis<
XElement
> value;
167
return value = new XDeferredAxis<
XElement
>((e, n) => n != null ? e.Descendants(n) : e.Descendants(), component as
XElement
, null);
175
XElement
e = sender as
XElement
;
181
e = sender as
XElement
;
194
XElement
e = sender as
XElement
;
201
class XElementElementPropertyDescriptor : XPropertyDescriptor<
XElement
, object>
203
XDeferredSingleton<
XElement
> value;
204
XElement
changeState;
210
return value = new XDeferredSingleton<
XElement
>((e, n) => e.Element(n), component as
XElement
, null);
217
XElement
e = sender as
XElement
;
223
e = sender as
XElement
;
230
e = sender as
XElement
;
249
XElement
e = sender as
XElement
;
256
class XElementElementsPropertyDescriptor : XPropertyDescriptor<
XElement
, IEnumerable<
XElement
>>
258
XDeferredAxis<
XElement
> value;
265
return value = new XDeferredAxis<
XElement
>((e, n) => n != null ? e.Elements(n) : e.Elements(), component as
XElement
, null);
272
XElement
e = sender as
XElement
;
278
e = sender as
XElement
;
285
e = sender as
XElement
;
298
XElement
e = sender as
XElement
;
302
e = sender as
XElement
;
309
class XElementValuePropertyDescriptor : XPropertyDescriptor<
XElement
, string>
311
XElement
element;
321
element = component as
XElement
;
327
element = component as
XElement
;
337
if (sender is
XElement
|| sender is XText) {
350
class XElementXmlPropertyDescriptor : XPropertyDescriptor<
XElement
, string>
352
XElement
element;
358
element = component as
XElement
;
402
Func<
XElement
, XName, IEnumerable<T>> func;
403
internal
XElement
element;
406
public XDeferredAxis(Func<
XElement
, XName, IEnumerable<T>> func,
XElement
element, XName name) {
438
Func<
XElement
, XName, T> func;
439
internal
XElement
element;
442
public 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.
975
public
XElement
Parent {
976
get { return parent as
XElement
; }
1449
/// <see cref="
XElement
"/>,
1619
public IEnumerable<
XElement
> Ancestors() {
1635
public IEnumerable<
XElement
> Ancestors(XName name) {
1636
return name != null ? GetAncestors(name, false) :
XElement
.EmptySequence;
1757
public IEnumerable<
XElement
> ElementsAfterSelf() {
1770
public IEnumerable<
XElement
> ElementsAfterSelf(XName name) {
1771
return name != null ? GetElementsAfterSelf(name) :
XElement
.EmptySequence;
1781
public IEnumerable<
XElement
> ElementsBeforeSelf() {
1794
public IEnumerable<
XElement
> ElementsBeforeSelf(XName name) {
1795
return name != null ? GetElementsBeforeSelf(name) :
XElement
.EmptySequence;
1923
/// <see cref="
XElement
"/> nodes are equal if they have the same tag name, the same
1951
internal IEnumerable<
XElement
> GetAncestors(XName name, bool self) {
1952
XElement
e = (self ? this : parent) as
XElement
;
1955
e = e.parent as
XElement
;
1959
IEnumerable<
XElement
> GetElementsAfterSelf(XName name) {
1963
XElement
e = n as
XElement
;
1968
IEnumerable<
XElement
> GetElementsBeforeSelf(XName name) {
1974
XElement
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.
2538
public 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>
2548
public IEnumerable<
XElement
> Descendants(XName name) {
2549
return name != null ? GetDescendants(name, false) :
XElement
.EmptySequence;
2561
/// An <see cref="
XElement
"/> child that matches the <see cref="XName"/> passed in, or null.
2563
public
XElement
Element(XName name) {
2568
XElement
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.
2584
public 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
2598
public IEnumerable<
XElement
> Elements(XName name) {
2599
return 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()"/>
2640
if (this is
XElement
) {
2783
if (this is
XElement
) {
2959
internal IEnumerable<
XElement
> GetDescendants(XName name, bool self) {
2961
XElement
e = (
XElement
)this;
2975
XElement
e = n as
XElement
;
2981
IEnumerable<
XElement
> GetElements(XName name) {
2986
XElement
e = n as
XElement
;
3036
XElement
e = new XElement(eCache.Get(r.NamespaceURI).GetName(r.LocalName));
3104
XElement
e = new XElement(eCache.Get(r.NamespaceURI).GetName(r.LocalName));
3136
XElement
e = c as
XElement
;
3299
if (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
>))]
3443
static IEnumerable<
XElement
> emptySequence;
3448
public static IEnumerable<
XElement
> EmptySequence {
3450
if (emptySequence == null) emptySequence = new
XElement
[0];
3508
public XElement(
XElement
other) : base(other) {
3564
if (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
"/>.
3652
public 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"/>.
3670
public IEnumerable<
XElement
> AncestorsAndSelf(XName name) {
3671
return 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
"/>
3749
public 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"/>.
3765
public IEnumerable<
XElement
> DescendantsAndSelf(XName name) {
3766
return 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
"/>
3802
XElement
e = this;
3823
e = 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
3871
public 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
3904
public 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
3923
public 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
3948
public 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
3966
public 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
3991
public 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
4010
public 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
4029
public static
XElement
Load(XmlReader reader, LoadOptions options) {
4032
XElement
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.
4054
public 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.
4081
public 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"/>
4384
XElement
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"/>.
4444
public 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"/>.
4466
public 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"/>?.
4485
public 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"/>.
4507
public 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"/>?.
4526
public 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"/>.
4548
public 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"/>?.
4567
public 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"/>.
4589
public 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"/>?.
4608
public 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"/>.
4630
public 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"/>?.
4649
public 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"/>.
4671
public 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"/>?.
4690
public 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"/>.
4712
public 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"/>?.
4731
public 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"/>.
4753
public 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"/>?.
4772
public 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"/>.
4794
public 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"/>?.
4813
public 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"/>.
4835
public 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"/>?.
4854
public 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"/>.
4876
public 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"/>?.
4895
public 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"/>.
4917
public 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"/>?.
4936
public 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
"/>
5004
bool AttributesEqual(
XElement
e) {
5023
XElement
e = node as
XElement
;
5037
string GetNamespaceOfPrefixInScope(string prefix,
XElement
outOfScope) {
5038
XElement
e = this;
5048
e = e.parent as
XElement
;
5149
public void WriteElement(
XElement
e) {
5151
XElement
root = e;
5154
e = n as
XElement
;
5195
void PushAncestors(
XElement
e) {
5197
e = e.parent as
XElement
;
5211
void PushElement(
XElement
e) {
5234
void WriteStartElement(
XElement
e) {
5514
public
XElement
Root {
5516
return GetFirstNode<
XElement
>();
6621
get { return parent != null && ((
XElement
)parent).lastAttr != this ? next : null; }
6646
XAttribute a = ((
XElement
)parent).lastAttr;
6650
return 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"/>
7135
if (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
"/>.
7525
public 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
"/>.
7540
public 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
"/>.
7555
public 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
"/>.
7570
public static IEnumerable<
XElement
> Ancestors<T>(this IEnumerable<T> source, XName name) where T: XNode {
7572
return 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
"/>.
7587
public 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
"/>.
7604
public static IEnumerable<
XElement
> AncestorsAndSelf(this IEnumerable<
XElement
> source, XName name) {
7606
return 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
"/>.
7645
public 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
"/>.
7660
public static IEnumerable<
XElement
> Descendants<T>(this IEnumerable<T> source, XName name) where T: XContainer {
7662
return 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
"/>.
7677
public 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
"/>.
7694
public 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
"/>.
7711
public static IEnumerable<
XElement
> DescendantsAndSelf(this IEnumerable<
XElement
> source, XName name) {
7713
return 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
"/>.
7724
public 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
"/>.
7737
public static IEnumerable<
XElement
> Elements<T>(this IEnumerable<T> source, XName name) where T: XContainer {
7739
return 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
"/>.
7777
static IEnumerable<XAttribute> GetAttributes(IEnumerable<
XElement
> source, XName name) {
7778
foreach (
XElement
e in source) {
7791
static IEnumerable<
XElement
> GetAncestors<T>(IEnumerable<T> source, XName name, bool self) where T: XNode {
7794
XElement
e = (self ? node : node.parent) as
XElement
;
7797
e = e.parent as
XElement
;
7825
static IEnumerable<
XElement
> GetDescendants<T>(IEnumerable<T> source, XName name, bool self) where T: XContainer {
7829
XElement
e = (
XElement
)root;
7843
XElement
e = n as
XElement
;
7851
static IEnumerable<
XElement
> GetElements<T>(IEnumerable<T> source, XName name) where T: XContainer {
7858
XElement
e = n as
XElement
;
7942
parent = ((
XElement
)parent).parent;
7968
XElement
e = (
XElement
)parent;
8096
XElement
e = GetElementInAttributeScope();
8164
XElement
e = GetElementInAttributeScope();
8207
XElement
e = source as
XElement
;
8220
XElement
e = source as
XElement
;
8257
XElement
e = source as
XElement
;
8310
XElement
e = source as
XElement
;
8372
XElement
e = GetElementInScope();
8380
e = e.parent as
XElement
;
8392
XElement
e = GetElementInScope();
8407
e = e.parent as
XElement
;
8425
XElement
e = GetElementInAttributeScope();
8461
XElement
e = GetElementInAttributeScope();
8496
XElement
e = GetElementInAttributeScope();
8520
XElement
e = GetElementInScope();
8534
XElement
e = GetElementInAttributeScope();
8564
XElement
e = GetElementInAttributeScope();
8601
XElement
e = GetElementInAttributeScope();
8643
XElement
e = GetElementInAttributeScope();
8666
XElement
e = source as
XElement
;
8694
if (a.parent != null && ((
XElement
)a.parent).lastAttr != a) {
8747
XElement
c = source as
XElement
;
8752
foreach (
XElement
e in c.Descendants()) {
8766
XElement
e = source as
XElement
;
8785
foreach (
XElement
e in n.ElementsAfterSelf()) {
8793
if (n.parent is
XElement
) {
8800
if (parent is
XElement
) {
8859
XElement
e = source as
XElement
;
8878
XElement
e = source as
XElement
;
8901
XElement
e = source as
XElement
;
8936
XElement
GetElementInAttributeScope() {
8937
XElement
e = source as
XElement
;
8946
return (
XElement
)a.parent;
8950
return (
XElement
)a.parent;
8955
XElement
GetElementInScope() {
8956
XElement
e = source as
XElement
;
8962
return n.parent as
XElement
;
8966
return (
XElement
)a.parent;
8968
e = parent as
XElement
;
8974
return (
XElement
)a.parent;
8979
static void GetNameInAttributeScope(string qualifiedName,
XElement
e, out string localName, out string namespaceName) {
9001
XElement
e = source as
XElement
;
9036
bool ReadIntoElement(
XElement
e) {
9064
XElement
e = (
XElement
)a.parent;
9094
if (parent is
XElement
) {
9140
XElement
element = candidateAttribute.parent as
XElement
;
9145
element = element.parent as
XElement
;
9173
element = element.parent as
XElement
;
9190
XElement
e = candidate.parent as
XElement
;
System\Xml\Linq\XNodeNavigator.cs (54)
43
XElement
parent;
73
XElement
e = source as
XElement
;
104
if (s.Length != 0 && (c.parent != null || c is
XElement
)) {
114
XElement
e = source as
XElement
;
124
XElement
e = source as
XElement
;
157
XElement
e = source as
XElement
;
206
XElement
e = source as
XElement
;
244
return ((
XElement
)o).Value;
248
XElement
root = ((XDocument)o).Root;
292
XElement
e = source as
XElement
;
317
XElement
e = n as
XElement
;
356
parent = (
XElement
)c;
365
XElement
e = source as
XElement
;
396
if (s.Length != 0 && (c.parent != null || c is
XElement
)) {
398
parent = (
XElement
)c;
406
XElement
e = source as
XElement
;
440
XElement
e = source as
XElement
;
491
XElement
e = n as
XElement
;
529
XElement
e = (
XElement
)a.parent;
672
if (c.parent != null || c is
XElement
) {
704
static XAttribute GetFirstNamespaceDeclarationGlobal(
XElement
e) {
710
e = e.parent as
XElement
;
715
static XAttribute GetFirstNamespaceDeclarationLocal(
XElement
e) {
729
XElement
e = (
XElement
)a.parent;
737
e = e.parent as
XElement
;
745
XElement
e = (
XElement
)a.parent;
765
static bool HasNamespaceDeclarationInScope(XAttribute a,
XElement
e) {
771
e = e.parent as
XElement
;
864
/// Select an <see cref="
XElement
"/> using a XPath expression
868
/// <returns>An <see cref="
XElement
"> or null</see></returns>
869
public 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>
881
public static
XElement
XPathSelectElement(this XNode node, string expression, IXmlNamespaceResolver resolver) {
886
/// Select a set of <see cref="
XElement
"/> using a XPath expression
891
public static IEnumerable<
XElement
> XPathSelectElements(this XNode node, string expression) {
896
/// Select a set of <see cref="
XElement
"/> using a XPath expression
903
public static IEnumerable<
XElement
> XPathSelectElements(this XNode node, string expression, IXmlNamespaceResolver resolver) {
905
return (IEnumerable<
XElement
>)new XPathEvaluator().Evaluate<
XElement
>(node, expression, resolver);
System\Xml\Linq\XNodeValidator.cs (16)
72
ValidateElement((
XElement
)source);
144
void PushAncestorsAndSelf(
XElement
e) {
161
e = e.parent as
XElement
;
165
void PushElement(
XElement
e, ref string xsiType, ref string xsiNil) {
213
void ValidateAttributes(
XElement
e) {
247
void ValidateElement(
XElement
e) {
269
void ValidateNodes(
XElement
e) {
275
XElement
c = n as
XElement
;
362
/// Gets the schema information that has been assigned to the <see cref="
XElement
"/> as a result of schema validation.
366
public static IXmlSchemaInfo GetSchemaInfo(this
XElement
source) {
412
/// Validate a <see cref="
XElement
"/>
422
public 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
441
public static void Validate(this
XElement
source, XmlSchemaObject partialValidationType, XmlSchemaSet schemas, ValidationEventHandler validationEventHandler, bool addSchemaInfo) {
XamlBuildTask (16)
Microsoft\Build\Tasks\Xaml\GenerateTemporaryAssemblyTask.cs (16)
90
XElement
projectElement = projectDocument.Element(XName.Get("Project", MSBuildNamespace));
141
void RemoveItemsByName(
XElement
project, string itemName)
145
IEnumerable<
XElement
> itemGroups = project.Elements(XName.Get("ItemGroup", MSBuildNamespace));
150
void AddNewItems(
XElement
project, string itemName, ITaskItem[] items)
154
XElement
newItemGroup = new XElement(XName.Get("ItemGroup", MSBuildNamespace));
158
XElement
newElement = new XElement(XName.Get(itemName, MSBuildNamespace));
172
void AddNewResourceItems(
XElement
project, ITaskItem[] items)
176
XElement
newItemGroup = new XElement(XName.Get("ItemGroup", MSBuildNamespace));
180
XElement
newResource = new XElement(XName.Get("EmbeddedResource", MSBuildNamespace));
183
XElement
type = new XElement(XName.Get("Type", MSBuildNamespace), "Non-Resx");
186
XElement
withCulture = new XElement(XName.Get("WithCulture", MSBuildNamespace), "false");
194
void RemovePropertyByName(
XElement
project, string propertyName)
198
IEnumerable<
XElement
> itemGroups = project.Elements(XName.Get("PropertyGroup", MSBuildNamespace));
203
void AddNewProperties(
XElement
project, IEnumerable<ProjectProperty> properties)
207
XElement
newPropertyGroup = new XElement(XName.Get("PropertyGroup", MSBuildNamespace));
213
XElement
newElement = new XElement(XName.Get(prop.Name, MSBuildNamespace));