Example #1
0
        public static void WebBrowserPermissionCallMethods()
        {
            WebBrowserPermission wp  = new WebBrowserPermission();
            WebBrowserPermission wp2 = new WebBrowserPermission(PermissionState.Unrestricted);
            WebBrowserPermission wp3 = new WebBrowserPermission(WebBrowserPermissionLevel.Unrestricted);
            bool        testbool     = wp.IsUnrestricted();
            IPermission ip           = wp.Copy();
            IPermission ip2          = wp.Intersect(ip);
            IPermission ip3          = wp.Union(ip);

            testbool = wp.IsSubsetOf(ip);
            SecurityElement se = new SecurityElement("");

            wp.FromXml(se);
            se = wp.ToXml();
        }
Example #2
0
        // Create Web browser permission via constructor.
        public void Stub04()
        {
            // <SnippetWebBrowserPermission1>
            WebBrowserPermission webBrowserPermission = new WebBrowserPermission(PermissionState.Unrestricted);
            // </SnippetWebBrowserPermission1>

            // <SnippetWebBrowserPermission5>
            bool isUnrestricted = webBrowserPermission.IsUnrestricted();

            // </SnippetWebBrowserPermission5>

            webBrowserPermission = new WebBrowserPermission(PermissionState.None);
            isUnrestricted       = webBrowserPermission.IsUnrestricted();

            // <SnippetWebBrowserPermission6>
            WebBrowserPermissionLevel webBrowserPermissionLevel = webBrowserPermission.Level;
            // </SnippetWebBrowserPermission6>
        }