本文整理汇总了C#中System.Security.SecurityElement.AddAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# SecurityElement.AddAttribute方法的具体用法?C# SecurityElement.AddAttribute怎么用?C# SecurityElement.AddAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Security.SecurityElement
的用法示例。
在下文中一共展示了SecurityElement.AddAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Element
// snippet moved from FileIOPermission (nickd) to be reused in all derived classes
internal static SecurityElement Element (Type type, int version)
{
SecurityElement se = new SecurityElement ("IPermission");
se.AddAttribute ("class", type.FullName + ", " + type.Assembly.ToString ().Replace ('\"', '\''));
se.AddAttribute ("version", version.ToString ());
return se;
}
示例2: ToXml
public SecurityElement ToXml ()
{
SecurityElement se = new SecurityElement (tag);
se.AddAttribute ("class", typeof (MonoTrustManager).AssemblyQualifiedName);
se.AddAttribute ("version", "1");
return se;
}
示例3: CreateDefaultApplicationTrustManagerElement
private static SecurityElement CreateDefaultApplicationTrustManagerElement()
{
SecurityElement element = new SecurityElement("IApplicationTrustManager");
element.AddAttribute("class", "System.Security.Policy.TrustManager, System.Windows.Forms, Version=" + ((RuntimeAssembly) Assembly.GetExecutingAssembly()).GetVersion() + ", Culture=neutral, PublicKeyToken=b77a5c561934e089");
element.AddAttribute("version", "1");
return element;
}
示例4: ToXml
public override SecurityElement ToXml()
{
SecurityElement esd = new SecurityElement("IPermission");
String name = typeof(VirtuosoCodeAccessPermission).AssemblyQualifiedName;
esd.AddAttribute("class", name);
esd.AddAttribute("version", "1.0");
return esd;
}
示例5: ToXml
// Convert this permissions object into an XML value.
public override SecurityElement ToXml()
{
SecurityElement element;
element = new SecurityElement("IPermission");
element.AddAttribute
("class",
SecurityElement.Escape(typeof(ZoneIdentityPermission).
AssemblyQualifiedName));
element.AddAttribute("version", "1");
element.AddAttribute("Zone", zone.ToString());
return element;
}
示例6: Create
// can be used to create an empty or an unrestricted permission from any valid type
static public IPermission Create (string fullname, PermissionState state)
{
if (fullname == null)
throw new ArgumentNullException ("fullname");
SecurityElement se = new SecurityElement ("IPermission");
se.AddAttribute ("class", fullname);
se.AddAttribute ("version", "1");
if (state == PermissionState.Unrestricted)
se.AddAttribute ("Unrestricted", "true");
return CreatePermission (fullname, se);
}
示例7: ToXml
// Convert this permissions object into an XML value.
public override SecurityElement ToXml()
{
SecurityElement element;
element = new SecurityElement("IPermission");
element.AddAttribute
("class",
SecurityElement.Escape(typeof(UrlIdentityPermission).
AssemblyQualifiedName));
element.AddAttribute("version", "1");
if(url != null)
{
element.AddAttribute
("Url", SecurityElement.Escape(url));
}
return element;
}
示例8: ToXml
internal SecurityElement ToXml()
{
SecurityElement element2;
SecurityElement element = new SecurityElement("System.Security.Policy.PermissionRequestEvidence");
element.AddAttribute("version", "1");
if (this.m_request != null)
{
element2 = new SecurityElement("Request");
element2.AddChild(this.m_request.ToXml());
element.AddChild(element2);
}
if (this.m_optional != null)
{
element2 = new SecurityElement("Optional");
element2.AddChild(this.m_optional.ToXml());
element.AddChild(element2);
}
if (this.m_denied != null)
{
element2 = new SecurityElement("Denied");
element2.AddChild(this.m_denied.ToXml());
element.AddChild(element2);
}
return element;
}
示例9: ToXml
public SecurityElement ToXml(PolicyLevel level)
{
SecurityElement element = new SecurityElement("IMembershipCondition");
XMLUtil.AddClassAttribute(element, base.GetType(), "System.Security.Policy.AllMembershipCondition");
element.AddAttribute("version", "1");
return element;
}
示例10: CreatePermissionElement
internal static SecurityElement CreatePermissionElement(IPermission perm, string permname)
{
SecurityElement element = new SecurityElement("IPermission");
XMLUtil.AddClassAttribute(element, perm.GetType(), permname);
element.AddAttribute("version", "1");
return element;
}
示例11: ToXml
private SecurityElement ToXml()
{
SecurityElement root = new SecurityElement("System.Xml.XmlSecureResolver");
root.AddAttribute("version", "1");
root.AddChild(new SecurityElement("UncDirectory", _uncDir));
return root;
}
示例12: ToXml
internal SecurityElement ToXml()
{
SecurityElement element = new SecurityElement("Identity");
if (this.m_authenticated)
{
element.AddAttribute("Authenticated", "true");
}
if (this.m_id != null)
{
element.AddAttribute("ID", SecurityElement.Escape(this.m_id));
}
if (this.m_role != null)
{
element.AddAttribute("Role", SecurityElement.Escape(this.m_role));
}
return element;
}
示例13: ToXml
// Convert this principal information block into an XML blob.
public SecurityElement ToXml()
{
SecurityElement elem = new SecurityElement("identity");
if(name != null)
{
elem.AddAttribute
("ID", SecurityElement.Escape(name));
}
if(role != null)
{
elem.AddAttribute
("Role", SecurityElement.Escape(role));
}
elem.AddAttribute
("Authenticated", isAuthenticated.ToString());
return elem;
}
示例14: AddClassAttribute
public static void AddClassAttribute(SecurityElement element, Type type, string typename)
{
if (typename == null)
{
typename = type.FullName;
}
element.AddAttribute("class", typename + ", " + type.Module.Assembly.FullName.Replace('"', '\''));
}
示例15: ToXml
/// <include file='doc\AllMembershipCondition.uex' path='docs/doc[@for="AllMembershipCondition.ToXml1"]/*' />
public SecurityElement ToXml( PolicyLevel level )
{
SecurityElement root = new SecurityElement( "IMembershipCondition" );
System.Security.Util.XMLUtil.AddClassAttribute( root, this.GetType() );
root.AddAttribute( "version", "1" );
return root;
}