Esempio 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);
        }
Esempio n. 2
0
        protected virtual void ShowDesignerOverlay(UIComponentRoot root)
        {
            var designerOverlay = new UIComponentDesignerOverlay(root);

            designerOverlay.InitializeComponent(this.Core);
            this.Overlays.Add(designerOverlay);
        }
Esempio n. 3
0
 protected static void OnActiveChanged(UIComponentRoot sender)
 {
     if (ActiveChanged == null)
     {
         return;
     }
     ActiveChanged(sender, EventArgs.Empty);
 }
Esempio 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();
 }
Esempio n. 5
0
 public UIComponentDesignerOverlay(UIComponentRoot root)
 {
     this.Root = root;
 }