Exemple #1
0
        private void GetParts(SnipPagePartCollection snipPagePartCollection, XmlElement partsEle, SnipPageDesigner designer)
        {
            XmlNodeList _nodes = partsEle.SelectNodes("part");

            foreach (XmlNode node in _nodes)
            {
                SnipPartXmlElement partEle = (SnipPartXmlElement)node;
                SnipPagePart       part    = SnipPagePart.Parse(partEle, designer);

                snipPagePartCollection.Add(part);
                GetParts(part.ChildParts, partEle, designer);
            }
        }
Exemple #2
0
        protected SnipPagePart(SnipPageDesigner designer)
        {
            ResourcesReader.SetObjectResourcesHelper(this);
            _designer           = designer;
            Text                = "";
            Padding             = new System.Windows.Forms.Padding(0);
            Index               = -1;
            HtmlTagName         = "div";
            FactLines           = 2;
            _cssSection         = new CssSection();
            PartType            = SnipPartType.Static;
            ChildParts          = new SnipPagePartCollection(this);
            _classPartContainer = new ClassPartContainer(this);
            Random random = new Random();

            //BackColor = System.Drawing.Color.FromArgb(random.Next(0, 256), random.Next(0, 256), random.Next(0, 256));
            _cssSection.Properties["width"]  = "100%";
            _cssSection.Properties["height"] = "20px";
            _cssSection.Properties["float"]  = "left";
            BoxIconXOffset = 0;
            BoxIconYOffset = -8;
            BoxIconSize    = new Size(16, 16);
        }
Exemple #3
0
 /// <summary>
 /// add by fenggy 2008-06-16 根据ID从PartCollection中寻找对应的PART
 /// </summary>
 /// <param name="PartID"></param>
 /// <param name="ChildParts"></param>
 /// <returns></returns>
 private SnipPagePart GetPartFromPartCollection(string PartID, SnipPagePartCollection ChildParts)
 {
     foreach (SnipPagePart part in ChildParts)
     {
         SnipPagePart retPart = null;
         if (part.PartID.Equals(PartID))
         {
             retPart = part;
         }
         if (retPart != null)
         {
             return(retPart);
         }
         if (part.ChildParts.Count > 0)
         {
             retPart = GetPartFromPartCollection(PartID, part.ChildParts);
             if (retPart != null)
             {
                 return(retPart);
             }
         }
     }
     return(null);
 }