コード例 #1
0
 public PieChartVisiblyOptions()
 {
     foreach (var visibilityItem in VisibleItems)
     {
         visibilityItem.PropertyChanged += (sender, args) =>
         {
             if (args.PropertyName == "Visible")
             {
                 if (NeedRedraw != null)
                 {
                     NeedRedraw.Invoke();
                 }
             }
         };
     }
 }
コード例 #2
0
        internal static void RecognizeInputAndThrowEvent(Object sender, GlobalKeyEventArgs e)
        {
            Boolean isNeedRedraw = false;

            if (e.Control == ModifierKeySide.None)
            {
                return;
            }

            e.Handled = true;
            switch (e.KeyCode)
            {
            case ChangeWeaponMenuState:
                ChangedWeaponMenuState?.Invoke(sender, e);
                break;

            case ChangeSightPosition:
            {
                if (!CheckLastRedrawTime(50))
                {
                    return;
                }
                ChangedSightPosition?.Invoke(Utils.GetCursorPosition(RenderTargetSize));
                isNeedRedraw = true;
                break;
            }

            default:
                e.Handled = false;
                break;
            }

            if (!isNeedRedraw)
            {
                return;
            }
            NeedRedraw?.Invoke();
        }