Exemplo n.º 1
0
 public override void BeginElement(UIElement ui, string uiname)
 {
     var newElement = xmldoc.CreateElement(uiname);
     elementStack.Push(currentElement);
     currentElement.AppendChild(newElement);
     currentElement = newElement;
     uiStacks.Push(ui);
 }
Exemplo n.º 2
0
        public void AddUI(UIElement ui)
        {
#if DEBUG
            if (this.owner == ui)
                throw new Exception("cyclic!");
#endif
            ui.ParentUI = this.owner;
            uiList.Add(ui);
        }
Exemplo n.º 3
0
        static void SerializeDzImageBox(DzBoxSerializer writer, UIElement ui)
        {
            ui.Walk(writer);
            //writer.BeginElement("imgbox");
            //var holder = ui as UIHolderBox;
            //var imgBox = holder.TargetBox as LayoutFarm.CustomWidgets.ImageBox;

            //writer.AddAttribute("left", (holder.Left + holder.HolderBorder).ToString());
            //writer.AddAttribute("top", (holder.Top + holder.HolderBorder).ToString());
            //writer.AddAttribute("width", imgBox.Width.ToString());
            //writer.AddAttribute("height", imgBox.Height.ToString());

            ////info about image
            //writer.AddAttribute("imgsrc", imgBox.ImageBinder.ImageSource);

            //writer.EndElement();
        }
Exemplo n.º 4
0
 static void SerializeDzTextBox(DzBoxSerializer writer, UIElement ui)
 {
     ui.Walk(writer);
 }
 public static void AddContent(this SampleViewport viewport, UIElement ui)
 {
     viewport.ViewportControl.AddContent(
         ui.GetPrimaryRenderElement(viewport.ViewportControl.RootGfx),
         ui);
 }
Exemplo n.º 6
0
 static void SerializeCkAwareBox(DzBoxSerializer visitor, UIElement ui)
 {
     var holder = ui as UIHolderBox;
     //serialize content of this panel             
     holder.Walk(visitor);
 }
Exemplo n.º 7
0
 static MyUIElement Wrap(LayoutFarm.UI.UIElement ui)
 {
     return(new MyUIElement(ui));
 }
Exemplo n.º 8
0
 public MyUIElement(UI.UIElement uiElem)
 {
     this.uiElem = uiElem;
 }
Exemplo n.º 9
0
 public void RemoveChild(UIElement ui)
 {
     needContentLayout = true;
     this.uiList.RemoveUI(ui);
     if (this.HasReadyRenderElement)
     {
         if (this.ContentLayoutKind != BoxContentLayoutKind.Absolute)
         {
             this.InvalidateLayout();
         }
         this.primElement.RemoveChild(ui.CurrentPrimaryRenderElement);
     }
 }
Exemplo n.º 10
0
        public void AddChild(UIElement ui)
        {
            if (this.uiList == null)
            {
                this.uiList = new UICollection(this);
            }

            needContentLayout = true;
            this.uiList.AddUI(ui);
            if (this.HasReadyRenderElement)
            {
                primElement.AddChild(ui);
                if (this.panelLayoutKind != BoxContentLayoutKind.Absolute)
                {
                    this.InvalidateLayout();
                }
            }

            if (ui.NeedContentLayout)
            {
                ui.InvalidateLayout();
            }
        }
Exemplo n.º 11
0
 public bool RemoveUI(UIElement ui)
 {
     //remove specific ui
     return uiList.Remove(ui);
 }
Exemplo n.º 12
0
 public UICollection(UIElement owner)
 {
     this.owner = owner;
 }
Exemplo n.º 13
0
 public static void AddChild(this RenderElement renderBox, UIElement ui)
 {
     renderBox.AddChild(ui.GetPrimaryRenderElement(renderBox.Root));
 }
Exemplo n.º 14
0
 public void SetContent(int r, int c, UIElement ui)
 {
     gridLayer.GetCell(r, c).ContentElement = ui.GetPrimaryRenderElement(this.Root);
 }
Exemplo n.º 15
0
 public void AddUI(UIElement ui, int rowIndex, int colIndex)
 {
     if (rowIndex < gridTable.RowCount && colIndex < gridTable.ColumnCount)
     {
         gridTable.GetCell(rowIndex, colIndex).ContentElement = ui;
         if (this.gridBoxRenderE != null)
         {
             gridBoxRenderE.SetContent(rowIndex, colIndex, ui.GetPrimaryRenderElement(gridBoxRenderE.Root));
         }
     }
 }