PolicyLevel.Label プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)



ポリシー レベル ラベルを使用してリストを書き込む例を次に示します。このコード例は、PolicyLevel クラスのトピックで取り上げているコード例の一部分です。
' Demonstrate the use of ResolvePolicy for passed in evidence. Private Overloads Shared Sub CheckEvidence(ByVal evidence As Evidence) ' Display the code groups to which the evidence belongs. Console.WriteLine("ResolvePolicy for the given evidence.") Console.WriteLine(ControlChars.Tab + "Current evidence belongs to the following code groups:") Dim policyEnumerator As IEnumerator = SecurityManager.PolicyHierarchy() ' Resolve the evidence at all the policy levels. While policyEnumerator.MoveNext() Dim currentLevel As PolicyLevel = CType(policyEnumerator.Current, PolicyLevel) Dim cg1 As CodeGroup = currentLevel.ResolveMatchingCodeGroups(evidence) Console.WriteLine((ControlChars.Lf + ControlChars.Tab + currentLevel.Label + " Level")) Console.WriteLine((ControlChars.Tab + ControlChars.Tab + "CodeGroup = " + cg1.Name)) Dim cgE1 As IEnumerator = cg1.Children.GetEnumerator() While cgE1.MoveNext() Console.WriteLine((ControlChars.Tab + ControlChars.Tab + ControlChars.Tab + "Group = " + CType(cgE1.Current, CodeGroup).Name)) End While Console.WriteLine((ControlChars.Tab + "StoreLocation = " + currentLevel.StoreLocation)) End While Return End Sub 'CheckEvidence
// Demonstrate the use of ResolvePolicy for passed in evidence. private static void CheckEvidence(Evidence evidence) { // Display the code groups to which the evidence belongs. Console.WriteLine("ResolvePolicy for the given evidence."); Console.WriteLine("\tCurrent evidence belongs to the following code groups:"); IEnumerator policyEnumerator = SecurityManager.PolicyHierarchy(); // Resolve the evidence at all the policy levels. while (policyEnumerator.MoveNext()) { PolicyLevel currentLevel = (PolicyLevel)policyEnumerator.Current; CodeGroup cg1 = currentLevel.ResolveMatchingCodeGroups(evidence); Console.WriteLine("\n\t" + currentLevel.Label + " Level"); Console.WriteLine("\t\tCodeGroup = " + cg1.Name); IEnumerator cgE1 = cg1.Children.GetEnumerator(); while (cgE1.MoveNext()) { Console.WriteLine("\t\t\tGroup = " + ((CodeGroup)cgE1.Current).Name); } Console.WriteLine("\tStoreLocation = " + currentLevel.StoreLocation); } return; }
// Demonstrate the use of ResolvePolicy for passed in evidence. void CheckEvidence( Evidence^ evidence ) { // Display the code groups to which the evidence belongs. Console::WriteLine( "ResolvePolicy for the given evidence." ); Console::WriteLine( "\tCurrent evidence belongs to the following code groups:" ); IEnumerator^ policyEnumerator = SecurityManager::PolicyHierarchy(); // Resolve the evidence at all the policy levels. while ( policyEnumerator->MoveNext() ) { PolicyLevel^ currentLevel = dynamic_cast<PolicyLevel^>(policyEnumerator->Current); CodeGroup^ cg1 = currentLevel->ResolveMatchingCodeGroups( evidence ); Console::WriteLine( "\n\t{0} Level", currentLevel->Label ); Console::WriteLine( "\t\tCodeGroup = {0}", cg1->Name ); IEnumerator^ cgE1 = cg1->Children->GetEnumerator(); while ( cgE1->MoveNext() ) { Console::WriteLine( "\t\t\tGroup = {0}", (dynamic_cast<CodeGroup^>(cgE1->Current))->Name ); } Console::WriteLine( "\tStoreLocation = {0}", currentLevel->StoreLocation ); } return; }
// StoreLocation PolicyLevel.Label // Demonstrate the use of ResolvePolicy for passed in evidence. private static void CheckEvidence(Evidence evidence) { // Display the code groups to which the evidence belongs. Console.WriteLine("ResolvePolicy for the given evidence."); Console.WriteLine("\tCurrent evidence belongs to the " + "following code groups:"); IEnumerator policyEnumerator = SecurityManager.PolicyHierarchy(); // Resolve the evidence at all the policy levels. while (policyEnumerator.MoveNext()) { PolicyLevel currentLevel = ((PolicyLevel) (policyEnumerator.get_Current())); CodeGroup cg1 = currentLevel.ResolveMatchingCodeGroups(evidence); Console.WriteLine(("\n\t" + currentLevel.get_Label() + " Level")); Console.WriteLine(("\t\tCodeGroup = " + cg1.get_Name())); IEnumerator cgE1 = cg1.get_Children().GetEnumerator(); while (cgE1.MoveNext()) { Console.WriteLine(("\t\t\tGroup = " + ((CodeGroup) (cgE1.get_Current())).get_Name())); } Console.WriteLine(("\tStoreLocation = " + currentLevel.get_StoreLocation())); } return; } //CheckEvidence

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に収録されているすべての辞書からPolicyLevel.Label プロパティを検索する場合は、下記のリンクをクリックしてください。

- PolicyLevel.Label プロパティのページへのリンク