Ejemplo n.º 1
0
        private IsolatedStorageFilePermission Cast(IPermission target)
        {
            if (target == null)
            {
                return(null);
            }
            IsolatedStorageFilePermission isolatedStorageFilePermission = target as IsolatedStorageFilePermission;

            if (isolatedStorageFilePermission == null)
            {
                CodeAccessPermission.ThrowInvalidPermission(target, typeof(IsolatedStorageFilePermission));
            }
            return(isolatedStorageFilePermission);
        }
Ejemplo n.º 2
0
        private HostProtectionPermission Cast(IPermission target)
        {
            if (target == null)
            {
                return(null);
            }
            HostProtectionPermission hostProtectionPermission = target as HostProtectionPermission;

            if (hostProtectionPermission == null)
            {
                CodeAccessPermission.ThrowInvalidPermission(target, typeof(HostProtectionPermission));
            }
            return(hostProtectionPermission);
        }
Ejemplo n.º 3
0
        private SecurityPermission Cast(IPermission target)
        {
            if (target == null)
            {
                return(null);
            }
            SecurityPermission securityPermission = target as SecurityPermission;

            if (securityPermission == null)
            {
                CodeAccessPermission.ThrowInvalidPermission(target, typeof(SecurityPermission));
            }
            return(securityPermission);
        }
        private StrongNameIdentityPermission Cast(IPermission target)
        {
            if (target == null)
            {
                return(null);
            }
            StrongNameIdentityPermission strongNameIdentityPermission = target as StrongNameIdentityPermission;

            if (strongNameIdentityPermission == null)
            {
                CodeAccessPermission.ThrowInvalidPermission(target, typeof(StrongNameIdentityPermission));
            }
            return(strongNameIdentityPermission);
        }
Ejemplo n.º 5
0
        private ZoneIdentityPermission Cast(IPermission target)
        {
            if (target == null)
            {
                return(null);
            }
            ZoneIdentityPermission zoneIdentityPermission = target as ZoneIdentityPermission;

            if (zoneIdentityPermission == null)
            {
                CodeAccessPermission.ThrowInvalidPermission(target, typeof(ZoneIdentityPermission));
            }
            return(zoneIdentityPermission);
        }
        private RegistryPermission Cast(IPermission target)
        {
            if (target == null)
            {
                return(null);
            }
            RegistryPermission registryPermission = target as RegistryPermission;

            if (registryPermission == null)
            {
                CodeAccessPermission.ThrowInvalidPermission(target, typeof(RegistryPermission));
            }
            return(registryPermission);
        }
Ejemplo n.º 7
0
        private UIPermission Cast(IPermission target)
        {
            if (target == null)
            {
                return(null);
            }
            UIPermission uipermission = target as UIPermission;

            if (uipermission == null)
            {
                CodeAccessPermission.ThrowInvalidPermission(target, typeof(UIPermission));
            }
            return(uipermission);
        }
Ejemplo n.º 8
0
        private PublisherIdentityPermission Cast(IPermission target)
        {
            if (target == null)
            {
                return(null);
            }
            PublisherIdentityPermission publisherIdentityPermission = target as PublisherIdentityPermission;

            if (publisherIdentityPermission == null)
            {
                CodeAccessPermission.ThrowInvalidPermission(target, typeof(PublisherIdentityPermission));
            }
            return(publisherIdentityPermission);
        }
Ejemplo n.º 9
0
        private EnvironmentPermission Cast(IPermission target)
        {
            if (target == null)
            {
                return(null);
            }
            EnvironmentPermission environmentPermission = target as EnvironmentPermission;

            if (environmentPermission == null)
            {
                CodeAccessPermission.ThrowInvalidPermission(target, typeof(EnvironmentPermission));
            }
            return(environmentPermission);
        }
        private KeyContainerPermission Cast(IPermission target)
        {
            if (target == null)
            {
                return(null);
            }
            KeyContainerPermission keyContainerPermission = target as KeyContainerPermission;

            if (keyContainerPermission == null)
            {
                CodeAccessPermission.ThrowInvalidPermission(target, typeof(KeyContainerPermission));
            }
            return(keyContainerPermission);
        }
Ejemplo n.º 11
0
        private GacIdentityPermission Cast(IPermission target)
        {
            if (target == null)
            {
                return(null);
            }
            GacIdentityPermission gacIdentityPermission = target as GacIdentityPermission;

            if (gacIdentityPermission == null)
            {
                CodeAccessPermission.ThrowInvalidPermission(target, typeof(GacIdentityPermission));
            }
            return(gacIdentityPermission);
        }
Ejemplo n.º 12
0
        private PrincipalPermission Cast(IPermission target)
        {
            if (target == null)
            {
                return(null);
            }
            PrincipalPermission principalPermission = target as PrincipalPermission;

            if (principalPermission == null)
            {
                CodeAccessPermission.ThrowInvalidPermission(target, typeof(PrincipalPermission));
            }
            return(principalPermission);
        }
Ejemplo n.º 13
0
        private static FileIOPermission Cast(IPermission target)
        {
            if (target == null)
            {
                return(null);
            }
            FileIOPermission fileIOPermission = target as FileIOPermission;

            if (fileIOPermission == null)
            {
                CodeAccessPermission.ThrowInvalidPermission(target, typeof(FileIOPermission));
            }
            return(fileIOPermission);
        }