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

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

IsolatedStorageFilePermission.Intersect メソッド

現在のアクセス許可指定したアクセス許可積集合を表すアクセス許可作成して返します

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

Public Overrides Function
 Intersect ( _
    target As IPermission _
) As IPermission
Dim instance As IsolatedStorageFilePermission
Dim target As IPermission
Dim returnValue As IPermission

returnValue = instance.Intersect(target)
public override IPermission Intersect (
    IPermission target
)
public:
virtual IPermission^ Intersect (
    IPermission^ target
) override
public IPermission Intersect (
    IPermission target
)
public override function Intersect (
    target : IPermission
) : IPermission

パラメータ

target

現在のアクセス許可との積集合を持つアクセス許可オブジェクト。これは、現在のアクセス許可と同じ型であることが必要です。

戻り値
現在のアクセス許可指定したアクセス許可積集合を表す新しアクセス許可積集合が空の場合、この新しアクセス許可オブジェクトnull 参照 (Visual Basic では Nothing) です。

例外例外
例外種類条件

ArgumentException

target パラメータnull 参照 (Visual Basic では Nothing) ではなく現在のアクセス許可と同じ型でもありません。

解説解説
使用例使用例

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

Private Sub IntersectDemo()
    Console.WriteLine(ControlChars.Lf + "Intersect demo.")
    Dim isfp0 As New IsolatedStorageFilePermission(PermissionState.Unrestricted)
    Dim isfp1 As New IsolatedStorageFilePermission(PermissionState.Unrestricted)
    Dim isfp2 As New IsolatedStorageFilePermission(PermissionState.None)
    Dim isfp3 As New IsolatedStorageFilePermission(PermissionState.None)

    Dim t As IsolatedStorageFilePermission
 = CType(isfp0.Intersect(isfp1), IsolatedStorageFilePermission)
    If True = t.IsUnrestricted() Then
        Console.WriteLine("The intersection of two PermissionState.Unrestricted
 permissions is unrestricted.")
    Else
        Console.WriteLine(("Intersect demo failed because the
 intersection of two unrestricted permissions " + ControlChars.Lf +
 ControlChars.Tab + "should be unrestricted."))
    End If

    t = CType(isfp0.Intersect(isfp2), IsolatedStorageFilePermission)
    If False = t.IsUnrestricted() Then
        Console.WriteLine(("The intersection of a PermissionState.Unrestricted
 and " + ControlChars.Lf + ControlChars.Tab + "PermissionState.None
 permission is not unrestricted."))
    Else
        Console.WriteLine(("Intersect demo failed because the
 intersection of a unrestricted and " + ControlChars.Lf + ControlChars.Tab
 + "none permission should be none."))
    End If


    ' The permission set that comes back from this intersection is null.
    t = CType(isfp2.Intersect(isfp3), IsolatedStorageFilePermission)
    If Nothing Is t Then
        Console.WriteLine("The intersection of two PermissionState.None
 permissions is null.")
    Else
        Console.WriteLine(("Intersect failed because the intersection
 of two PermissionState.None permissions " + ControlChars.Lf + ControlChars.Tab
 + "should be null."))
    End If
End Sub 'IntersectDemo
private void IntersectDemo()
{
    Console.WriteLine("\nIntersect demo.");
    IsolatedStorageFilePermission isfp0 = new IsolatedStorageFilePermission(PermissionState.Unrestricted);
    IsolatedStorageFilePermission isfp1 = new IsolatedStorageFilePermission(PermissionState.Unrestricted);
    IsolatedStorageFilePermission isfp2 = new IsolatedStorageFilePermission(PermissionState.None);
    IsolatedStorageFilePermission isfp3 = new IsolatedStorageFilePermission(PermissionState.None);

    IsolatedStorageFilePermission t = (IsolatedStorageFilePermission)isfp0.Intersect(isfp1);
    if (true == t.IsUnrestricted())
    {
        Console.WriteLine
            ("The intersection of two PermissionState.Unrestricted permissions
 is unrestricted.");
    }
    else
    {
        Console.WriteLine
            ("Intersect demo failed because the intersection of two unrestricted
 permissions " +
            "\n\tshould be unrestricted.");
    }

    t = (IsolatedStorageFilePermission)isfp0.Intersect(isfp2);
    if (false == t.IsUnrestricted())
    {
        Console.WriteLine
            ("The intersection of a PermissionState.Unrestricted and "
 +
            "\n\tPermissionState.None permission is not unrestricted.");
    }
    else
    {
        Console.WriteLine
            ("Intersect demo failed because the intersection of a unrestricted
 and " +
            "\n\tnone permission should be none.");
    }


    // The permission set that comes back from this intersection is
 null.
    t = (IsolatedStorageFilePermission)isfp2.Intersect(isfp3);
    if (null == t)
    {
        Console.WriteLine
            ("The intersection of two PermissionState.None permissions is null.");
    }
    else
    {
        Console.WriteLine
            ("Intersect failed because the intersection of two PermissionState.None
 permissions " +
            "\n\tshould be null.");
    }

}
void IntersectDemo()
{
   Console::WriteLine( "\nIntersect demo." );
   IsolatedStorageFilePermission^ isfp0 = gcnew IsolatedStorageFilePermission( PermissionState::Unrestricted
 );
   IsolatedStorageFilePermission^ isfp1 = gcnew IsolatedStorageFilePermission( PermissionState::Unrestricted
 );
   IsolatedStorageFilePermission^ isfp2 = gcnew IsolatedStorageFilePermission( PermissionState::None
 );
   IsolatedStorageFilePermission^ isfp3 = gcnew IsolatedStorageFilePermission( PermissionState::None
 );
   IsolatedStorageFilePermission^ t = dynamic_cast<IsolatedStorageFilePermission^>(isfp0->Intersect(
 isfp1 ));
   if ( true == t->IsUnrestricted() )
   {
      Console::WriteLine( "The intersection of two PermissionState.Unrestricted
 permissions is unrestricted." );
   }
   else
   {
      Console::WriteLine( "Intersect demo failed because the intersection of
 two unrestricted permissions "
      "\n\tshould be unrestricted." );
   }

   t = dynamic_cast<IsolatedStorageFilePermission^>(isfp0->Intersect( isfp2
 ));
   if ( false == t->IsUnrestricted() )
   {
      Console::WriteLine( "The intersection of a PermissionState.Unrestricted
 and "
      "\n\tPermissionState.None permission is not unrestricted." );
   }
   else
   {
      Console::WriteLine( "Intersect demo failed because the intersection of
 a unrestricted and "
      "\n\tnone permission should be none." );
   }

   
   // The permission set that comes back from this intersection is null.
   t = dynamic_cast<IsolatedStorageFilePermission^>(isfp2->Intersect( isfp3
 ));
   if ( nullptr == t )
   {
      Console::WriteLine( "The intersection of two PermissionState.None permissions
 is null." );
   }
   else
   {
      Console::WriteLine( "Intersect failed because the intersection of two
 PermissionState.None permissions "
      "\n\tshould be null." );
   }
}


private void IntersectDemo()
{
    Console.WriteLine("\nIntersect demo.");
    IsolatedStorageFilePermission isfp0 = 
        new IsolatedStorageFilePermission(PermissionState.Unrestricted);
    IsolatedStorageFilePermission isfp1 = 
        new IsolatedStorageFilePermission(PermissionState.Unrestricted);
    IsolatedStorageFilePermission isfp2 = 
        new IsolatedStorageFilePermission(PermissionState.None);
    IsolatedStorageFilePermission isfp3 = 
        new IsolatedStorageFilePermission(PermissionState.None);
    IsolatedStorageFilePermission t = 
        ((IsolatedStorageFilePermission)(isfp0.Intersect(isfp1)));
    if (true == t.IsUnrestricted()) {
        Console.WriteLine("The intersection of two " 
            + "PermissionState.Unrestricted permissions is unrestricted.");
    }
    else {
        Console.WriteLine(("Intersect demo failed because the " 
            + "intersection of two unrestricted permissions " 
            + "\n\tshould be unrestricted."));
    }
    t = ((IsolatedStorageFilePermission)(isfp0.Intersect(isfp2)));
    if (false == t.IsUnrestricted()) {
        Console.WriteLine(("The intersection of a " 
            + "PermissionState.Unrestricted and " 
            + "\n\tPermissionState.None permission is not unrestricted."));
    }
    else {
        Console.WriteLine(("Intersect demo failed because the " 
            + "intersection of a unrestricted and " 
            + "\n\tnone permission should be none."));
    }

    // The permission set that comes back from this intersection is
 null.
    t = ((IsolatedStorageFilePermission)(isfp2.Intersect(isfp3)));
    if (null == t) {
        Console.WriteLine("The intersection of two " 
            + "PermissionState.None permissions is null.");
    }
    else {
        Console.WriteLine(("Intersect failed because the " 
            + "intersection of two PermissionState.None permissions " 
            + "\n\tshould be null."));
    }
} //IntersectDemo   
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
IsolatedStorageFilePermission クラス
IsolatedStorageFilePermission メンバ
System.Security.Permissions 名前空間


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS