当前位置: 首页>>代码示例>>C#>>正文


C# SecurityElement.AddAttribute方法代码示例

本文整理汇总了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;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:8,代码来源:PermissionHelper.cs

示例2: ToXml

		public SecurityElement ToXml ()
		{
			SecurityElement se = new SecurityElement (tag);
			se.AddAttribute ("class", typeof (MonoTrustManager).AssemblyQualifiedName);
			se.AddAttribute ("version", "1");
			return se;
		}
开发者ID:runefs,项目名称:Marvin,代码行数:7,代码来源:MonoTrustManager.cs

示例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;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:ApplicationSecurityManager.cs

示例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;
      }
开发者ID:jplu,项目名称:virtuoso-opensource,代码行数:9,代码来源:VirtuosoCodeAccessPermission.cs

示例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;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:13,代码来源:ZoneIdentityPermission.cs

示例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);
		}
开发者ID:jack-pappas,项目名称:mono,代码行数:14,代码来源:PermissionBuilder.cs

示例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;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:17,代码来源:UrlIdentityPermission.cs

示例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;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:PermissionRequestEvidence.cs

示例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;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:AllMembershipCondition.cs

示例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;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:CodeAccessPermission.cs

示例11: ToXml

 private SecurityElement ToXml()
 {
     SecurityElement root = new SecurityElement("System.Xml.XmlSecureResolver");
     root.AddAttribute("version", "1");
     root.AddChild(new SecurityElement("UncDirectory", _uncDir));
     return root;
 }
开发者ID:Corillian,项目名称:corefx,代码行数:7,代码来源:XmlSecureResolver.cs

示例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;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:17,代码来源:IDRole.cs

示例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;
				}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:18,代码来源:PrincipalPermission.cs

示例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('"', '\''));
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:XMLUtil.cs

示例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;
 }
开发者ID:ArildF,项目名称:masters,代码行数:9,代码来源:allmembershipcondition.cs


注:本文中的System.Security.SecurityElement.AddAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。