本文整理汇总了C#中System.Security.Permissions.EnvironmentPermission.Union方法的典型用法代码示例。如果您正苦于以下问题:C# EnvironmentPermission.Union方法的具体用法?C# EnvironmentPermission.Union怎么用?C# EnvironmentPermission.Union使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Security.Permissions.EnvironmentPermission
的用法示例。
在下文中一共展示了EnvironmentPermission.Union方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UnionWithBadPermission
public void UnionWithBadPermission ()
{
EnvironmentPermission ep1 = new EnvironmentPermission (EnvironmentPermissionAccess.Read, envVariables);
FileDialogPermission fdp2 = new FileDialogPermission (PermissionState.Unrestricted);
EnvironmentPermission ep3 = (EnvironmentPermission) ep1.Union (fdp2);
}
示例2: UnionWithUnrestricted
public void UnionWithUnrestricted ()
{
EnvironmentPermission ep1 = new EnvironmentPermission (PermissionState.Unrestricted);
EnvironmentPermission ep2 = new EnvironmentPermission (EnvironmentPermissionAccess.Read, envVariables);
EnvironmentPermission ep3 = (EnvironmentPermission) ep1.Union (ep2);
Assert ("Unrestricted U EP2 == Unrestricted", ep3.IsUnrestricted ());
ep3 = (EnvironmentPermission) ep2.Union (ep1);
Assert ("EP2 U Unrestricted == Unrestricted", ep3.IsUnrestricted ());
}
示例3: Union
public void Union ()
{
EnvironmentPermission ep1 = new EnvironmentPermission (EnvironmentPermissionAccess.Read, envVariables);
EnvironmentPermission ep2 = new EnvironmentPermission (EnvironmentPermissionAccess.Write, envVariables);
EnvironmentPermission ep3 = (EnvironmentPermission) ep1.Union (ep2);
EnvironmentPermission ep4 = new EnvironmentPermission (EnvironmentPermissionAccess.AllAccess, envVariables);
AssertEquals ("EP1 U EP2 == EP1+2", ep3.ToXml ().ToString (), ep4.ToXml ().ToString ());
}
示例4: UnionWithNull
public void UnionWithNull ()
{
EnvironmentPermission ep1 = new EnvironmentPermission (EnvironmentPermissionAccess.Read, envVariables);
EnvironmentPermission ep2 = null;
EnvironmentPermission ep3 = (EnvironmentPermission) ep1.Union (ep2);
AssertEquals ("EP1 U null == EP1", ep1.ToXml ().ToString (), ep3.ToXml ().ToString ());
}