Exemplo n.º 1
0
        protected virtual bool IsComponentActive(UIComponentRoot root, string id)
        {
            var stack = new Stack <UIComponentConfiguration>();

            stack.Push(root.Component);
            while (stack.Count > 0)
            {
                var component = stack.Pop();
                if (component == null)
                {
                    continue;
                }
                if (string.Equals(component.Component, id, StringComparison.OrdinalIgnoreCase))
                {
                    return(true);
                }
                if (component.Children != null)
                {
                    foreach (var child in component.Children)
                    {
                        stack.Push(child);
                    }
                }
            }
            return(false);
        }
Exemplo n.º 2
0
        protected virtual void ShowDesignerOverlay(UIComponentRoot root)
        {
            var designerOverlay = new UIComponentDesignerOverlay(root);

            designerOverlay.InitializeComponent(this.Core);
            this.Overlays.Add(designerOverlay);
        }
Exemplo n.º 3
0
 protected static void OnActiveChanged(UIComponentRoot sender)
 {
     if (ActiveChanged == null)
     {
         return;
     }
     ActiveChanged(sender, EventArgs.Empty);
 }
Exemplo n.º 4
0
 public override UIComponentBase Load(UILayoutTemplate template)
 {
     switch (template)
     {
     case UILayoutTemplate.Main:
         var root = new UIComponentRoot();
         root.SetBinding(
             UIComponentPanel.ComponentProperty,
             new Binding()
         {
             Source = this,
             Path   = new PropertyPath("MainComponent")
         }
             );
         return(root);
     }
     throw new NotImplementedException();
 }
Exemplo n.º 5
0
 public UIComponentDesignerOverlay(UIComponentRoot root)
 {
     this.Root = root;
 }