本文整理汇总了C#中System.Xml.Linq.XDocument.BuildDescendants方法的典型用法代码示例。如果您正苦于以下问题:C# XDocument.BuildDescendants方法的具体用法?C# XDocument.BuildDescendants怎么用?C# XDocument.BuildDescendants使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Linq.XDocument
的用法示例。
在下文中一共展示了XDocument.BuildDescendants方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFrameworkVersion
void GetFrameworkVersion(XDocument xDocument)
{
FrameworkVersionAsString = xDocument.BuildDescendants("TargetFrameworkVersion")
.Select(c => c.Value)
.First();
FrameworkVersionAsNumber = decimal.Parse(FrameworkVersionAsString.Remove(0, 1), CultureInfo.InvariantCulture);
}
示例2: GetIsSilverlight
static bool GetIsSilverlight(XDocument xDocument)
{
var targetFrameworkIdentifier = xDocument.BuildDescendants("TargetFrameworkIdentifier")
.Select(c => c.Value)
.FirstOrDefault();
return (string.Equals(targetFrameworkIdentifier, "Silverlight", StringComparison.OrdinalIgnoreCase));
}
示例3: GetTargetFrameworkIdentifier
void GetTargetFrameworkIdentifier(XDocument xDocument)
{
var targetFrameworkIdentifier = xDocument.BuildDescendants("TargetFrameworkIdentifier")
.Select(c => c.Value)
.FirstOrDefault();
if (string.Equals(targetFrameworkIdentifier, "Silverlight", StringComparison.OrdinalIgnoreCase))
{
IsSilverlight = true;
}
}
示例4: ContainsEmbedTask
static bool ContainsEmbedTask(XDocument xDocument)
{
try
{
return xDocument.BuildDescendants("Costura.EmbedTask").Any();
}
catch (Exception exception)
{
throw new Exception("Could not check project for Costura.EmbedTask", exception);
}
}
示例5: Check
public bool Check(XDocument xDocument)
{
try
{
if (xDocument.BuildDescendants("Fody.WeavingTask").Any())
{
return true;
}
return xDocument.BuildDescendants("Import")
.Any(x =>
{
var xAttribute = x.Attribute("Project");
return xAttribute != null && xAttribute.Value.EndsWith("Fody.targets");
});
}
catch (Exception exception)
{
throw new Exception("Could not check project for weaving task.", exception);
}
}
示例6: ContainsWeavingTask
static bool ContainsWeavingTask(XDocument xDocument)
{
try
{
return xDocument.BuildDescendants("NotifyPropertyWeaverMsBuildTask.WeavingTask").Any();
}
catch (Exception exception)
{
throw new Exception("Could not check project for weaving task.", exception);
}
}
示例7: GetTargetFrameworkProfile
static string GetTargetFrameworkProfile(XDocument xDocument)
{
return xDocument.BuildDescendants("TargetFrameworkProfile")
.Select(c => c.Value)
.FirstOrDefault();
}
示例8: GetTargetFrameworkProfile
void GetTargetFrameworkProfile(XDocument xDocument)
{
TargetFrameworkProfile = xDocument.BuildDescendants("TargetFrameworkProfile")
.Select(c => c.Value)
.FirstOrDefault();
}