本文整理汇总了C#中System.Security.SecurityElement.AddChild方法的典型用法代码示例。如果您正苦于以下问题:C# System.Security.SecurityElement.AddChild方法的具体用法?C# System.Security.SecurityElement.AddChild怎么用?C# System.Security.SecurityElement.AddChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Security.SecurityElement
的用法示例。
在下文中一共展示了System.Security.SecurityElement.AddChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToXml
/// <include file='doc\PrincipalPermission.uex' path='docs/doc[@for="PrincipalPermission.ToXml"]/*' />
public SecurityElement ToXml()
{
SecurityElement root = new SecurityElement( "Permission" );
XMLUtil.AddClassAttribute( root, this.GetType() );
root.AddAttribute( "version", "1" );
int count = m_array.Length;
for (int i = 0; i < count; ++i)
{
root.AddChild( m_array[i].ToXml() );
}
return root;
}
示例2: ToXml
public SecurityElement ToXml()
{
SecurityElement root = new SecurityElement( "IPermission" );
XMLUtil.AddClassAttribute( root, this.GetType(), "System.Security.Permissions.PrincipalPermission" );
// If you hit this assert then most likely you are trying to change the name of this class.
// This is ok as long as you change the hard coded string above and change the assert below.
Contract.Assert( this.GetType().FullName.Equals( "System.Security.Permissions.PrincipalPermission" ), "Class name changed!" );
root.AddAttribute( "version", "1" );
int count = m_array.Length;
for (int i = 0; i < count; ++i)
{
root.AddChild( m_array[i].ToXml() );
}
return root;
}
示例3: ToXml
internal SecurityElement ToXml()
{
SecurityElement e = new SecurityElement( "PublicKeyBlob" );
e.AddChild( new SecurityElement( "Key", Hex.EncodeHexString( PublicKey ) ) );
return e;
}