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

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

IsolatedStorageFilePermission.Copy メソッド

現在のアクセス許可コピー作成して返します

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

Public Overrides Function
 Copy As IPermission
Dim instance As IsolatedStorageFilePermission
Dim returnValue As IPermission

returnValue = instance.Copy
public override IPermission Copy ()
public IPermission Copy ()

戻り値
現在のアクセス許可コピー

解説解説
使用例使用例

Copy メソッド使用方法次のコード例示します。このコード例は、IsolatedStorageFilePermission クラストピック取り上げているコード例一部分です。

Private Sub Copy_EqualsDemo()
    Console.WriteLine(ControlChars.Lf + "Copy_Equals demo.")
    Console.WriteLine("Creating the first IsolatedStorageFilePermission(PermissionState.Unrestricted)
 permission.")
    Dim first As New IsolatedStorageFilePermission(PermissionState.Unrestricted)
    Console.WriteLine(("Hashcode for the first permission : "
 + first.GetHashCode().ToString()))
    Console.WriteLine("Copying the first permission.")
    Dim copyOfFirst As IsolatedStorageFilePermission
 = CType(first.Copy(), IsolatedStorageFilePermission)
    Console.WriteLine(("Hashcode for copy of the first permission:
 " + copyOfFirst.GetHashCode().ToString()))
    If False = copyOfFirst.Equals(first) Then
 ' This should be false, because the object references are different.
        Console.WriteLine(("The copy and the first permission
 should not be equal because they have " + ControlChars.Lf + ControlChars.Tab
 + "different object references."))
    Else
        Console.WriteLine(("Error: the copy and the first permission
 should not be equal because they have " + ControlChars.Lf + ControlChars.Tab
 + "different object references."))
    End If

    Console.WriteLine(("Does a comparison of copy of first permission
 to itself test equal??: " + IIf(copyOfFirst.Equals(copyOfFirst), "true",
 "false")))
    If False = copyOfFirst.Equals(copyOfFirst)
 Then
        Console.WriteLine("Copy_Equals demo failed because Equals
 returns false on two object.Equals(itself).")
    End If

    Console.WriteLine(("Does a comparison of first permission
 to itself test equal?: " + IIf(first.Equals(first), "true",
 "false")))
    If False = first.Equals(first) Then
        Console.WriteLine("Copy_Equals demo failed, because Equals
 returns false on two object.Equals(itself).")
    End If
    Console.WriteLine("Creating a second permission with PermissionState.None.")
    Dim second As New IsolatedStorageFilePermission(PermissionState.None)

    Console.WriteLine(("Does the first permission equal the second
 permission?: " + IIf(first.Equals(second), "true",
 "false")))
    If True = first.Equals(second) Then
        Console.WriteLine("Copy_Equals demo failed because Equals
 returns false on two object.Equals(itself).")
    End If
End Sub 'Copy_EqualsDemo
private void Copy_EqualsDemo()
{
    Console.WriteLine
        ("\nCopy_Equals demo.");
    Console.WriteLine
        ("Creating the first IsolatedStorageFilePermission(PermissionState.Unrestricted)
 permission.");
    IsolatedStorageFilePermission first = new IsolatedStorageFilePermission(PermissionState.Unrestricted);
    Console.WriteLine
        ("Hashcode for the first permission : " + first.GetHashCode().ToString());
    Console.WriteLine
        ("Copying the first permission.");
    IsolatedStorageFilePermission copyOfFirst = (IsolatedStorageFilePermission)first.Copy();
    Console.WriteLine
        ("Hashcode for copy of the first permission: "
 + copyOfFirst.GetHashCode().ToString());
    if (false == copyOfFirst.Equals(first))
 // This should be false, because the object references are different.
    {
        Console.WriteLine
            ("The copy and the first permission should not be equal because
 they have " +
            "\n\tdifferent object references.");
    }
    else
    {
        Console.WriteLine
            ("Error: the copy and the first permission should not be equal because
 they have " +
            "\n\tdifferent object references.");
    }

    Console.WriteLine
        ("Does a comparison of copy of first permission to itself test equal??:
 "
        + (copyOfFirst.Equals(copyOfFirst)? "true":
 "false"));
    if (false == copyOfFirst.Equals(copyOfFirst))
    {
        Console.WriteLine
            ("Copy_Equals demo failed because Equals returns false
 on two object.Equals(itself).");
    }

    Console.WriteLine
        ("Does a comparison of first permission to itself test equal?: "
 + (first.Equals(first)? "true": "false"));
    if (false == first.Equals(first))
    {
        Console.WriteLine
            ("Copy_Equals demo failed, because Equals returns false
 on two object.Equals(itself).");
    }
    Console.WriteLine("Creating a second permission with PermissionState.None.");
    IsolatedStorageFilePermission second = new IsolatedStorageFilePermission(PermissionState.None);

    Console.WriteLine
        ("Does the first permission equal the second permission?: " + (first.Equals(second)?
 "true": "false"));
    if (true == first.Equals(second))
    {
        Console.WriteLine
            ("Copy_Equals demo failed because Equals returns false
 on two object.Equals(itself).");
    }
}
void Copy_EqualsDemo()
{
   Console::WriteLine( "\nCopy_Equals demo." );
   Console::WriteLine( "Creating the first IsolatedStorageFilePermission(PermissionState.Unrestricted)
 permission." );
   IsolatedStorageFilePermission^ first = gcnew IsolatedStorageFilePermission( PermissionState::Unrestricted
 );
   Console::WriteLine( "Hashcode for the first permission
 : {0}", first->GetHashCode() );
   Console::WriteLine( "Copying the first permission." );
   IsolatedStorageFilePermission^ copyOfFirst = dynamic_cast<IsolatedStorageFilePermission^>(first->Copy());
   Console::WriteLine( "Hashcode for copy of the first permission:
 {0}", copyOfFirst->GetHashCode() );
   if ( false == copyOfFirst->Equals( first
 ) )
   {
      Console::WriteLine( "The copy and the first permission should not be equal
 because they have "
      "\n\tdifferent object references." );
   }
   else
   {
      Console::WriteLine( "Error: the copy and the first permission should not
 be equal because they have "
      "\n\tdifferent object references." );
   }

   Console::WriteLine( "Does a comparison of copy of first permission to itself
 test equal??: {0}", (copyOfFirst->Equals( copyOfFirst ) ? (String^)"true"
 : "false") );
   if ( false == copyOfFirst->Equals( copyOfFirst
 ) )
   {
      Console::WriteLine( "Copy_Equals demo failed because Equals returns false
 on two object.Equals(itself)." );
   }

   Console::WriteLine( "Does a comparison of first permission to itself test
 equal?: {0}", (first->Equals( first ) ? (String^)"true"
 : "false") );
   if ( false == first->Equals( first )
 )
   {
      Console::WriteLine( "Copy_Equals demo failed, because Equals returns false
 on two object.Equals(itself)." );
   }

   Console::WriteLine( "Creating a second permission with PermissionState.None."
 );
   IsolatedStorageFilePermission^ second = gcnew IsolatedStorageFilePermission( PermissionState::None
 );
   Console::WriteLine( "Does the first permission equal the second permission?:
 {0}", (first->Equals( second ) ? (String^)"true"
 : "false") );
   if ( true == first->Equals( second )
 )
   {
      Console::WriteLine( "Copy_Equals demo failed because Equals returns false
 on two object.Equals(itself)." );
   }
}


private void Copy_EqualsDemo()
{
    Console.WriteLine("\nCopy_Equals demo.");
    Console.WriteLine("Creating the first " 
        + "IsolatedStorageFilePermission(PermissionState." 
        + "Unrestricted) permission.");
    IsolatedStorageFilePermission first = 
        new IsolatedStorageFilePermission(PermissionState.Unrestricted);
    Console.WriteLine(("Hashcode for the first permission
 : " 
        + System.Convert.ToString(first.GetHashCode())));
    Console.WriteLine("Copying the first permission.");
    IsolatedStorageFilePermission copyOfFirst = 
        ((IsolatedStorageFilePermission)(first.Copy()));
    Console.WriteLine(("Hashcode for copy of the first permission:
 " 
        + System.Convert.ToString(copyOfFirst.GetHashCode())));
    if (false == copyOfFirst.Equals(first))
 {
        // This should be false, because the object references are 
        // different.
        Console.WriteLine(("The copy and the first permission " 
            + "should not be equal because they have " 
            + "\n\tdifferent object references."));
    }
    else {
        Console.WriteLine(("Error: the copy and the first " 
            + "permission should not be equal because they have " 
            + "\n\tdifferent object references."));
    }
    Console.WriteLine("Does a comparison of copy of first " 
        + "permission to itself test equal??: " 
        + ((copyOfFirst.Equals(copyOfFirst)) ? "true"
 : "false"));
    if (false == copyOfFirst.Equals(copyOfFirst))
 {
        Console.WriteLine("Copy_Equals demo failed because Equals " 
            + "returns false on two object.Equals(itself).");
    }
    Console.WriteLine(("Does a comparison of first permission to " 
        + "itself test equal?: " 
        + ((first.Equals(first)) ? "true" : "false")));
    if (false == first.Equals(first)) {
        Console.WriteLine("Copy_Equals demo failed, because Equals " 
            + "returns false on two object.Equals(itself).");
    }
    Console.WriteLine("Creating a second permission with " 
        + "PermissionState.None.");
    IsolatedStorageFilePermission second = 
        new IsolatedStorageFilePermission(PermissionState.None);
    Console.WriteLine(("Does the first permission equal the " 
        + "second permission?: " 
        + ((first.Equals(second)) ? "true" : "false")));
    if (true == first.Equals(second)) {
        Console.WriteLine("Copy_Equals demo failed because Equals " 
            + "returns false on two object.Equals(itself).");
    }
} //Copy_EqualsDemo   
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
IsolatedStorageFilePermission クラス
IsolatedStorageFilePermission メンバ
System.Security.Permissions 名前空間


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS