ISecurityEncodable.ToXml メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Function ToXml As SecurityElement
Dim instance As ISecurityEncodable Dim returnValue As SecurityElement returnValue = instance.ToXml
セキュリティ オブジェクトとそのすべての状態情報を含む XML エンコーディング。


FromXml メソッドを実装する方法を次のコード例に示します。このコード例は、ISecurityEncodable クラスのトピックで取り上げているコード例の一部分です。
// Produce XML from the permission's fields. public override SecurityElement ToXml() { // These first three lines create an element with the required format. SecurityElement e = new SecurityElement("IPermission"); // Replace the double quotation marks () with single quotation marks () // to remain XML compliant when the culture is not neutral. e.AddAttribute("class", GetType().AssemblyQualifiedName.Replace('\"', '\'')); e.AddAttribute("version", "1"); if (!m_specifiedAsUnrestricted) e.AddAttribute("Flags", Enum.Format(typeof(SoundPermission), m_flags, "G")); else e.AddAttribute("Unrestricted", "true"); return e; }
// Produce XML from the permission's fields. public: virtual SecurityElement^ ToXml() override { // These first three lines create an element with the required format. SecurityElement^ element = gcnew SecurityElement("IPermission"); // Replace the double quotation marks () // with single quotation marks () // to remain XML compliant when the culture is not neutral. element->AddAttribute("class", GetType()->AssemblyQualifiedName->Replace('\"', '\'')); element->AddAttribute("version", "1"); if (!specifiedAsUnrestricted) { element->AddAttribute("Flags", Enum::Format(SoundPermissionState::typeid, stateFlags, "G")); } else { element->AddAttribute("Unrestricted", "true"); } return element; }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からISecurityEncodable.ToXml メソッドを検索する場合は、下記のリンクをクリックしてください。

- ISecurityEncodable.ToXml メソッドのページへのリンク