コード例 #1
0
        /// <summary>
        /// Initializes the activation context.
        /// </summary>
        public void Initialize()
        {
            if (disposed)
            {
                throw new ObjectDisposedException(this.ToString());
            }
            if (!Initialized)
            {
                activationContext                     = new NativeMethods.ACTCTX();
                activationContext.cbSize              = Marshal.SizeOf(typeof(NativeMethods.ACTCTX));
                activationContext.lpSource            = this.ManifestFileName;
                activationContext.lpAssemblyDirectory = GlobalPreferences.WebKitPath;

                contextHandle = NativeMethods.CreateActCtx(ref activationContext);
                int winError = Marshal.GetLastWin32Error();

                Initialized = (contextHandle != (IntPtr)NativeMethods.INVALID_HANDLE_VALUE);

                if (!Initialized)
                {
                    if (MessageBox.Show("The environment for using WebKit has not been initialized correctly. If you are a developer make sure you have followed the instructions of How-to-use.txt. Would you like to open that file?", "Error", MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
                    {
                        Form read = new Form();
                        read.Controls.Add(new FastColoredTextBoxNS.FastColoredTextBox()
                        {
                            Dock = DockStyle.Fill, Name = "ErrorText", Visible = true
                        });
                        read.Controls[0].Text = Properties.Resources.How_to_use;
                        read.Text             = "How to use.txt";
                        read.Show();
                    }
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// Initializes the activation context.
        /// </summary>
        public void Initialize()
        {
            if (disposed)
            {
                throw new ObjectDisposedException(this.ToString());
            }
            if (!Initialized)
            {
                activationContext          = new NativeMethods.ACTCTX();
                activationContext.cbSize   = Marshal.SizeOf(typeof(NativeMethods.ACTCTX));
                activationContext.lpSource = this.ManifestFileName;

                contextHandle = NativeMethods.CreateActCtx(ref activationContext);
                int winError = Marshal.GetLastWin32Error();

                Initialized = (contextHandle != (IntPtr)NativeMethods.INVALID_HANDLE_VALUE);

                if (!Initialized)
                {
                    throw new Win32Exception(winError, "Failed to initialize activation context");
                }
            }
        }
コード例 #3
0
        /// <summary>
        /// Initializes the activation context.
        /// </summary>
        public void Initialize()
        {
            if (disposed)
                throw new ObjectDisposedException(this.ToString());
            if (!Initialized)
            {
                activationContext = new NativeMethods.ACTCTX();
                activationContext.cbSize = Marshal.SizeOf(typeof(NativeMethods.ACTCTX));
                activationContext.lpSource = this.ManifestFileName;

                contextHandle = NativeMethods.CreateActCtx(ref activationContext);
                int winError = Marshal.GetLastWin32Error();

                Initialized = (contextHandle != (IntPtr) NativeMethods.INVALID_HANDLE_VALUE);

                if (!Initialized)
                    throw new Win32Exception(winError, "Failed to initialize activation context");
            }
        }
コード例 #4
0
ファイル: ActivationContext.cs プロジェクト: ndrake/blink1
        /// <summary>
        /// Initializes the activation context.
        /// </summary>
        public void Initialize()
        {
            if (disposed)
                throw new ObjectDisposedException(this.ToString());
            if (!Initialized)
            {
                activationContext = new NativeMethods.ACTCTX();
                activationContext.cbSize = Marshal.SizeOf(typeof(NativeMethods.ACTCTX));
                activationContext.lpSource = this.ManifestFileName;
                activationContext.lpAssemblyDirectory = GlobalPreferences.WebKitPath;

                contextHandle = NativeMethods.CreateActCtx(ref activationContext);
                int winError = Marshal.GetLastWin32Error();

                Initialized = (contextHandle != (IntPtr)NativeMethods.INVALID_HANDLE_VALUE);

                if (!Initialized)
                    if (MessageBox.Show("The environment for using WebKit has not been initialized correctly. If you are a developer make sure you have followed the instructions of How-to-use.txt. Would you like to open that file?", "Error", MessageBoxButtons.YesNoCancel) == DialogResult.Yes)
                    {
                        Form read = new Form();
                        read.Controls.Add(new FastColoredTextBoxNS.FastColoredTextBox() { Dock = DockStyle.Fill, Name = "ErrorText", Visible = true });
                        read.Controls[0].Text = Properties.Resources.How_to_use;
                        read.Text = "How to use.txt";
                        read.Show();
                    }
            }
        }