GacMembershipCondition.Copy Метод
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Создает эквивалентную копию условия членства.
public:
virtual System::Security::Policy::IMembershipCondition ^ Copy();
public System.Security.Policy.IMembershipCondition Copy ();
abstract member Copy : unit -> System.Security.Policy.IMembershipCondition
override this.Copy : unit -> System.Security.Policy.IMembershipCondition
Public Function Copy () As IMembershipCondition
Новый объект GacMembershipCondition.
В следующем примере кода показано использование Copy метода . Этот пример является частью более крупного примера, предоставленного GacMembershipCondition для класса .
GacMembershipCondition ^ Gac1 = gcnew GacMembershipCondition;
Console::WriteLine("Original membership condition = ");
Console::WriteLine(Gac1->ToXml());
try
{
IMembershipCondition^ membershipCondition = Gac1->Copy();
Console::WriteLine("Result of Copy = ");
Console::WriteLine(
(dynamic_cast<GacMembershipCondition^>(membershipCondition))
->ToXml());
}
catch (Exception^ e)
{
Console::WriteLine("Copy failed : {0}{1}", Gac1, e);
return false;
}
GacMembershipCondition Gac1 = new GacMembershipCondition();
Console.WriteLine("Original membership condition = ");
Console.WriteLine(Gac1.ToXml().ToString());
try
{
IMembershipCondition membershipCondition = Gac1.Copy();
Console.WriteLine("Result of Copy = ");
Console.WriteLine(
((GacMembershipCondition)membershipCondition).ToXml().ToString()
);
}
catch (Exception e)
{
Console.WriteLine("Copy failed : " + Gac1.ToString() + e);
return false;
}
Dim Gac1 As New GacMembershipCondition
Console.WriteLine("Original membership condition = ")
Console.WriteLine(Gac1.ToXml().ToString())
Try
Dim membershipCondition As IMembershipCondition = Gac1.Copy()
Console.WriteLine("Result of Copy = ")
Console.WriteLine(CType(membershipCondition, _
GacMembershipCondition).ToXml().ToString())
Catch e As Exception
Console.WriteLine(("Copy failed : " & Gac1.ToString() & _
e.ToString()))
Return False
End Try
Копия условия членства идентична исходному условию членства.
Өнім | Нұсқалар |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET кері байланысы
.NET — бастапқы коды ашық жоба. Пікір қалдыру үшін сілтемені таңдаңыз: