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

Dim instance As IsolatedStorageFilePermission Dim target As IPermission Dim returnValue As IPermission returnValue = instance.Intersect(target)
戻り値
現在のアクセス許可と指定したアクセス許可の積集合を表す新しいアクセス許可。積集合が空の場合、この新しいアクセス許可オブジェクトは null 参照 (Visual Basic では Nothing) です。


2 つのアクセス許可の積集合となるアクセス許可には、両方に共通する操作の集合が記述されています。2 つのアクセス許可を要求し、その両方について要求が満たされる場合にだけ、それらの積集合を表すアクセス許可に対する要求も満たされます。

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

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に収録されているすべての辞書からIsolatedStorageFilePermission.Intersect メソッドを検索する場合は、下記のリンクをクリックしてください。

- IsolatedStorageFilePermission.Intersect メソッドのページへのリンク