public static CommandContext CreateNestedContext(this CommandContext context, IContentForm<CommandContext> subBinder, ContentItem subItem, ItemDefinition subDefinition) { return new CommandContext(subDefinition, subItem, context.Interface, context.User) { Binder = subBinder, Errors = context.Errors, Parameters = context.Parameters, ValidationErrors = context.ValidationErrors, Validator = context.Validator }; }
private void DockPanel1ActiveContentChanged(object sender, EventArgs e) { IContentForm content = this.dockPanel1.ActiveContent as IContentForm; if (content == null) { content = this.dockPanel1.ActiveDocument as IContentForm; } this.SetContentMenus(content); }
void dockPanel1_ActiveContentChanged(object sender, EventArgs e) { IContentForm content = dockPanel1.ActiveContent as IContentForm; if (content == null) { content = dockPanel1.ActiveDocument as IContentForm; } SetContentMenus(content); }
public CommandContext(ItemDefinition definition, ContentItem content, string userInterface, IPrincipal user, IContentForm <CommandContext> binder, IValidator <CommandContext> validator) { Definition = definition; Content = content; Interface = userInterface; User = user; Binder = binder; Validator = validator; ValidationErrors = new List <ValidationError>(); Errors = new List <Exception>(); Parameters = new Dictionary <string, object>(); }
public CommandContext(ItemDefinition definition, ContentItem content, string userInterface, IPrincipal user, IContentForm<CommandContext> binder, IValidator<CommandContext> validator) { Definition = definition; Content = content; Interface = userInterface; User = user; Binder = binder; Validator = validator; ValidationErrors = new List<ValidationError>(); Errors = new List<Exception>(); Parameters = new Dictionary<string, object>(); }
public static CommandContext CreateNestedContext(this CommandContext context, IContentForm <CommandContext> subBinder, ContentItem subItem, ItemDefinition subDefinition) { return(new CommandContext(subDefinition, subItem, context.Interface, context.User) { Binder = subBinder, Errors = context.Errors, Parameters = context.Parameters, ValidationErrors = context.ValidationErrors, Validator = context.Validator }); }
private void SetContentMenus(IContentForm content) { this.mnuDelete.Enabled = content != null && content.CanDelete(); }