本文整理汇总了C#中Element.OnlyAttributeEmptyOrNull方法的典型用法代码示例。如果您正苦于以下问题:C# Element.OnlyAttributeEmptyOrNull方法的具体用法?C# Element.OnlyAttributeEmptyOrNull怎么用?C# Element.OnlyAttributeEmptyOrNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Element
的用法示例。
在下文中一共展示了Element.OnlyAttributeEmptyOrNull方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnlyAttributeEmptyOrNull_TwoAttributesWithValues
public void OnlyAttributeEmptyOrNull_TwoAttributesWithValues()
{
Element element = new Element();
element.MaxOccurs = 1;
element.MinOccurs = 0;
element.Name = "baseElement";
element.Parent = null;
element.RootElement = true;
element.SpecialLength = false;
element.Type = "DataType.String";
element.Value = "baseElement";
element.Documentation = "baseElement";
element.IsAdvanced = true;
NewRelic.AgentConfiguration.Parts.Attribute attribute = new NewRelic.AgentConfiguration.Parts.Attribute();
attribute.Name = "attributeName";
attribute.Parent = element;
attribute.Value = "attributeValue";
element.Attributes.Add(attribute);
NewRelic.AgentConfiguration.Parts.Attribute attribute2 = new NewRelic.AgentConfiguration.Parts.Attribute();
attribute2.Name = "attribute2Name";
attribute2.Parent = element;
attribute2.Value = "attribute2Value";
element.Attributes.Add(attribute2);
Assert.IsFalse(element.OnlyAttributeEmptyOrNull());
}
示例2: OnlyAttributeEmptyOrNull_NoAttribute
public void OnlyAttributeEmptyOrNull_NoAttribute()
{
Element element = new Element();
element.MaxOccurs = 1;
element.MinOccurs = 0;
element.Name = "baseElement";
element.Parent = null;
element.RootElement = true;
element.SpecialLength = false;
element.Type = "DataType.String";
element.Value = "baseElement";
element.Documentation = "baseElement";
element.IsAdvanced = true;
Assert.IsTrue(element.OnlyAttributeEmptyOrNull());
}