Inheritance: ActionBase
        protected virtual void OnHideAllWidgetsActionToggled(object sender, System.EventArgs e)
        {
            ToggleAction action = sender as ToggleAction;

            if (openedProject == null)
            {
                return;
            }

            leftbox.Visible       = !action.Active;
            timeline.Visible      = !action.Active && TimelineViewAction.Active;
            buttonswidget.Visible = !action.Active &&
                                    (TaggingViewAction.Active || ManualTaggingViewAction.Active);
            if (Config.UseGameUnits)
            {
                guTimeline.Visible             = !action.Visible && GameUnitsViewAction.Active;
                gameunitstaggerwidget1.Visible = !action.Active && (GameUnitsViewAction.Active ||
                                                                    TaggingViewAction.Active || ManualTaggingViewAction.Active);
            }
            if (action.Active)
            {
                SetTagsBoxVisibility(false);
            }
            else
            {
                if (selectedTimeNode != null)
                {
                    SetTagsBoxVisibility(true);
                }
            }
        }
        public void InsertIf(IESpace espace, List <IKey> keys)
        {
            var links = espace.GetAllDescendantsOfType <GLink>().Where(s => keys.Contains(GetDestination(s).ObjectKey));

            links = InsertIfplus(espace, keys, links);
            ToggleEntities t      = new ToggleEntities();
            ToggleAction   a      = new ToggleAction();
            var            entity = t.GetTogglesEntity(espace);
            var            action = a.GetToggleAction(espace);

            foreach (GLink l in links.ToList())
            {
                if (l.Parent is GParent1)
                {
                    var parent = (GParent1)l.Parent;
                    var rec    = t.CreateRecord(entity, $"FT_{espace.Name}_{GetDestinationName(l)}", $"FT_{GetDestinationName(l)}", espace);

                    CreateIf(parent, l, espace);
                }
                else if (l.Parent is GParent2)
                {
                    var parent = (GParent2)l.Parent;
                    var rec    = t.CreateRecord(entity, $"FT_{espace.Name}_{GetDestinationName(l)}", $"FT_{GetDestinationName(l)}", espace);

                    CreateIf2(parent, l, espace);
                }
                else
                {
                    Console.WriteLine($"Bypass Link {l} because parent is not IPlaceholderContentWidget or IContainerWidget. Parent is {l.Parent}");
                }
            }
        }
        protected virtual void OnViewToggled(object sender, System.EventArgs e)
        {
            ToggleAction action = sender as Gtk.ToggleAction;

            if (!action.Active)
            {
                return;
            }

            buttonswidget.Visible = action == ManualTaggingViewAction || sender == TaggingViewAction;
            timeline.Visible      = action == TimelineViewAction;
            if (Config.UseGameUnits)
            {
                guTimeline.Visible             = action == GameUnitsViewAction;
                gameunitstaggerwidget1.Visible = buttonswidget.Visible || guTimeline.Visible;
            }
            if (action == ManualTaggingViewAction)
            {
                buttonswidget.Mode = TagMode.Free;
            }
            else
            {
                buttonswidget.Mode = TagMode.Predifined;
            }
        }
        public IEnumerator TestToggleMoving()
        {
            // Use the Assert class to test conditions.
            // Use yield to skip a frame.
            GameObject playerUI = MonoBehaviour.Instantiate(Resources.Load <GameObject>("Prefabs/PlayerUI_Canvas"));
            GameObject player   = MonoBehaviour.Instantiate(Resources.Load <GameObject>("_Player"));

            LogAssert.ignoreFailingMessages = true;

            GameObject   button = GameObject.Find("HideUnhideButton");
            ToggleAction toggle = button.GetComponent <ToggleAction>();

            toggle.toggleHideWindow();

            yield return(new WaitForSeconds(0.1f));

            if (!toggle.showWindow)
            {
                Assert.Less(toggle.gameObject.transform.position.x, toggle.maxX);
            }
            else
            {
                Assert.Less(toggle.minX, toggle.gameObject.transform.position.x);
            }
            yield return(null);
        }
 public void Set([NotNull] IEnumerable <string> loggers, ToggleAction action)
 {
     foreach (var logger in loggers)
     {
         _loggers[logger].Set(action);
     }
 }
Example #6
0
        static void OnToggle(object obj, EventArgs args)
        {
            ToggleAction action = (ToggleAction)obj;

            Console.WriteLine("Action {0} (type={1}) activated (active={2})",
                              action.Name, action.GetType().FullName, action.Active);
        }
Example #7
0
        private void RemoveClutterFlow()
        {
            Clutter.Threads.Enter();
            music_library.Properties.Remove("Nereid.SourceContents");
            Clutter.Threads.Leave();
            clutter_flow_contents.Dispose();
            clutter_flow_contents = null;

            source_manager.ActiveSourceChanged -= HandleActiveSourceChanged;
            BrowserAction.Activated            -= OnToggleBrowser;
            BrowserAction.Active     = ClutterFlowSchemas.OldShowBrowser.Get();
            CfBrowsAction.Activated -= OnToggleClutterFlow;
            CfBrowsAction.Visible    = false;

            action_service.RemoveActionGroup("ClutterFlowView");
            action_service.UIManager.RemoveUi(ui_manager_id);
            clutterflow_actions = null;
            cfbrows_action      = null;

            preference_service = null;
            source_manager     = null;
            music_library      = null;
            action_service     = null;
            browser_action     = null;
            cfbrows_action     = null;
        }
        // ============================================
        // PRIVATE (Methods) Event Handlers
        // ============================================
        private void OnNetOnline(ToggleAction action)
        {
            // Set UserPanel Online/Offline Status
            SetSensitiveNetworkMenu(action.Active);
            userPanel.SetOnlineStatusIcon(action.Active);

            if (action.Active == true)
            {
                try {
                    P2PStartListening();
                    ConnectToWebServer();
                } catch {
                    action.Active = false;
                }
            }
            else
            {
                try {
                    DisconnectFromWebServer();
                    this.RemoveAllUsers();
                    this.p2pManager.StopListening();
                } catch (Exception e) {
                    Base.Dialogs.MessageError("P2P Disconnection Error", e.Message);
                }
            }
        }
Example #9
0
        protected virtual void OnHideAllWidgetsActionToggled(object sender, System.EventArgs e)
        {
            ToggleAction action = sender as ToggleAction;

            if (openedProject == null)
            {
                return;
            }

            leftbox.Visible       = !action.Active;
            timeline.Visible      = !action.Active && TimelineViewAction.Active;
            buttonswidget.Visible = !action.Active &&
                                    (TaggingViewAction.Active || ManualTaggingViewAction.Active);
            guTimeline.Visible             = !action.Visible && GameUnitsViewAction.Active;
            gameunitstaggerwidget1.Visible = !action.Active && (GameUnitsViewAction.Active ||
                                                                TaggingViewAction.Active || ManualTaggingViewAction.Active);
            if (action.Active)
            {
                rightvbox.Visible = false;
            }
            else if (!action.Active && (playlist.Visible || notes.Visible))
            {
                rightvbox.Visible = true;
            }
        }
        /// <summary>
        /// Handles when browser visibility is toggled
        /// </summary>
        /// <param name="o">
        /// A <see cref="System.Object"/>
        /// </param>
        /// <param name="args">
        /// A <see cref="EventArgs"/>
        /// </param>
        private void OnToggleBrowser(object o, EventArgs args)
        {
            ToggleAction action = (ToggleAction)o;

            browser_container.Visible = action.Active && ActiveSourceCanHasBrowser;
            BrowserVisible.Set(action.Active);
        }
        public void ActionCanToggleDropDownList()
        {
            var mockDropDownList = new Mock <IDropDownList>();
            var action           = new ToggleAction(mockDropDownList.Object);

            action.Execute();
            mockDropDownList.Verify(dropDownList => dropDownList.Toggle(), Times.Once());
        }
Example #12
0
 /// <summary>
 /// Toggles maps in Overwatch.
 /// </summary>
 /// <param name="ta">Determines if all maps should be enabled, disabled or neither before toggling.</param>
 /// <param name="maps">Maps that should be toggled.</param>
 public void ToggleMap(ToggleAction ta, params Map[] maps)
 {
     if (cg.ModesEnabled == null)
     {
         throw new ArgumentNullException("CustomGame.ModesEnabled", "The field CustomGame.ModesEnabled must be set in order to use ToggleMap.");
     }
     ToggleMap(cg.ModesEnabled, cg.CurrentOverwatchEvent, ta, maps);
 }
Example #13
0
        public void AddToggle(IService t, PropertyInfo pi)
        {
            ToggleAction a = new ToggleAction();

            a.target = t;
            a.pi     = pi;

            targets[a] = new Keys[] { Keys.None };
        }
Example #14
0
		void OnColumnVisibilityChanged (object o, EventArgs args)
		{
			ToggleAction action = o as ToggleAction;
			if (action != null)
			{
				view.Columns[columnsActions[action]].Visible = action.Active;
				StoreColumnsVisibility ();
			}
		}
        protected override void CreateIf(IPlaceholderContentWidget p, IWebBlockInstanceWidget o, IESpace eSpace)
        {
            ToggleAction a          = new ToggleAction();
            var          action     = a.GetToggleAction(eSpace);
            var          instanceIf = p.CreateWidget <IIfWidget>();

            instanceIf.SetCondition($"GetFTValue(Entities.FeatureToggles.FT_{eSpace.Name}_{GetName(o)})");
            instanceIf.Name = $"If_FT_{GetName(o)}";
            instanceIf.TrueBranch.Copy(o);
        }
Example #16
0
            public override bool Equals(object obj)
            {
                ToggleAction a = obj as ToggleAction;

                if (a == null)
                {
                    return(false);
                }
                return(a.target == target && a.pi == pi && a.State == State);
            }
Example #17
0
        // Handlers :: OnTogglePlay
        /// <summary>
        ///     Handler called when the TogglePlay action is activated.
        /// </summary>
        /// <remarks>
        ///	This sets <see cref="PlaylistWindow.Playing" /> to the
        ///	state of the TogglePlay action.
        /// </remarks>
        /// <param name="o">
        ///	The calling object.
        /// </param>
        /// <param name="args">
        ///	The <see cref="EventArgs" />.
        /// </param>
        private void OnTogglePlay(object o, EventArgs args)
        {
            ToggleAction a = (ToggleAction)o;

            if (a.Active == Global.Playlist.Playing)
            {
                return;
            }

            Global.Playlist.Playing = a.Active;
        }
Example #18
0
        private void ToggleMainWindow_Activated(object sender, EventArgs args)
        {
            ToggleAction action = (ToggleAction)sender;

            if (action.Active == Gui.MainWindow.IsVisible)
            {
                return;
            }

            Gui.MainWindow.ToggleVisible();
        }
Example #19
0
        // Handlers :: OnToggleRepeat
        /// <summary>
        ///     Handler called when the ToggleRepeat action is activated.
        /// </summary>
        /// <remarks>
        ///	This sets <see cref="PlaylistWindow.Repeat" /> to the
        ///	state of the ToggleRepeat action.
        /// </remarks>
        /// <param name="o">
        ///	The calling object.
        /// </param>
        /// <param name="args">
        ///	The <see cref="EventArgs" />.
        /// </param>
        private void OnToggleRepeat(object o, EventArgs args)
        {
            ToggleAction a = (ToggleAction)o;

            if (a.Active == Global.Playlist.Repeat)
            {
                return;
            }

            Global.Playlist.Repeat = a.Active;
        }
Example #20
0
        // Handlers :: OnToggleWindowVisible
        /// <summary>
        ///     Handler called when the ToggleVisible action is activated.
        /// </summary>
        /// <remarks>
        ///	This calls <see cref="PlaylistWindow.ToggleVisible" />.
        /// </remarks>
        /// <param name="o">
        ///	The calling object.
        /// </param>
        /// <param name="args">
        ///	The <see cref="EventArgs" />.
        /// </param>
        private void OnToggleVisible(object o, EventArgs args)
        {
            ToggleAction a = (ToggleAction)o;

            if (a.Active == Global.Playlist.Visible)
            {
                return;
            }

            Global.Playlist.SetWindowVisible
                (!Global.Playlist.WindowVisible, Gtk.Global.CurrentEventTime);
        }
        private void OnGenreFilterChanged(object o, EventArgs args)
        {
            ToggleAction action = (ToggleAction)o;

            ClearFilterSelections();

            GenreFilterVisible.Set(action.Active);

            Widget genre_view_widget = (Widget)genre_view;

            genre_view_widget.Parent.Visible = GenreFilterVisible.Get();
        }
        private void OnYearFilterChanged(object o, EventArgs args)
        {
            ToggleAction action = (ToggleAction)o;

            ClearFilterSelections();

            YearFilterVisible.Set(action.Active);

            Widget year_view_widget = (Widget)year_view;

            year_view_widget.Parent.Visible = YearFilterVisible.Get();
        }
Example #23
0
        private void InfoAction(object sender, System.EventArgs args)
        {
            ToggleAction action = sender as ToggleAction;

            if (info == null)
            {
                info = new InfoOverlay(this, view.Item);
            }

            info.Visibility = action.Active ?
                              ControlOverlay.VisibilityType.Partial :
                              ControlOverlay.VisibilityType.None;
        }
Example #24
0
        void OnClose(object sender, EventArgs args)
        {
            Hide();

            /*deselect the toggle action "Show lyrics" in the View menu */
            InterfaceActionService action_service     = ServiceManager.Get <InterfaceActionService> ();
            ToggleAction           show_lyrics_action = (ToggleAction)action_service.FindAction("Lyrics.ShowLyricsAction");

            if (show_lyrics_action != null)
            {
                show_lyrics_action.Active = false;
            }
        }
Example #25
0
        protected override bool OnWindowStateEvent(Gdk.EventWindowState evnt)
        {
            ToggleAction fullscreen_action = (ToggleAction)ServiceManager.Get <InterfaceActionService> ().ViewActions["FullScreenAction"];

            fullscreen_action.Active = (evnt.NewWindowState & Gdk.WindowState.Fullscreen) != 0;

            if ((evnt.NewWindowState & Gdk.WindowState.Withdrawn) == 0)
            {
                window_controller.Save();
            }

            return(base.OnWindowStateEvent(evnt));
        }
Example #26
0
    void OnPreferencesChanged(Preferences prefs)
    {
        ToggleAction viewToolbarAction = (ToggleAction)uiManager.GetAction("/menubar/View/Toolbar");

        if (prefs["View.Toolbar.Show"] == "True")
        {
            viewToolbarAction.Active = true;
        }
        else
        {
            viewToolbarAction.Active = false;
        }
    }
        private void OnClearFileSystemQueueOnQuit(object o, EventArgs args)
        {
            InterfaceActionService uia_service = ServiceManager.Get <InterfaceActionService> ();

            if (uia_service == null)
            {
                return;
            }

            ToggleAction action = (ToggleAction)uia_service.GlobalActions["ClearFileSystemQueueOnQuitAction"];

            ClearOnQuitSchema.Set(action.Active);
        }
Example #28
0
        private bool SyncActionAndCheckButton(object sender, ToggleAction action, CheckButton button)
        {
            bool status = false;

            try { CheckButton check = (CheckButton)sender; status = check.Active; }
            catch (InvalidCastException) { }

            try { ToggleAction check = (ToggleAction)sender; status = check.Active; }
            catch (InvalidCastException) { }

            button.Active = status;
            action.Active = status;

            return(status);
        }
        private void OnShareCurrentlyPlaying(object o, EventArgs args)
        {
            ToggleAction action = this["ShareCurrentlyPlayingAction"] as Gtk.ToggleAction;

            ContactContainerSource.ShareCurrentlyPlayingSchema.Set(action.Active);

            if (announcer != null && !ContactContainerSource.ShareCurrentlyPlayingSchema.Get())
            {
                announcer.Announce(String.Empty);
            }
            else
            {
                AnnounceTrack(ServiceManager.PlayerEngine.CurrentTrack);
            }
        }
Example #30
0
        private void OnToggleWindow(object o, EventArgs args)
        {
            ToggleAction action = (ToggleAction)o;

            if (action.Active)
            {
                window.ForceUpdate();
                window.Show();
                window.Present();
            }
            else
            {
                window.Hide();
            }
        }
Example #31
0
        private async Task ExecuteToggle(ToggleAction action)
        {
            if (!Toggles.ContainsKey(action.TinBotToggle))
                return;

            for (int i = 0; i < action.Repeat; i++)
            {
                if (action.TimeOn > 0)
                {
                    var t = _body.SerialOut.SetValue(Toggles[action.TinBotToggle], true);
                    await Task.WhenAll(t, Task.Delay(action.TimeOn));
                }
                if (action.TimeOff > 0)
                {
                    var t = _body.SerialOut.SetValue(Toggles[action.TinBotToggle], false);
                    await Task.WhenAll(t, Task.Delay(action.TimeOff));
                }
            }

        }