public static void EditorActionClick(EditorAction.HolderEnum holder, string actionName) { var action = EditorActions.GetByName(actionName); if (action == null) { return; } EditorActionClick(holder, action); }
public static EditorAction.GetStateContext EditorActionGetState(EditorAction.HolderEnum holder, string actionName) { var action = EditorActions.GetByName(actionName); if (action == null) { return(null); } return(EditorActionGetState(holder, action)); }
public static EditorAction.GetStateContext EditorActionGetState(EditorAction.HolderEnum holder, EditorAction action) { var objectsInFocus = GetObjectsInFocus(action.CommonType == EditorAction.CommonTypeEnum.Document); var context = new EditorAction.GetStateContext(holder, objectsInFocus, action); //common action.PerformGetState(context); //selected document objectsInFocus.DocumentWindow?.Document?.EditorActionGetState(context); //selected window objectsInFocus.DocumentWindow?.EditorActionGetState(context); //event EditorActionGetStateEvent?.Invoke(context); //context.Enabled = true; return(context); }
public static void EditorActionClick(EditorAction.HolderEnum holder, EditorAction action) { var state = EditorActionGetState(holder, action); if (state.Enabled) { var objectsInFocus = state.ObjectsInFocus; //var objectsInFocus = GetObjectsInFocus(); var context = new EditorAction.ClickContext(holder, objectsInFocus, action); //common action.PerformClick(context); //selected document objectsInFocus.DocumentWindow?.Document?.EditorActionClick(context); //selected window objectsInFocus.DocumentWindow?.EditorActionClick(context); //event EditorActionClickEvent?.Invoke(context); } }