public ucVariable(IEditorAction editorAction) : base(editorAction) { InitializeComponent(); dataSourceBtn.Visible = false; varTypeList.SelectedIndexChanged += new EventHandler(varTypeList_SelectedIndexChanged); }
public override void Execute(object parameter) { IEditorAction action = GlobalManagement.Instance.RedoStack.Pop(); action.Do(); GlobalManagement.Instance.UndoStack.Push(action); }
private void AddAction(string actionName, ActionParameter parameter) { ICoreBrowser browser = Context.Browser; ActionBase action = Model.CreateAction(Context, actionName, parameter); if (action == null) { return; } IEditorAction editorProvider = View as IEditorAction; var editor = action.GetEditor(editorProvider); if (editor != null) { action.RowStatue = ActionStatue.New; editor.Action = action; editorProvider.ShowEditAction(editor); } else { Model.AddAction(action); } }
private void contextMenu_CustomAction(object sender, EventArgs e) { Component[] values = this.GetValue().Cast <Component>().NotNull().ToArray(); ToolStripMenuItem clickedItem = sender as ToolStripMenuItem; IEditorAction action = clickedItem.Tag as IEditorAction; action.Perform(values); }
public void ExecuteAction(IEditorAction action) { int numActions = loggedActions.Count; if (numActions > 0 && currentActionIndex < (numActions - 1)) { while (loggedActions.Count > (currentActionIndex + 1)) { loggedActions.RemoveAt(loggedActions.Count - 1); } } loggedActions.Add(action); action.ApplyAction(); currentActionIndex++; }
public void Add(IEditorAction editorAction) { Modified = true; editorAction.Execute(); if (undoStack.Count > 0) { undoStack.Peek().Status = EditorActionStatus.History; } var actionContainer = new EditorActionContainer(nextId++, editorAction); ClearRedo(); undoStack.Push(actionContainer); ItemAdded?.Invoke(actionContainer); }
private void EditorEventRaised(IEditorEvent obj) { // Update drawing if (obj is SectorColoringManager.ChangeSectorColoringInfoEvent || obj is Editor.SelectedSectorsChangedEvent || obj is Editor.RoomSectorPropertiesChangedEvent || obj is Editor.RoomGeometryChangedEvent || obj is Editor.ConfigurationChangedEvent || obj is Editor.SelectedObjectChangedEvent && IsObjectChangeRelevant((Editor.SelectedObjectChangedEvent)obj)) { Invalidate(); } // Update cursor if (obj is Editor.ActionChangedEvent) { IEditorAction currentAction = ((Editor.ActionChangedEvent)obj).Current; Cursor = currentAction is EditorActionRelocateCamera ? Cursors.Cross : Cursors.Arrow; } }
internal void Do(IEditorAction action) { if (action is IKnowsMapInfo) { (action as IKnowsMapInfo).Info = mapInfo; } if (action is IKnowsScene) { (action as IKnowsScene).Scene = scene; } if (action is IKnowsPrefabManager) { (action as IKnowsPrefabManager).Prefabs = prefabs; } action.Do(); undoStack.Push(action); redoStack.Clear(); }
public IEnumerable <IEditorAction> GetAdditionalEditorActions(string word) { // We have two additional editor actions. var addSensitiveAction = new EditorAction( "Add case-sensitive local words", new HierarchicalPath("/Plugins/Local Words/Add to Sensitive"), context => AddToSensitiveList(context, word)); var addInsensitiveAction = new EditorAction( "Add case-insensitive local words", new HierarchicalPath("/Plugins/Local Words/Add to Insensitive"), context => AddToInsensitiveList(context, word)); // Return the resutling list. var results = new IEditorAction[] { addSensitiveAction, addInsensitiveAction }; return(results); }
/// <summary> /// 编辑活动或打开子活动列表 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void View_ActionEdit(object sender, EventArgs e) { if (Context.State.SelectItemIndex == -1) { return; } var action = Model.ActiveActionModel[Context.State.SelectItemIndex - 1]; ViewBase baseView = View as ViewBase; // 不是toolbar 编辑按钮触发事件 if ((action is ActionBlock || action is ActionDataBlock) && !(sender is ToolStripButton)) { ActionBlock block = action as ActionBlock; if (action is ActionBlock) { ((ActionBlock)action).Enter(); Model.ActiveActionModel = ((ActionBlock)action).Actions; } else { ActionDataBlock part = action as ActionDataBlock; Model.ActiveActionModel = ((ActionDataBlock)action).Actions; } View.DataSource = Model.ActiveActionModel; Context.State.SelectItemIndex = -1; View.DataBind(); } else { IEditorAction editView = View as IEditorAction; ucBaseEditor editor = action.GetEditor(editView); if (editor == null) { return; } editor.Action = action; editView.ShowEditAction(editor); } }
//public string GetDocumentPath(ICodeFormatter Formatter) //{ // var builder = new StringBuilder(); // builder.Append(Window.FriendlyName); // if (FrameList.Count > 0) // { // builder.Append(Formatter.MethodSeparator); // builder.Append("Frame(" + FrameList + ")"); // } // return builder.ToString(); //} public override ucBaseEditor GetEditor(IEditorAction editorAction) { return(null); }
public override ucBaseEditor GetEditor(IEditorAction editorAction) { return(new ucDirectKey(editorAction)); }
public override AutoRobo.UserControls.ucBaseEditor GetEditor(IEditorAction editorAction) { return(new ucActionGoTo(editorAction)); }
public ucCheckBox(IEditorAction editorAction) : base(editorAction) { InitializeComponent(); }
public EditorActionEntry(IEditorAction action, string context) { this.action = action; this.context = context; }
public IEnumerable<IEditorAction> GetAdditionalEditorActions(string word) { // We have two additional editor actions. var addSensitiveAction = new EditorAction( "Add case-sensitive local words", new HierarchicalPath("/Plugins/Local Words/Add to Sensitive"), context => AddToSensitiveList(context, word)); var addInsensitiveAction = new EditorAction( "Add case-insensitive local words", new HierarchicalPath("/Plugins/Local Words/Add to Insensitive"), context => AddToInsensitiveList(context, word)); // Return the resutling list. var results = new IEditorAction[] { addSensitiveAction, addInsensitiveAction }; return results; }
public override ucBaseEditor GetEditor(IEditorAction editorAction) { return(new ucCondition(editorAction)); }
public ucSession(IEditorAction editorAction) : base(editorAction) { InitializeComponent(); }
public override ucBaseEditor GetEditor(IEditorAction editorAction) { return(new ucActionCall(editorAction)); }
public ucActionGoTo(IEditorAction editorAction) : base(editorAction) { InitializeComponent(); }
public override ucBaseEditor GetEditor(IEditorAction editorAction) { return(new ucFileUpload(editorAction)); }
public override AutoRobo.UserControls.ucBaseEditor GetEditor(IEditorAction editorAction) { return(new ucLoopByElements(editorAction)); }
public override ucBaseEditor GetEditor(IEditorAction editorAction) { return(new ucValidateCode(editorAction)); }
public ucBrowser(IEditorAction Caller) : base(Caller) { InitializeComponent(); }
public ucSelector(IEditorAction Caller) : base(Caller) { InitializeComponent(); SetHeader(); }
public ActionNode(IEditorAction action) : base(action.Name) { this.action = action; this.Image = action.Icon; }
public ucFileUpload(IEditorAction Caller) : base(Caller) { InitializeComponent(); }
public override ucBaseEditor GetEditor(IEditorAction editorAction) { return(new ucSubmitClick(editorAction)); }
public ucMouse(IEditorAction Caller) : base(Caller) { InitializeComponent(); }
public ucSelectList(IEditorAction Caller) : base(Caller) { InitializeComponent(); }
public ucJavascriptInterpreter(IEditorAction editorAction) : base(editorAction) { InitializeComponent(); }
public override ucBaseEditor GetEditor(IEditorAction editorAction) { return(new ucBrowser(editorAction)); }