コード例 #1
0
        /// <summary>
        /// This method checks to see if the error provider's tooltip window has
        /// changed and if it has updates this Native window with the new handle.
        ///
        /// If there is some sort of change it also calls the RefreshProviderErrors, which
        /// fixes the tooltip problem...
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void tmr_CheckHandels(object sender, EventArgs e)
        {
            if (mTheErrorProvider.ContainerControl == null)
            {
                return;
            }

            if (mTheErrorProvider.ContainerControl.Visible)
            {
                Hashtable hashRes = (Hashtable)GetFieldValue(mTheErrorProvider, "windows");
                if (hashRes.Count > 0)
                {
                    foreach (Object obj in hashRes.Keys)
                    {
                        ErrorProviderNativeWindowHook hook = null;
                        if (mHashOfNativeWindows.Contains(obj))
                        {
                            hook = (ErrorProviderNativeWindowHook)mHashOfNativeWindows[obj];
                        }
                        else
                        {
                            hook = new ErrorProviderNativeWindowHook();
                            mHashOfNativeWindows[obj] = hook;
                        }

                        NativeWindow nativeWindow = GetFieldValue(hashRes[obj], "tipWindow") as NativeWindow;
                        if (nativeWindow != null && hook.Handle == IntPtr.Zero)
                        {
                            hook.AssignHandle(nativeWindow.Handle);

                            if (mTheErrorProvider.AutoPopDelay != ErrorProviderFixed.DefaultAutoPopDelay)
                            {
                                SendMessage(nativeWindow.Handle, 0x403, (IntPtr)2, (IntPtr)mTheErrorProvider.AutoPopDelay);
                            }
                        }
                    }
                }

                foreach (ErrorProviderNativeWindowHook hook in mHashOfNativeWindows.Values)
                {
                    if (hook.mBlnTrigerRefresh)
                    {
                        hook.mBlnTrigerRefresh = false;
                        RefreshProviderErrors();
                    }
                }
            }
        }
コード例 #2
0
ファイル: ErrorProviderFixed.cs プロジェクト: xwiz/WixEdit
        /// <summary>
        /// This method checks to see if the error provider's tooltip window has
        /// changed and if it has updates this Native window with the new handle.
        /// 
        /// If there is some sort of change it also calls the RefreshProviderErrors, which
        /// fixes the tooltip problem...
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void tmr_CheckHandels(object sender, EventArgs e)
        {
            if (mTheErrorProvider.ContainerControl == null)
            {
                return;
            }

            if (mTheErrorProvider.ContainerControl.Visible)
            {
                Hashtable hashRes = (Hashtable)GetFieldValue(mTheErrorProvider, "windows");
                if (hashRes.Count > 0)
                {
                    foreach (Object obj in hashRes.Keys)
                    {
                        ErrorProviderNativeWindowHook hook = null;
                        if (mHashOfNativeWindows.Contains(obj))
                        {
                            hook = (ErrorProviderNativeWindowHook)mHashOfNativeWindows[obj];
                        }
                        else
                        {
                            hook = new ErrorProviderNativeWindowHook();
                            mHashOfNativeWindows[obj] = hook;
                        }

                        NativeWindow nativeWindow = GetFieldValue(hashRes[obj], "tipWindow") as NativeWindow;
                        if (nativeWindow != null && hook.Handle == IntPtr.Zero)
                        {
                            hook.AssignHandle(nativeWindow.Handle);

                            if (mTheErrorProvider.AutoPopDelay != ErrorProviderFixed.DefaultAutoPopDelay)
                            {
                                SendMessage(nativeWindow.Handle, 0x403, (IntPtr)2, (IntPtr)mTheErrorProvider.AutoPopDelay);
                            }
                        }
                    }
                }

                foreach (ErrorProviderNativeWindowHook hook in mHashOfNativeWindows.Values)
                {
                    if (hook.mBlnTrigerRefresh)
                    {
                        hook.mBlnTrigerRefresh = false;
                        RefreshProviderErrors();
                    }
                }
            }
        }