Exemple #1
0
        public virtual bool OnNotify(NotifyMessageHeader hdr)
        {
            switch ((NotifyMessageCode)hdr.code)
            {
            case NotifyMessageCode.Apply:
                NativeWindowHelper.SetWindowLong(this.Handle, NativeWindowHelper.DWLP_MSGRESULT, NativeWindowHelper.PSNRET_NOERROR);
                OnApply();
                return(true);

            case NotifyMessageCode.Reset:
                OnCancel();
                return(false);

            case NotifyMessageCode.QueryCancel:
                return(false);

            case NotifyMessageCode.SetActive:
                OnSetActive();
                return(true);

            case NotifyMessageCode.KillActive:
                if (ValidateOptions())
                {
                    OnKillActive();
                    NativeWindowHelper.SetWindowLong(this.Handle, NativeWindowHelper.DWLP_MSGRESULT, 0);
                }
                else
                {
                    NativeWindowHelper.SetWindowLong(this.Handle, NativeWindowHelper.DWLP_MSGRESULT, 1);
                }
                return(true);
            }
            return(true);
        }
Exemple #2
0
        public void GetPropertyPage(ref Guid guidPage, Microsoft.VisualStudio.Shell.Interop.VSPROPSHEETPAGE[] ppage)
        {
            PropertySheet sheet = GetPropertySheet(guidPage);

            if (sheet != null && ppage != null)
            {
                ppage[0]            = new VSPROPSHEETPAGE();
                ppage[0].dwSize     = (uint)Marshal.SizeOf(typeof(VSPROPSHEETPAGE));
                ppage[0].hwndDlg    = sheet.Handle;
                ppage[0].pfnDlgProc = NativeWindowHelper.GetNativeWndProc(sheet);
                return;
            }
            throw new NotImplementedException();
        }