コード例 #1
0
 protected virtual void OnIsSelectedChanged(DependencyPropertyChangedEventArgs e)
 {
     if (_isSelectedReentrantFlag.CanEnter)
     {
         using (_isSelectedReentrantFlag.Enter())
         {
             if (LayoutElement != null)
             {
                 LayoutElement.IsSelected = (bool)e.NewValue;
             }
         }
     }
 }
コード例 #2
0
        protected override void OnVisibilityChanged()
        {
            if (_anchorable?.Root != null)
            {
                if (_visibilityReentrantFlag.CanEnter)
                {
                    using (_visibilityReentrantFlag.Enter())
                    {
                        if (Visibility == Visibility.Hidden)
                        {
                            _anchorable.Hide(false);
                        }
                        else if (Visibility == Visibility.Visible)
                        {
                            _anchorable.Show();
                        }
                    }
                }
            }

            base.OnVisibilityChanged();
        }
コード例 #3
0
        public int HookProc(int code, IntPtr wParam, IntPtr lParam)
        {
            if (code == Win32Helper.HcbtSetfocus)
            {
                FocusChanged?.Invoke(this, new FocusChangeEventArgs(wParam, lParam));
            }
            else if (code == Win32Helper.HcbtActivate)
            {
                if (_insideActivateEvent.CanEnter)
                {
                    using (_insideActivateEvent.Enter())
                    {
                        //if (Activate != null)
                        //    Activate(this, new WindowActivateEventArgs(wParam));
                    }
                }
            }


            return(Win32Helper.CallNextHookEx(_windowHook, code, wParam, lParam));
        }
コード例 #4
0
        public int HookProc(int code, IntPtr wParam, IntPtr lParam)
        {
            switch (code)
            {
            case 9:
                FocusChanged?.Invoke(this, new FocusChangeEventArgs(wParam, lParam));
                break;

            case 5:
                if (_insideActivateEvent.CanEnter)
                {
                    using (_insideActivateEvent.Enter())
                    {
                        //if (Activate != null)
                        //    Activate(this, new WindowActivateEventArgs(wParam));
                    }
                }
                break;
            }


            return(User32.CallNextHookEx(_windowHook, code, wParam, lParam));
        }
コード例 #5
0
 protected void FixChildrenDockLengths()
 {
     using (_fixingChildrenDockLengths.Enter())
         OnFixChildrenDockLengths();
 }