本文整理汇总了C#中System.Security.SecurityElement.Attribute方法的典型用法代码示例。如果您正苦于以下问题:C# System.Security.SecurityElement.Attribute方法的具体用法?C# System.Security.SecurityElement.Attribute怎么用?C# System.Security.SecurityElement.Attribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Security.SecurityElement
的用法示例。
在下文中一共展示了System.Security.SecurityElement.Attribute方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FromXml
internal void FromXml( SecurityElement e )
{
String elAuth = e.Attribute( "Authenticated" );
if (elAuth != null)
{
m_authenticated = String.Compare( elAuth, "true", true, CultureInfo.InvariantCulture) == 0;
}
else
{
m_authenticated = false;
}
String elID = e.Attribute( "ID" );
if (elID != null)
{
m_id = elID;
}
else
{
m_id = null;
}
String elRole = e.Attribute( "Role" );
if (elRole != null)
{
m_role = elRole;
}
else
{
m_role = null;
}
}
示例2: FromXml
internal void FromXml( SecurityElement e )
{
String elAuth = e.Attribute( "Authenticated" );
if (elAuth != null)
{
m_authenticated = String.Compare( elAuth, "true", StringComparison.OrdinalIgnoreCase) == 0;
}
else
{
m_authenticated = false;
}
String elID = e.Attribute( "ID" );
if (elID != null)
{
m_id = elID;
}
else
{
m_id = null;
}
String elRole = e.Attribute( "Role" );
if (elRole != null)
{
m_role = elRole;
}
else
{
m_role = null;
}
}
示例3: FromXml
public override void FromXml(SecurityElement esd)
{
m_unrestricted = false;
m_urls = null;
CodeAccessPermission.ValidateElement( esd, this );
String unr = esd.Attribute( "Unrestricted" );
if(unr != null && String.Compare(unr, "true", StringComparison.OrdinalIgnoreCase) == 0)
{
m_unrestricted = true;
return;
}
String elem = esd.Attribute( "Url" );
List<URLString> al = new List<URLString>();
if(elem != null)
al.Add(new URLString( elem, true ));
ArrayList alChildren = esd.Children;
if(alChildren != null)
{
foreach(SecurityElement child in alChildren)
{
elem = child.Attribute( "Url" );
if(elem != null)
al.Add(new URLString( elem, true ));
}
}
if(al.Count != 0)
m_urls = al.ToArray();
}
示例4: FromXml
public override void FromXml(SecurityElement e)
{
m_unrestricted = false;
m_strongNames = null;
CodeAccessPermission.ValidateElement( e, this );
String unr = e.Attribute( "Unrestricted" );
if(unr != null && String.Compare(unr, "true", StringComparison.OrdinalIgnoreCase) == 0)
{
m_unrestricted = true;
return;
}
String elBlob = e.Attribute("PublicKeyBlob");
String elName = e.Attribute("Name");
String elVersion = e.Attribute("AssemblyVersion");
StrongName2 sn;
ArrayList al = new ArrayList();
if(elBlob != null || elName != null || elVersion != null)
{
sn = new StrongName2(
(elBlob == null ? null : new StrongNamePublicKeyBlob(elBlob)),
elName,
(elVersion == null ? null : new Version(elVersion)));
al.Add(sn);
}
ArrayList alChildren = e.Children;
if(alChildren != null)
{
foreach(SecurityElement child in alChildren)
{
elBlob = child.Attribute("PublicKeyBlob");
elName = child.Attribute("Name");
elVersion = child.Attribute("AssemblyVersion");
if(elBlob != null || elName != null || elVersion != null)
{
sn = new StrongName2(
(elBlob == null ? null : new StrongNamePublicKeyBlob(elBlob)),
elName,
(elVersion == null ? null : new Version(elVersion)));
al.Add(sn);
}
}
}
if(al.Count != 0)
m_strongNames = (StrongName2[])al.ToArray(typeof(StrongName2));
}
示例5: FromXml
public override void FromXml(SecurityElement esd)
{
m_zones = 0;
CodeAccessPermission.ValidateElement( esd, this );
String eZone = esd.Attribute( "Zone" );
if (eZone != null)
SecurityZone = (SecurityZone)Enum.Parse( typeof( SecurityZone ), eZone );
if(esd.Children != null)
{
foreach(SecurityElement child in esd.Children)
{
eZone = child.Attribute( "Zone" );
int enm = (int)Enum.Parse( typeof( SecurityZone ), eZone );
if(enm == (int)SecurityZone.NoZone)
continue;
m_zones |= ((uint)1 << enm);
}
}
}
示例6: FromXml
[System.Security.SecuritySafeCritical] // auto-generated
public override void FromXml(SecurityElement esd)
{
CodeAccessPermission.ValidateElement(esd, this);
String et;
if (XMLUtil.IsUnrestricted(esd))
{
m_unrestricted = true;
return;
}
m_unrestricted = false;
et = esd.Attribute("Read");
if (et != null)
{
m_read = new FileIOAccess(et);
}
else
{
m_read = null;
}
et = esd.Attribute("Write");
if (et != null)
{
m_write = new FileIOAccess(et);
}
else
{
m_write = null;
}
et = esd.Attribute("Append");
if (et != null)
{
m_append = new FileIOAccess(et);
}
else
{
m_append = null;
}
et = esd.Attribute("PathDiscovery");
if (et != null)
{
m_pathDiscovery = new FileIOAccess(et);
m_pathDiscovery.PathDiscovery = true;
}
else
{
m_pathDiscovery = null;
}
et = esd.Attribute("ViewAcl");
if (et != null)
{
m_viewAcl = new FileIOAccess(et);
}
else
{
m_viewAcl = null;
}
et = esd.Attribute("ChangeAcl");
if (et != null)
{
m_changeAcl = new FileIOAccess(et);
}
else
{
m_changeAcl = null;
}
}
示例7: FromXml
[System.Security.SecuritySafeCritical] // auto-generated
public override void FromXml(SecurityElement esd)
{
CodeAccessPermission.ValidateElement( esd, this );
String et;
if (XMLUtil.IsUnrestricted( esd ))
{
m_unrestricted = true;
return;
}
m_unrestricted = false;
m_read = null;
m_write = null;
m_create = null;
m_viewAcl = null;
m_changeAcl = null;
et = esd.Attribute( "Read" );
if (et != null)
{
m_read = new StringExpressionSet( et );
}
et = esd.Attribute( "Write" );
if (et != null)
{
m_write = new StringExpressionSet( et );
}
et = esd.Attribute( "Create" );
if (et != null)
{
m_create = new StringExpressionSet( et );
}
et = esd.Attribute( "ViewAccessControl" );
if (et != null)
{
m_viewAcl = new StringExpressionSet( et );
}
et = esd.Attribute( "ChangeAccessControl" );
if (et != null)
{
m_changeAcl = new StringExpressionSet( et );
}
}
示例8: FromXml
/// <include file='doc\ZoneIdentityPermission.uex' path='docs/doc[@for="ZoneIdentityPermission.FromXml"]/*' />
public override void FromXml(SecurityElement esd)
{
CodeAccessPermission.ValidateElement( esd, this );
String eZone = esd.Attribute( "Zone" );
if (eZone == null)
{
m_zone = SecurityZone.NoZone;
}
else
{
m_zone = (SecurityZone)Enum.Parse( typeof( SecurityZone ), eZone );
}
}
示例9: FromXml
/// <include file='doc\StrongNameIdentityPermission.uex' path='docs/doc[@for="StrongNameIdentityPermission.FromXml"]/*' />
public override void FromXml(SecurityElement e)
{
CodeAccessPermission.ValidateElement( e, this );
if (e == null)
throw new ArgumentNullException( "e" );
String elBlob = e.Attribute( "PublicKeyBlob" );
if (elBlob != null)
{
m_publicKeyBlob = new StrongNamePublicKeyBlob( elBlob );
}
else
{
m_publicKeyBlob = null;
}
String elName = e.Attribute( "Name" );
m_name = elName == null ? null : elName;
String elVersion = e.Attribute( "AssemblyVersion" );
m_version = elVersion == null ? null : new Version( elVersion );
}
示例10: FromXml
public override void FromXml(SecurityElement esd)
{
m_unrestricted = false;
m_certs = null;
CodeAccessPermission.ValidateElement( esd, this );
String unr = esd.Attribute( "Unrestricted" );
if(unr != null && String.Compare(unr, "true", StringComparison.OrdinalIgnoreCase) == 0)
{
m_unrestricted = true;
return;
}
String elem = esd.Attribute( "X509v3Certificate" );
ArrayList al = new ArrayList();
if(elem != null)
al.Add(new X509Certificate(System.Security.Util.Hex.DecodeHexString(elem)));
ArrayList alChildren = esd.Children;
if(alChildren != null)
{
foreach(SecurityElement child in alChildren)
{
elem = child.Attribute( "X509v3Certificate" );
if(elem != null)
al.Add(new X509Certificate(System.Security.Util.Hex.DecodeHexString(elem)));
}
}
if(al.Count != 0)
m_certs = (X509Certificate[])al.ToArray(typeof(X509Certificate));
}
示例11: FromXml
/// <include file='doc\URLIdentityPermission.uex' path='docs/doc[@for="UrlIdentityPermission.FromXml"]/*' />
public override void FromXml(SecurityElement esd)
{
CodeAccessPermission.ValidateElement( esd, this );
String elem = esd.Attribute( "Url" );
m_url = elem == null ? null : new URLString( elem, true );
}
示例12: FromXml
/// <include file='doc\SiteIdentityPermission.uex' path='docs/doc[@for="SiteIdentityPermission.FromXml"]/*' />
public override void FromXml(SecurityElement esd)
{
CodeAccessPermission.ValidateElement( esd, this );
String elem = esd.Attribute( "Site" );
m_site = elem == null ? null : new SiteString( elem );
}