Example #1
0
    public ToolBarManager(IComponentContext context, ICommandManager commandManager)
    {
        if (commandManager is null)
        {
            throw new ArgumentNullException(nameof(commandManager));
        }

        this.context            = context ?? throw new ArgumentNullException(nameof(context));
        definitionRegistrations = new UIComponentGraph(context);

        foreach (var command in commandManager.Commands)
        {
            RegisterCommand(command);
        }

        if (commandManager.Commands is INotifyCollectionChanged changed)
        {
            changed.CollectionChanged += OnCommandsCollectionChanged;
        }
    }
Example #2
0
 public UIComponentNode(UIComponentGraph graph, string name)
 {
     this.graph = graph ?? throw new ArgumentNullException(nameof(graph));
     this.name  = name ?? throw new ArgumentNullException(nameof(name));
 }