Example #1
0
 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);
        }
Example #5
0
    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++;
    }
Example #6
0
        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);
        }
Example #7
0
        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);
            }
        }
Example #11
0
        //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);
        }
Example #12
0
 public override ucBaseEditor GetEditor(IEditorAction editorAction)
 {
     return(new ucDirectKey(editorAction));
 }
Example #13
0
 public override AutoRobo.UserControls.ucBaseEditor GetEditor(IEditorAction editorAction)
 {
     return(new ucActionGoTo(editorAction));
 }
Example #14
0
 public ucCheckBox(IEditorAction editorAction)
     : base(editorAction)
 {
     InitializeComponent();
 }
Example #15
0
 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;
        }
Example #17
0
 public override ucBaseEditor GetEditor(IEditorAction editorAction)
 {
     return(new ucCondition(editorAction));
 }
Example #18
0
 public ucSession(IEditorAction editorAction)
     : base(editorAction)
 {
     InitializeComponent();
 }
Example #19
0
 public override ucBaseEditor GetEditor(IEditorAction editorAction)
 {
     return(new ucActionCall(editorAction));
 }
Example #20
0
 public ucActionGoTo(IEditorAction editorAction)
     : base(editorAction)
 {
     InitializeComponent();
 }
Example #21
0
 public override ucBaseEditor GetEditor(IEditorAction editorAction)
 {
     return(new ucFileUpload(editorAction));
 }
Example #22
0
 public override AutoRobo.UserControls.ucBaseEditor GetEditor(IEditorAction editorAction)
 {
     return(new ucLoopByElements(editorAction));
 }
Example #23
0
 public override ucBaseEditor GetEditor(IEditorAction editorAction)
 {
     return(new ucValidateCode(editorAction));
 }
Example #24
0
 public ucBrowser(IEditorAction Caller)
     : base(Caller)
 {
     InitializeComponent();
 }
Example #25
0
 public ucSelector(IEditorAction Caller)
     : base(Caller)
 {
     InitializeComponent();
     SetHeader();
 }
Example #26
0
			public ActionNode(IEditorAction action) : base(action.Name)
			{
				this.action = action;
				this.Image = action.Icon;
			}
Example #27
0
 public ucFileUpload(IEditorAction Caller)
     : base(Caller)
 {
     InitializeComponent();
 }
Example #28
0
 public override ucBaseEditor GetEditor(IEditorAction editorAction)
 {
     return(new ucSubmitClick(editorAction));
 }
Example #29
0
 public ucMouse(IEditorAction Caller)
     : base(Caller)
 {
     InitializeComponent();
 }
Example #30
0
 public ucSelectList(IEditorAction Caller)
     : base(Caller)
 {
     InitializeComponent();
 }
Example #31
0
 public ucJavascriptInterpreter(IEditorAction editorAction) : base(editorAction)
 {
     InitializeComponent();
 }
Example #32
0
 public override ucBaseEditor GetEditor(IEditorAction editorAction)
 {
     return(new ucBrowser(editorAction));
 }