public EditMode([NotNull] Commandy commandy) : base(commandy) { Assert.ArgumentNotNull(commandy, nameof(commandy)); Name = "Edit"; Alias = "e"; }
public WorkflowMode([NotNull] Commandy commandy) : base(commandy) { Assert.ArgumentNotNull(commandy, nameof(commandy)); Name = "Workflow Command"; Alias = "w"; var context = commandy.Parameter as IItemSelectionContext; if (context == null) { IsReady = true; return; } if (!context.Items.Any()) { IsReady = true; return; } var list = string.Join("|", context.Items.Select(i => i.ItemUri.ItemId.ToString())); var databaseUri = context.Items.First().ItemUri.DatabaseUri; databaseUri.Site.DataService.ExecuteAsync("Workflows.GetWorkflowCommands", LoadWorkflowCommands, databaseUri.DatabaseName.ToString(), list); }
public override void Execute(object parameter) { if (parameter != null) { Commandy.Open(parameter); } }
public LanguageMode([NotNull] Commandy commandy) : base(commandy) { Assert.ArgumentNotNull(commandy, nameof(commandy)); Name = "Language"; Alias = "l"; var context = commandy.Parameter as IDatabaseSelectionContext; if (context == null) { IsReady = true; return; } if (context.DatabaseUri == DatabaseUri.Empty) { IsReady = true; return; } var databaseUri = context.DatabaseUri; databaseUri.Site.DataService.ExecuteAsync("Languages.GetLanguages", LoadLanguages, databaseUri.DatabaseName.ToString()); }
public SearchMode([NotNull] Commandy commandy) : base(commandy) { Assert.ArgumentNotNull(commandy, nameof(commandy)); Name = "Search"; Alias = "s"; }
public CommandMode([NotNull] Commandy commandy) : base(commandy) { Assert.ArgumentNotNull(commandy, nameof(commandy)); Name = "Execute Command"; Alias = "c"; Commands = CommandManager.CommandDescriptors.Where(c => c.Command.CanExecute(Commandy.Parameter) && !(c.Command is Submenu) && !c.ExcludeFromSearch).Select(c => new CommandHit(c.Command, GetText(c))); IsReady = true; }
public InsertRenderingMode([NotNull] Commandy commandy) : base(commandy) { Assert.ArgumentNotNull(commandy, nameof(commandy)); Name = "Insert Rendering"; Alias = "r"; var context = commandy.Parameter as LayoutDesignerContext; if (context == null) { IsReady = true; } }
public SetBaseTemplateMode([NotNull] Commandy commandy) : base(commandy) { Assert.ArgumentNotNull(commandy, nameof(commandy)); Name = "Set Base Template"; Alias = "b"; var databaseSelectionContext = commandy.Parameter as IDatabaseSelectionContext; if (databaseSelectionContext != null) { AppHost.Server.GetTemplates(databaseSelectionContext.DatabaseUri, LoadTemplates); } else { IsReady = true; } }
public InsertMode([NotNull] Commandy commandy) : base(commandy) { Assert.ArgumentNotNull(commandy, nameof(commandy)); Name = "Insert Options"; Alias = "i"; var context = commandy.Parameter as IItemSelectionContext; if (context != null && context.Items.Count() == 1) { var item = context.Items.First(); item.ItemUri.Site.DataService.GetInsertOptions(item.ItemUri, LoadInsertOptions); } else { IsReady = true; } }
protected ModeBase([NotNull] Commandy commandy) { Debug.ArgumentNotNull(commandy, nameof(commandy)); Commandy = commandy; }
protected SearchBasedMode([NotNull] Commandy commandy) : base(commandy) { Debug.ArgumentNotNull(commandy, nameof(commandy)); IsReady = true; }