本文整理汇总了C#中System.Security.SecurityElement.GetAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# SecurityElement.GetAttribute方法的具体用法?C# SecurityElement.GetAttribute怎么用?C# SecurityElement.GetAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Security.SecurityElement
的用法示例。
在下文中一共展示了SecurityElement.GetAttribute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Equal
public bool Equal (SecurityElement other)
{
if (other == null)
return false;
if (this == other)
return true;
if (this.text != other.text)
return false;
if (this.tag != other.tag)
return false;
if (this.attributes == null && other.attributes != null && other.attributes.Count != 0)
return false;
if (other.attributes == null && this.attributes != null && this.attributes.Count != 0)
return false;
if (this.attributes != null && other.attributes != null) {
if (this.attributes.Count != other.attributes.Count)
return false;
foreach (SecurityAttribute sa1 in attributes) {
SecurityAttribute sa2 = other.GetAttribute (sa1.Name);
if ((sa2 == null) || (sa1.Value != sa2.Value))
return false;
}
}
if (this.children == null && other.children != null && other.children.Count != 0)
return false;
if (other.children == null && this.children != null && this.children.Count != 0)
return false;
if (this.children != null && other.children != null) {
if (this.children.Count != other.children.Count)
return false;
for (int i = 0; i < this.children.Count; i++)
if (!((SecurityElement) this.children [i]).Equal ((SecurityElement) other.children [i]))
return false;
}
return true;
}