示例#1
0
        private void RadioButton_Checked(object sender, RoutedEventArgs e)
        {
            switch ((sender as RadioButton).Name)
            {
            case "StartPoint": { ModeChanged?.Invoke(null, new ModeEventArgs()
                    {
                        Mode = ModePoint.StartPoint
                    }); }
                    break;

            case "BlockPoint": { ModeChanged?.Invoke(null, new ModeEventArgs()
                    {
                        Mode = ModePoint.BlockPoint
                    }); }
                    break;

            case "EndPoint": { ModeChanged?.Invoke(null, new ModeEventArgs()
                    {
                        Mode = ModePoint.EndPoint
                    }); }
                    break;

            case "Shortest": { BackPathType = BackPathType.Shortest; }
            break;

            case "Reversed": { BackPathType = BackPathType.Reversed; }
            break;
            }
        }
示例#2
0
 /// <summary>
 /// Update functional settings fom SV values
 /// </summary>
 private void UpdateFunctionalSettings()
 {
     if (!updating)
     {
         try
         {
             updating  = true;
             this.mode = PinMode.Find(config.Value, value1.Value, value2.Value);
             if (this.mode != null)
             {
                 this.address = mode.GetAddress(config.Value, value1.Value, value2.Value);
             }
             else
             {
                 this.address = 0;
             }
             ModeChanged.Fire(this);
             AddressChanged.Fire(this);
         }
         finally
         {
             updating = false;
         }
     }
 }
        public async Task SetModeAsync(TimeFormatterMode mode)
        {
            await _localStorage.SetAsync(_storageKey, mode.ToString());

            Mode = mode;
            ModeChanged?.Invoke();
        }
示例#4
0
 protected virtual void OnModeChanged(EventArgs e)
 {
     if (ModeChanged != null)
     {
         ModeChanged.Invoke(this, e);
     }
 }
示例#5
0
        private void modeChanged(Screen newScreen)
        {
            //central game mode change logic.
            if ((newScreen as OsuScreen)?.ShowOverlays != true)
            {
                Toolbar.State         = Visibility.Hidden;
                musicController.State = Visibility.Hidden;
                chat.State            = Visibility.Hidden;
            }
            else
            {
                Toolbar.State = Visibility.Visible;
            }

            if (newScreen is MainMenu)
            {
                Cursor.FadeIn(100);
            }

            ModeChanged?.Invoke(newScreen);

            if (newScreen == null)
            {
                Exit();
            }
        }
示例#6
0
 private void OnModeChanged()
 {
     if (ModeChanged != null)
     {
         ModeChanged.Invoke(this, EventArgs.Empty);
     }
 }
 private void OnModeChanged(IntPtr hWnd, IntPtr hRgb, RGBMODECHANGEDINFO modeChangedInfo, IntPtr userData)
 {
     lock (_handlerLock)
     {
         var e = new RgbEasyModeChangedEventArgs(hWnd, this, modeChangedInfo, userData);
         ModeChanged?.Invoke(this, e);
     }
 }
示例#8
0
 private void SetMode(EditorMode input)
 {
     if (Mode != input)
     {
         Mode = input;
         ModeChanged?.Invoke();
     }
 }
示例#9
0
 public static void ChangeMode(GlobalGraphicsMode mode)
 {
     if (!FSOEnvironment.Enable3D)
     {
         return;
     }
     _Mode = mode;
     ModeChanged?.Invoke(mode);
 }
示例#10
0
        public void OnModeChanged(ChatMode oValue, ChatMode nValue)
        {
            ModeChanged?.Invoke(this, EventArgs.Empty);

            if (ChatModeButton != null)
            {
                ChatModeButton.Label.Text = Mode.ToString();
            }
        }
    public void SetEditMode(bool mode)
    {
        Mode = mode ? MenuMode.Record : MenuMode.Replay;

        foreach (Transform item in ItemParent.transform)
        {
            item.gameObject.GetComponent <MenuItemController>().SetMode(mode);
        }
        ModeChanged?.Invoke(this, new ModeChangedEventArgs(Mode));
    }
        public void Parse(Line line)
        {
            var match = _modeRegex.Match(line.Text);

            if (match.Success)
            {
                var currentMode  = GetMode(match.Groups["curr"].Value);
                var previousMode = GetMode(match.Groups["prev"].Value);
                ModeChanged?.Invoke(new ModeChangedEventArgs(currentMode, previousMode));
            }
            else if (line.Text.Contains("Gameplay.Start"))
            {
                GameplayStart?.Invoke();
            }
        }
示例#13
0
        private void sensor_ModeChanged(object sender, ModeChangedEventArgs e)
        {
            ModeChanged?.Invoke(sender, e);

            var sensorsWithReceiveModeChangedSupport = _sensors.Where(x => x as IReceiveModeChanged != null).Select(x => (IReceiveModeChanged)x).ToList();

            foreach (var sensor in sensorsWithReceiveModeChangedSupport)
            {
                bool sensorIsSender = sender.GetType().Name == sensor.GetType().Name;
                if (!sensorIsSender)
                {
                    sensor.OnModeHasChanged(sender, e);
                }
            }
        }
示例#14
0
        public void OnModeChanged(ChatMode oValue, ChatMode nValue)
        {
            ModeChanged?.Invoke(this, EventArgs.Empty);

            if (ChatModeButton != null)
            {
                ChatModeButton.Label.Text = Mode.ToString();
            }
            switch (Mode)
            {
            case ChatMode.Local:
                ChatModeButton.Label.Text = "本地";
                break;

            case ChatMode.Shout:
                ChatModeButton.Label.Text = "喊话";
                break;

            case ChatMode.Whisper:
                ChatModeButton.Label.Text = "私聊";
                break;

            case ChatMode.Group:
                ChatModeButton.Label.Text = "组队";
                break;

            case ChatMode.Guild:
                ChatModeButton.Label.Text = "行会";
                break;

            case ChatMode.Global:
                ChatModeButton.Label.Text = "全服";
                break;

            case ChatMode.Observer:
                ChatModeButton.Label.Text = "观察";
                break;
            }
        }
示例#15
0
        public void SetMode(UIMainPanelMode mode)
        {
            if (mode == Mode)
            {
                return;
            }
            Mode = mode;

            Game.LotControl.World.State.BuildMode = 0;
            switch (mode)
            {
            case UIMainPanelMode.LIVE:
                Switcher.InitCategories(LiveCategories);
                break;

            case UIMainPanelMode.BUY:
                Switcher.InitCategories(BuyCategories);
                Game.LotControl.World.State.BuildMode = 1;
                break;

            case UIMainPanelMode.BUILD:
                Switcher.InitCategories(BuildCategories);
                Game.LotControl.World.State.BuildMode = 2;
                break;

            case UIMainPanelMode.OPTIONS:
                Switcher.InitCategories(OptionsCategories);
                break;
            }

            var live = (mode == UIMainPanelMode.LIVE);

            Game.LotControl.LiveMode = live;
            HideButton.Visible       = live;

            ModeChanged?.Invoke(mode);
        }
示例#16
0
 private void PickerChange_Mode(object sender, EventArgs e) => ModeChanged?.Invoke(sender, e);
示例#17
0
 private void OnModeChanged(bool e)
 {
     ModeChanged?.Invoke(this, e);
 }
示例#18
0
 private void _trayIcon_ModeOnClick(object sender, ModeOnClickEventArgs e)
 {
     ModeChanged?.Invoke(this, new ModeChangedEventArgs("", e.Mode));
 }
示例#19
0
        private void SetMode(MultiModeEditorCommandBarMode newMode)
        {
            switch (_currentMode)
            {
            case MultiModeEditorCommandBarMode.Normal:
                PrimaryCommands.Remove(_newButton);
                PrimaryCommands.Remove(_selectButton);
                PrimaryCommands.Remove(_reorderButton);
                PrimaryCommands.Remove(_playButton);
                break;

            case MultiModeEditorCommandBarMode.Reorder:
                PrimaryCommands.Remove(_finishedReorderingButton);
                break;

            case MultiModeEditorCommandBarMode.Select:
                PrimaryCommands.Remove(_deleteButton);
                PrimaryCommands.Remove(_copyButton);
                PrimaryCommands.Remove(_cancelSelectionButton);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            switch (newMode)
            {
            case MultiModeEditorCommandBarMode.Normal:
                PrimaryCommands.Add(_newButton);
                PrimaryCommands.Add(_selectButton);

                if (TargetType == AppBarTargetType.Object)
                {
                    PrimaryCommands.Add(_reorderButton);
                }

                PrimaryCommands.Add(_playButton);
                _playButton.IsEnabled = true;
                break;

            case MultiModeEditorCommandBarMode.Reorder:
                PrimaryCommands.Add(_finishedReorderingButton);
                _playButton.IsEnabled = false;
                break;

            case MultiModeEditorCommandBarMode.Select:
                PrimaryCommands.Add(_deleteButton);
                PrimaryCommands.Add(_copyButton);
                PrimaryCommands.Add(_cancelSelectionButton);
                _playButton.IsEnabled = false;
                break;

            default:
                throw new ArgumentOutOfRangeException("newMode");
            }


            _currentMode = newMode;

            if (ModeChanged != null)
            {
                Mode = newMode;
                ModeChanged.Invoke(newMode);
            }
        }
 private void OnModeChanged(Mode mode)
 {
     ModeChanged?.Invoke(this, new ModeChangedEventArgs {
         Mode = mode
     });
 }
示例#21
0
        void UpdateMode()
        {
            // Don't bother running this logic until after we hit OnApplyTemplate.
            if (!m_loaded)
            {
                return;
            }

            double controlWidth  = ActualWidth;
            double controlHeight = ActualHeight;

            ViewMode newMode = (PanePriority == TwoPaneViewPriority.Pane1) ? ViewMode.Pane1Only : ViewMode.Pane2Only;

            // Calculate new mode
            DisplayRegionHelperInfo info = DisplayRegionHelper.GetRegionInfo();
            Rect rcControl           = GetControlRect();
            bool isInMultipleRegions = IsInMultipleRegions(info, rcControl);

            if (isInMultipleRegions)
            {
                if (info.Mode == TwoPaneViewMode.Wide)
                {
                    // Regions are laid out horizontally
                    if (WideModeConfiguration != TwoPaneViewWideModeConfiguration.SinglePane)
                    {
                        newMode = (WideModeConfiguration == TwoPaneViewWideModeConfiguration.LeftRight) ? ViewMode.LeftRight : ViewMode.RightLeft;
                    }
                }
                else if (info.Mode == TwoPaneViewMode.Tall)
                {
                    // Regions are laid out vertically
                    if (TallModeConfiguration != TwoPaneViewTallModeConfiguration.SinglePane)
                    {
                        newMode = (TallModeConfiguration == TwoPaneViewTallModeConfiguration.TopBottom) ? ViewMode.TopBottom : ViewMode.BottomTop;
                    }
                }
            }
            else
            {
                // One region
                if (controlWidth > MinWideModeWidth && WideModeConfiguration != TwoPaneViewWideModeConfiguration.SinglePane)
                {
                    // Split horizontally
                    newMode = (WideModeConfiguration == TwoPaneViewWideModeConfiguration.LeftRight) ? ViewMode.LeftRight : ViewMode.RightLeft;
                }
                else if (controlHeight > MinTallModeHeight && TallModeConfiguration != TwoPaneViewTallModeConfiguration.SinglePane)
                {
                    // Split vertically
                    newMode = (TallModeConfiguration == TwoPaneViewTallModeConfiguration.TopBottom) ? ViewMode.TopBottom : ViewMode.BottomTop;
                }
            }

            // Update row/column sizes (this may need to happen even if the mode doesn't change)
            UpdateRowsColumns(newMode, info, rcControl);

            // Update mode if necessary
            if (newMode != m_currentMode)
            {
                m_currentMode = newMode;

                TwoPaneViewMode newViewMode = TwoPaneViewMode.SinglePane;

                switch (m_currentMode)
                {
                case ViewMode.Pane1Only: VisualStateManager.GoToState(this, "ViewMode_OneOnly", true); break;

                case ViewMode.Pane2Only: VisualStateManager.GoToState(this, "ViewMode_TwoOnly", true); break;

                case ViewMode.LeftRight: VisualStateManager.GoToState(this, "ViewMode_LeftRight", true); newViewMode = TwoPaneViewMode.Wide; break;

                case ViewMode.RightLeft: VisualStateManager.GoToState(this, "ViewMode_RightLeft", true); newViewMode = TwoPaneViewMode.Wide; break;

                case ViewMode.TopBottom: VisualStateManager.GoToState(this, "ViewMode_TopBottom", true); newViewMode = TwoPaneViewMode.Tall; break;

                case ViewMode.BottomTop: VisualStateManager.GoToState(this, "ViewMode_BottomTop", true); newViewMode = TwoPaneViewMode.Tall; break;
                }

                if (newViewMode != Mode)
                {
                    SetValue(ModeProperty, newViewMode);
                    ModeChanged?.Invoke(this, this);
                }
            }
        }
示例#22
0
        //---------------------------------------------------------------------------

        private void OnModeChanged(T mode)
        {
            ModeChanged?.Invoke(mode);
        }
示例#23
0
 protected virtual void OnModeChanged(EventArgs e)
 {
     ModeChanged?.Invoke(this, e);
 }
示例#24
0
 private void OnStateChanged(Mode newMode)
 {
     ModeChanged?.Invoke(newMode);
 }
示例#25
0
 public void ChangeMode(Mode mode)
 {
     CurrentMode = mode;
     ShowPane();
     ModeChanged?.Invoke(mode);
 }
示例#26
0
        /// <summary>
        /// 引发 <see cref="ModeChanged"/> 事件
        /// </summary>

        protected virtual void OnModeChanged()
        {
            ModeChanged?.Invoke(this, EventArgs.Empty);
        }
示例#27
0
 private void NotifyModeChanged(vsIDEMode lastmode)
 {
     Console.WriteLine("Mode: " + ((DTE)Package.GetGlobalService(typeof(DTE))).Mode);
     DesignerKiller.KillAllDesigners();
     ModeChanged?.Invoke();
 }
示例#28
0
 private void OnChanged()
 {
     ModeChanged.Invoke(this, EventArgs.Empty);
 }
 protected virtual void OnModeChanged(AnsiMode mode)
 {
     ModeChanged?.Invoke(mode);
 }
示例#30
0
 public void DummyFunction()
 {
     ModeChanged?.Invoke(); ConfigurationChanged?.Invoke();
 }