Пример #1
0
 protected virtual void OnFocused()
 {
     if (Focused != null)
     {
         Focused.Invoke(this, System.EventArgs.Empty);
     }
 }
Пример #2
0
 /// <summary>
 /// Called when the context becomes focused or active. This will be
 /// called after startup and after resume and means that the context is
 /// open and ready to recieve input.
 /// </summary>
 private void focus()
 {
     if (Focused != null)
     {
         Focused.Invoke(this);
     }
     if (!String.IsNullOrEmpty(FocusAction))
     {
         runFinalAction(FocusAction);
     }
 }
Пример #3
0
    public virtual void Activate()
    {
        if (OnPanel != null)
        {
            OnPanel.Invoke();
        }

        if (changeBGM)
        {
            BGM.instance.ChangeSong();
        }
    }
Пример #4
0
 public override bool BecomeFirstResponder()
 {
     Focused?.Invoke(this, EventArgs.Empty);
     return(base.BecomeFirstResponder());
 }
Пример #5
0
 private void _subjectModel_Focused(object sender, EventArgs e)
 {
     Focused?.Invoke(this, null);
 }
 private void HandleFocused(object sender, FocusEventArgs e)
 {
     Focused?.Invoke(this, e);
 }
Пример #7
0
        private void entry_Focused(object sender, FocusEventArgs e)
        {
            entryBorder.BorderColor = FocusBorderColor;

            Focused?.Invoke(entry, e);
        }
Пример #8
0
 void PropertyEditorPanel_Focused(object sender, EventArgs e) => Focused?.Invoke(this, EventArgs.Empty);
 private void DatePicker_Focused(object sender, FocusEventArgs e)
 {
     _wasFocused = true;
     FocusCommand?.Execute(datePicker.IsFocused);
     Focused?.Invoke(this, e);
 }
Пример #10
0
        public MvcEditorContext(AnomalousMvcContext editingContext, String file, MvcTypeController mvcTypeController, EditorController editorController, EditorUICallback uiCallback)
        {
            this.mvcTypeController = mvcTypeController;
            this.currentFile       = file;
            this.editingContext    = editingContext;

            mvcContext = new AnomalousMvcContext();
            mvcContext.StartupAction = "Common/Start";
            mvcContext.FocusAction   = "Common/Focus";
            mvcContext.BlurAction    = "Common/Blur";
            mvcContext.SuspendAction = "Common/Suspended";
            mvcContext.ResumeAction  = "Common/Resumed";

            mvcContext.Models.add(new EditMenuManager());

            GenericPropertiesFormView genericPropertiesView = new GenericPropertiesFormView("MvcContext", editingContext.getEditInterface(), editorController, uiCallback, true);

            genericPropertiesView.ElementName = new MDILayoutElementName(GUILocationNames.MDI, DockLocation.Left);
            mvcContext.Views.add(genericPropertiesView);

            taskbar = new EditorTaskbarView("InfoBar", currentFile, "Editor/Close");
            taskbar.addTask(new CallbackTask("SaveAll", "Save All", "Editor/SaveAllIcon", "", 0, true, item =>
            {
                saveAll();
            }));
            taskbar.addTask(new RunMvcContextActionTask("Save", "Save Rml File", "CommonToolstrip/Save", "File", "Editor/Save", mvcContext));
            mvcContext.Views.add(taskbar);

            mvcContext.Controllers.add(new MvcController("Editor",
                                                         new RunCommandsAction("Show",
                                                                               new ShowViewCommand("MvcContext"),
                                                                               new ShowViewCommand("InfoBar")),
                                                         new RunCommandsAction("Close",
                                                                               new CloseAllViewsCommand()),
                                                         new CallbackAction("Save", context =>
            {
                save();
            })));

            mvcContext.Controllers.add(new MvcController("Common",
                                                         new RunCommandsAction("Start", new RunActionCommand("Editor/Show")),
                                                         new CallbackAction("Focus", context =>
            {
                GlobalContextEventHandler.setEventContext(eventContext);
                if (Focused != null)
                {
                    Focused.Invoke(this);
                }
            }),
                                                         new CallbackAction("Blur", context =>
            {
                GlobalContextEventHandler.disableEventContext(eventContext);
                if (Blured != null)
                {
                    Blured.Invoke(this);
                }
            }),
                                                         new RunCommandsAction("Suspended", new SaveViewLayoutCommand()),
                                                         new RunCommandsAction("Resumed", new RestoreViewLayoutCommand())));

            taskbar.addTask(new CallbackTask("PreviewMvc", "Preview", "MvcContextEditor/MVCcomIcon", "", 0, true, (item) =>
            {
                uiCallback.previewMvcContext(editingContext);
            }));

            eventContext = new EventContext();
            eventContext.addEvent(new ButtonEvent(EventLayers.Gui,
                                                  frameUp: eventManager =>
            {
                saveAll();
            },
                                                  keys: new KeyboardButtonCode[] { KeyboardButtonCode.KC_LCONTROL, KeyboardButtonCode.KC_S }));
        }