/// <summary>
 /// 添加某个Panel的子Panel
 /// </summary>
 /// <param name="panelId"></param>
 /// <param name="childPanel"></param>
 internal void AddPanelChild(string panelId, PanelTag childPanel)
 {
     if (!_panelChilds.ContainsKey(panelId))
     {
         _panelChilds.Add(panelId, new List <PanelTag>(10));
     }
     _panelChilds[panelId].Add(childPanel);
 }
Пример #2
0
        /// <summary>
        /// 克隆当前元素到新的宿主模板
        /// </summary>
        /// <param name="ownerTemplate"></param>
        /// <returns></returns>
        internal override Element Clone(Template ownerTemplate)
        {
            PanelTag tag = new PanelTag(ownerTemplate);

            tag.Container = this.Container;
            this.CopyTo(tag);

            if (!string.IsNullOrEmpty(this.Container))
            {
                ownerTemplate.OwnerDocument.AddPanelChild(this.Container, tag);
            }

            return(tag);
        }
Пример #3
0
        /// <summary>
        /// 克隆当前元素到新的宿主模板
        /// </summary>
        /// <param name="ownerTemplate"></param>
        /// <returns></returns>
        internal override Element Clone(Template ownerTemplate)
        {
            PanelTag tag = new PanelTag(ownerTemplate);

            tag.Container = this.Container;
            this.CopyTo(tag);

            if (!string.IsNullOrEmpty(this.Container))
            {
                var conTag = ownerTemplate.OwnerDocument.GetChildTagById(this.Container) as PanelTag;
                if (conTag != null)
                {
                    conTag.Panels.Add(tag);
                }
            }

            return(tag);
        }
Пример #4
0
        /// <summary>
        /// 克隆当前元素到新的宿主模板
        /// </summary>
        /// <param name="ownerTemplate"></param>
        /// <returns></returns>
        internal override Element Clone(Template ownerTemplate)
        {
            PanelTag tag = new PanelTag(ownerTemplate);
            tag.Container = this.Container;
            this.CopyTo(tag);

            if (!string.IsNullOrEmpty(this.Container))
            {
                var conTag = ownerTemplate.OwnerDocument.GetChildTagById(this.Container) as PanelTag;
                if (conTag != null) conTag.Panels.Add(tag);
            }

            return tag;
        }