ISecurityEncodable.ToXml メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ISecurityEncodable.ToXml メソッドの意味・解説 

ISecurityEncodable.ToXml メソッド

セキュリティ オブジェクトとその現在の状態を表す XML エンコーディング作成します

名前空間: System.Security
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Function ToXml As SecurityElement
Dim instance As ISecurityEncodable
Dim returnValue As SecurityElement

returnValue = instance.ToXml
SecurityElement ToXml ()
SecurityElement^ ToXml ()
SecurityElement ToXml ()
function ToXml () : SecurityElement

戻り値
セキュリティ オブジェクトとそのすべての状態情報を含む 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;
    }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からISecurityEncodable.ToXml メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からISecurityEncodable.ToXml メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からISecurityEncodable.ToXml メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

ISecurityEncodable.ToXml メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ISecurityEncodable.ToXml メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS