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


C# SecurityElement.ToString方法代码示例

本文整理汇总了C#中SecurityElement.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# SecurityElement.ToString方法的具体用法?C# SecurityElement.ToString怎么用?C# SecurityElement.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SecurityElement的用法示例。


在下文中一共展示了SecurityElement.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ToString

		public override string ToString ()
		{
			// MS "by design" behaviour (see FDBK14362)
			ThrowOnInvalid (Directory);
			SecurityElement element = new SecurityElement ("System.Security.Policy.ApplicationDirectory");
			element.AddAttribute ("version", "1");
			element.AddChild (new SecurityElement ("Directory", directory));
			return element.ToString ();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:9,代码来源:ApplicationDirectory.cs

示例2: ToString

		public override string ToString () 
		{
			SecurityElement se = new SecurityElement ("System.Security.Policy.PermissionRequestEvidence");
			se.AddAttribute ("version", "1");

			if (requested != null) {
				SecurityElement requestElement = new SecurityElement ("Request");
				requestElement.AddChild (requested.ToXml ());
				se.AddChild (requestElement);
			}
			if (optional != null) {
				SecurityElement optionalElement = new SecurityElement ("Optional");
				optionalElement.AddChild (optional.ToXml ());
				se.AddChild (optionalElement);
			}
			if (denied != null) {
				SecurityElement deniedElement = new SecurityElement ("Denied");
				deniedElement.AddChild (denied.ToXml ());
				se.AddChild (deniedElement);
			}
			return se.ToString ();
		}
开发者ID:runefs,项目名称:Marvin,代码行数:22,代码来源:PermissionRequestEvidence.cs

示例3: ToString

	// Convert this object into a string.
	public override String ToString()
			{
				SecurityElement element;
				element = new SecurityElement("System.Security.Policy.Hash");
				element.AddAttribute("version", "1");
				byte[] rawData = RawData;
				if(rawData != null && rawData.Length != 0)
				{
					element.AddChild(new SecurityElement
						("RawData", StrongNamePublicKeyBlob.ToHex(rawData)));
				}
				return element.ToString();
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:14,代码来源:Hash.cs

示例4: ToString

	public override string ToString () 
	{
		SecurityElement se = new SecurityElement (GetType ().FullName);
		se.AddAttribute ("version", "1");
		
		StringBuilder sb = new StringBuilder ();
		byte[] raw = GetData ();
		for (int i=0; i < raw.Length; i++)
			sb.Append (raw [i].ToString ("X2"));

		se.AddChild (new SecurityElement ("RawData", sb.ToString ()));
		return se.ToString ();
	}
开发者ID:runefs,项目名称:Marvin,代码行数:13,代码来源:Hash.cs

示例5: ToString

	public override string ToString () 
	{
		SecurityElement element = new SecurityElement (typeof (System.Security.Policy.StrongName).Name);
		element.AddAttribute ("version", "1");
		element.AddAttribute ("Key", publickey.ToString ());
		element.AddAttribute ("Name", name);
		element.AddAttribute ("Version", version.ToString ());
		return element.ToString ();
	}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:9,代码来源:StrongName.cs

示例6: ToString

		public override string ToString ()
		{
			SecurityElement se = new SecurityElement (GetType ().FullName);
			se.AddAttribute ("version", "1");
			return se.ToString ();
		}
开发者ID:Profit0004,项目名称:mono,代码行数:6,代码来源:Gac.cs

示例7: SaveRecord

	private Boolean SaveRecord()
	{
		SecurityElement xmlRoot = new SecurityElement("expansion_pack_record");

		lock (m_lock)
		{
			foreach (var item in m_packRecordMap)
			{
				String packId = item.Key;
				ExpansionPackRecord record = item.Value;

				SecurityElement xmlItem = new SecurityElement("item");
				xmlRoot.AddChild(xmlItem);

				xmlItem.AddAttribute("id", packId);
				xmlItem.AddAttribute("state", ((Int32)record.state).ToString());
			}
		}

		try
		{
			CreateDirectoryForFile(GetRecordFilePath());
			File.WriteAllText(GetRecordFilePath(), xmlRoot.ToString());
			return true;
		}
		catch (IOException e)
		{
			Debug.LogException(e);
			return false;
		}
	}
开发者ID:fengqk,项目名称:Art,代码行数:31,代码来源:ExpansionPackManager.cs

示例8: ToString

	// Convert this object into a string.
	public override String ToString()
			{
				SecurityElement element = new SecurityElement
					("System.Security.Policy.Url");
				SecurityElement child;
				element.AddAttribute("version", "1");
				child = new SecurityElement
					("Url", SecurityElement.Escape(parser.URL));
				element.AddChild(child);
				return element.ToString();
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:12,代码来源:Url.cs

示例9: MultipleAttributes

        public void MultipleAttributes()
        {
            SecurityElement se = new SecurityElement("Multiple");
            se.AddAttribute("Attribute1", "One");
            se.AddAttribute("Attribute2", "Two");

            string expected = string.Format("<Multiple Attribute1=\"One\"{0}Attribute2=\"Two\"/>{0}", Environment.NewLine);
            Assert.Equal(expected, se.ToString());
        }
开发者ID:dotnet,项目名称:corefx,代码行数:9,代码来源:SecurityElementTests.cs

示例10: Tag

 public void Tag()
 {
     SecurityElement se = new SecurityElement("Values");
     Assert.Equal("Values", se.Tag);
     Assert.Equal(string.Format(CultureInfo.InvariantCulture,
         "<Values/>{0}", Environment.NewLine),
         se.ToString());
     se.Tag = "abc:Name";
     Assert.Equal("abc:Name", se.Tag);
     Assert.Equal(string.Format(CultureInfo.InvariantCulture,
         "<abc:Name/>{0}", Environment.NewLine),
         se.ToString());
     se.Tag = "Name&Address";
     Assert.Equal("Name&Address", se.Tag);
     Assert.Equal(string.Format(CultureInfo.InvariantCulture,
         "<Name&Address/>{0}", Environment.NewLine),
         se.ToString());
     se.Tag = string.Empty;
     Assert.Equal(string.Empty, se.Tag);
     Assert.Equal(string.Format(CultureInfo.InvariantCulture,
         "</>{0}", Environment.NewLine),
         se.ToString());
 }
开发者ID:dotnet,项目名称:corefx,代码行数:23,代码来源:SecurityElementTests.cs

示例11: ToString

	// Convert this object into a string.
	public override String ToString()
			{
				SecurityElement element = new SecurityElement
					("System.Security.Policy.PermissionRequestEvidence");
				SecurityElement child;
				element.AddAttribute("version", "1");
				if(request != null)
				{
					child = new SecurityElement("Request");
					child.AddChild(request.ToXml());
					element.AddChild(child);
				}
				if(optional != null)
				{
					child = new SecurityElement("Optional");
					child.AddChild(optional.ToXml());
					element.AddChild(child);
				}
				if(denied != null)
				{
					child = new SecurityElement("Denied");
					child.AddChild(denied.ToXml());
					element.AddChild(child);
				}
				return element.ToString();
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:27,代码来源:PermissionRequestEvidence.cs

示例12: ToString

	// Convert this object into a string.
	public override String ToString()
			{
				SecurityElement element = new SecurityElement
					("System.Security.Policy.Site");
				SecurityElement child;
				element.AddAttribute("version", "1");
				child = new SecurityElement
					("Name", SecurityElement.Escape(name));
				element.AddChild(child);
				return element.ToString();
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:12,代码来源:Site.cs

示例13: ToString

	// Convert this object into a string.
	public override String ToString()
			{
				SecurityElement element = new SecurityElement("StrongName");
				element.AddAttribute("version", "1");
				element.AddAttribute("Key", blob.ToString());
				element.AddAttribute
					("Name", SecurityElement.Escape(name));
				element.AddAttribute("Version", version.ToString());
				return element.ToString();
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:11,代码来源:StrongName.cs

示例14: ToString

		public override string ToString ()
		{
			SecurityElement se = new SecurityElement ("System.Security.Policy.Zone");
			se.AddAttribute ("version", "1");
			se.AddChild (new SecurityElement ("Zone", zone.ToString ()));
			return se.ToString ();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:7,代码来源:Zone.cs

示例15: ToString

                public override string ToString ()
                {
			SecurityElement element = new SecurityElement ("System.Security.Policy.Site");
			element.AddAttribute ("version", "1");
			element.AddChild (new SecurityElement ("Name", origin_site));
			return element.ToString ();
                }
开发者ID:Profit0004,项目名称:mono,代码行数:7,代码来源:Site.cs


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