private static void SelectAndAction(int start, RangeCommand command, Action <PowerPoint.TextRange> action) { PowerPoint.TextFrame parent = Globals.ThisAddIn.Application.ActiveWindow.Selection.TextRange.Parent; var range = parent.TextRange.Characters(start + command.Start, command.Length); action(range); }
protected void TerminateMoveCommand() { if (moveCommand != null) { moveCommand.Abort(); } moveCommand = null; }
public void GenMoveCommand(MoveCommand _moveCommand) { if (moveCommand != null) { moveCommand.Abort(); } moveCommand = _moveCommand; moveCommand.eTaskComplete.AddListener(() => { moveCommand = null; UIManager.instance.eRefreshFloorHUD.Invoke(); }); }
public void CreateCommand() { MethodInfo methodInfo = this.GetType().GetMethod("Cast"); if (methodInfo == null) { Debug.LogError(this.GetType().ToString() + "类没有实现Cast方法"); return; } Type[] types = (from parameters in methodInfo.GetParameters() select parameters.ParameterType).ToArray(); Type p = Expression.GetActionType(types); Delegate action = Delegate.CreateDelegate(p, this, methodInfo); Vector2Int[] range = GetRange(); RangeCommand res = new RangeCommand(GetRange, owner, action, ConditionCheck); res.CreateFloorHUD(new Color(1, 1, 0, 0.8f)); PlayerControlManager.instance.PreemptSkillCommand(res); return; }
private static void SelectAndAction(int start, RangeCommand command, System.Action action) { Globals.ThisAddIn.Application.Selection.SetRange(start + command.Start, start + command.Start + command.Length); action(); }