/// <summary>
        /// Obtain place holder.
        /// </summary>
        /// <param name="placeholder">Object of XmlTag class.</param>
        /// <param name="lstWrapper">List of CustomWrapper class.</param>
        /// <param name="_Mode">Mode</param>
        /// <returns>String format of placeholder markup.</returns>
        public static string ProcessPlaceholder(XmlTag placeholder, List<CustomWrapper> lstWrapper, int _Mode)
        {
            Mode = _Mode;
            ///1.Check for outer wrappers(skipping for now)
            ///2.Check for the wrapper="inner,3" attribute, Split the positions and inline styles according to width and mode attribute
            StringBuilder sb = new StringBuilder();
            foreach (XmlTag pch in placeholder.LSTChildNodes)
            {
                string[] positions = pch.InnerHtml.Split(',');
                int mode = Utils.GetAttributeValueByName(pch, XmlAttributeTypes.MODE) == "" ? 0 : 1;
                foreach (CustomWrapper start in lstWrapper)
                {
                    if (start.Type == "placeholder" && Utils.GetAttributeValueByName(pch, XmlAttributeTypes.NAME).ToLower().Equals(start.Start))
                    {
                        string style = string.Format("sfBlockwrap {0}", start.Class);
                        int depth = start.Depth;
                        for (int i = 1; i <= depth; i++)
                        {
                            if (i == 1)
                            {
                                style = start.Depth > 1 ? string.Format("sfBlockwrap sfWrap{0}{1}", start.Index, start.Class == "" ? "" : string.Format(" {0}", start.Class)) : string.Format("sfBlockwrap sfWrap{0}{1} clearfix", start.Index, start.Class == "" ? "" : string.Format(" {0}", start.Class)); ;
                                sb.Append("<div class='" + style + "'>");
                            }
                            else
                            {
                                style = start.Depth == i ? string.Format("sfBlockwrap sf{0}{1} clearfix", i - 1, start.Class == "" ? "" : string.Format(" {0}", start.Class)) : string.Format("sfBlockwrap sf{0}{1}", i - 1, start.Class == "" ? "" : string.Format(" {0}", start.Class));
                                sb.Append("<div class='" + style + "'>");
                            }
                        }
                    }
                }

                List<int> wrapperdepth = new List<int>();
                sb.Append(GenerateBlockWrappers(pch, ref wrapperdepth));

                switch (mode)
                {
                    case 0:
                        sb.Append(ParseNormalBlocks(pch, lstWrapper));
                        break;
                    case 1:
                        sb.Append(ParseFixedBlocks(pch, lstWrapper));
                        break;
                }

                sb.Append(HtmlBuilder.GenerateBlockWrappersEnd(wrapperdepth));
                foreach (CustomWrapper start in lstWrapper)
                {
                    string pchName = Utils.GetAttributeValueByName(pch, XmlAttributeTypes.NAME).ToLower();
                    if (start.Type == "placeholder" && pchName.Equals(start.End))
                    {
                        for (int i = 1; i <= start.Depth; i++)
                        {
                            sb.Append("</div>");
                        }
                    }
                }
            }
            return sb.ToString();
        }
Esempio n. 2
0
        public List <XmlTag> GetXmlTags(string xmlFile, string startParseNode)
        {
            List <XmlTag> lstSectionNodes = new List <XmlTag>();
            XmlDocument   doc             = XmlHelper.LoadXMLDocument(xmlFile);
            XmlNodeList   sectionList     = doc.SelectNodes(startParseNode);

            foreach (XmlNode section in sectionList)
            {
                XmlTag tag = new XmlTag();
                tag.TagName        = section.Name;
                tag.TagType        = GetXmlTagType(section);
                tag.ChildNodeCount = GetChildNodeCount(section);
                tag.AttributeCount = GetAttributeCount(section);
                tag.LSTAttributes  = GetAttributesCollection(section);
                tag.LSTChildNodes  = section.ChildNodes.Count > 0 ? GetChildNodeCollection(section) : new List <XmlTag>();
                tag.CompleteTag    = BuildCompleteTag(tag);
                tag.PchArr         = GetPlaceholders(section);
                tag.Placeholders   = string.Join(",", tag.PchArr);
                if (ValidateTagType(tag))
                {
                    lstSectionNodes.Add(tag);
                }
            }
            doc.Save(xmlFile);
            return(lstSectionNodes);
        }
 /// <summary>
 /// Generates placeholder markup.
 /// </summary>
 /// <param name="Section">Section node.</param>
 /// <returns>Placeholder markup.</returns>
 public string GeneratePlaceHolderMarkup(XmlTag Section)
 {
     foreach (XmlTag tag in Section.LSTChildNodes)
     {
     }
     return "";
 }
Esempio n. 4
0
        public bool ValidateTagType(XmlTag tag)
        {
            bool exists;

            exists = Enum.IsDefined(typeof(XmlTagTypes), tag.TagType);
            return(exists);
        }
Esempio n. 5
0
        public List <XmlTag> GetChildNodeCollection(XmlNode node)
        {
            List <XmlTag> lstChildNodes = new List <XmlTag>();
            string        childNode     = "";

            if (node.ChildNodes.Count > 0)
            {
                childNode = node.ChildNodes[0].Name;
            }
            XmlNodeList xnList = node.SelectNodes(childNode);

            for (int i = 0; i < node.ChildNodes.Count; i++)
            {
                XmlTag tag = new XmlTag();
                tag.TagName        = node.ChildNodes[i].Name;
                tag.TagType        = GetXmlTagType(node.ChildNodes[i]);
                tag.InnerHtml      = Utils.CleanString(node.ChildNodes[i].InnerText);
                tag.AttributeCount = GetAttributeCount(node.ChildNodes[i]);
                tag.LSTAttributes  = GetAttributesCollection(node.ChildNodes[i]);
                tag.PositionsArr   = tag.InnerHtml.Split(',');
                tag.CompleteTag    = BuildCompleteTag(tag);
                if (ValidateTagType(tag))
                {
                    lstChildNodes.Add(tag);
                }
            }

            return(lstChildNodes);
        }
 public List<XmlTag> GetXmlTags(string xmlFile, string startParseNode)
 {
     List<XmlTag> lstSectionNodes = new List<XmlTag>();
     XmlDocument doc = XmlHelper.LoadXMLDocument(xmlFile);
     XmlNodeList sectionList = doc.SelectNodes(startParseNode);
     foreach (XmlNode section in sectionList)
     {
         XmlTag tag = new XmlTag();
         tag.TagName = section.Name;
         tag.TagType = GetXmlTagType(section);
         tag.ChildNodeCount = GetChildNodeCount(section);
         tag.AttributeCount = GetAttributeCount(section);
         tag.LSTAttributes = GetAttributesCollection(section);
         tag.LSTChildNodes = section.ChildNodes.Count > 0 ? GetChildNodeCollection(section) : new List<XmlTag>();
         tag.CompleteTag = BuildCompleteTag(tag);
         tag.PchArr = GetPlaceholders(section);
         tag.Placeholders = string.Join(",", tag.PchArr);
         if (ValidateTagType(tag))
         {
             lstSectionNodes.Add(tag);
         }
     }
     doc.Save(xmlFile);
     return lstSectionNodes;
 }
Esempio n. 7
0
        public string BuildCompleteTag(XmlTag tag)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(GetStartTag(tag));
            sb.Append(GetEndTag(tag));
            return(sb.ToString());
        }
        /// <summary>
        ///Obtain starting placeholder.
        ///1.Check for classes like no-wrap and no-main.
        ///2.Check for wrap-inner and main-inner classes.
        ///3.If Wrap-inner is not defined simply create a wrap class and a id from the key.
        ///4.Check for main inner and other wrappers.
        ///5.If we are using special markup tags this is the place to begin the markups.
        ///6.Generate main-inner wrappers if present.
        /// </summary>
        /// <param name="placeholder">Object of XmlTag class.</param>
        /// <returns>String format of placeholder markup.</returns>
        public static string GeneratePlaceholderStart(XmlTag placeholder)
        {


            StringBuilder sb = new StringBuilder();
            sb.Append(String.Format("<div id=\"id-{0}\" class=\"sf{1}\">", Utils.GetAttributeValueByName(placeholder, XmlAttributeTypes.NAME), Utils.GetAttributeValueByName(placeholder, XmlAttributeTypes.NAME)));
            return sb.ToString();
        }
Esempio n. 9
0
 public static XmlTag TagBuilder(string tagName, XmlTagTypes type, XmlAttributeTypes attType, string attName, string attValue, string innerHTML)
 {
     XmlTag tag = new XmlTag();
     tag.TagType = type;
     tag.TagName = tagName;
     tag.LSTAttributes = AddAttributes(attName, attValue, attType);
     tag.InnerHtml = innerHTML;
     return tag;
 }
Esempio n. 10
0
 public static bool IsSpotLight(XmlTag placeholder)
 {
     string pchName = Utils.GetAttributeValueByName(placeholder, XmlAttributeTypes.NAME);
     bool status = false;
     if (Utils.CompareStrings(pchName, "spotlight"))
     {
         status = true;
     }
     return status;
 }
Esempio n. 11
0
 public static bool HasBlock(Placeholders pch, XmlTag middleBlock)
 {
     bool status = false;
     status = middleBlock.LSTChildNodes.Exists(
         delegate(XmlTag tag)
         {
             return (Utils.CompareStrings(Utils.GetAttributeValueByName(tag, XmlAttributeTypes.NAME), pch));
         }
         );
     return status;
 }
Esempio n. 12
0
 public static string GetAttributeValueByName(XmlTag tag, XmlAttributeTypes _type)
 {
     string value = string.Empty;
     string name = _type.ToString();
     LayoutAttribute attr = new LayoutAttribute();
     attr = tag.LSTAttributes.Find(
         delegate(LayoutAttribute attObj)
         {
             return (Utils.CompareStrings(attObj.Name, name));
         }
         );
     return attr == null ? "" : attr.Value;
 }
        public static string GeneratePlaceholderStart(XmlTag placeholder)
        {
            //1.Check for classes like no-wrap and no-main
            //2.Check for wrap-inner and main-inner classes
            //3.If Wrap-inner is not defined simply create a wrap class and a id from the key
            //4.Check for main inner and other wrappers
            //5.If we are using special markup tags this is the place to begin the markups
            //6.Generate main-inner wrappers if present

            StringBuilder sb = new StringBuilder();
            sb.Append(String.Format("<div id=\"id-{0}\" class=\"sf{1}\">", Utils.GetAttributeValueByName(placeholder, XmlAttributeTypes.NAME), Utils.GetAttributeValueByName(placeholder, XmlAttributeTypes.NAME)));
            return sb.ToString();
        }
Esempio n. 14
0
        public string GetStartTag(XmlTag tag)
        {
            bool          hasAttribute = tag.LSTAttributes.Count > 0 ? true : false;
            StringBuilder sb           = new StringBuilder();

            if (hasAttribute)
            {
                sb.Append("<");
                sb.Append(Utils.CleanString(tag.TagName));
                sb.Append(GetAttributeString(tag.LSTAttributes));
                sb.Append(">");
            }
            else
            {
                sb.Append("<");
                sb.Append(Utils.CleanString(tag.TagName));
                sb.Append(">");
            }
            return(sb.ToString());
        }
Esempio n. 15
0
        public static bool IsCustomBlockDefined(XmlTag placeholder)
        {

            string activeTemplate = HttpContext.Current.Session["SageFrame.ActiveTemplate"] != null ? HttpContext.Current.Session["SageFrame.ActiveTemplate"].ToString() : "Default";
            string pchName = Utils.GetAttributeValueByName(placeholder, XmlAttributeTypes.NAME);
            string FilePath = HttpContext.Current.Server.MapPath("~/") + "//" + activeTemplate + "//sections";
            bool status = false;
            if (Directory.Exists(FilePath))
            {
                DirectoryInfo dir = new DirectoryInfo(FilePath);
                foreach (FileInfo file in dir.GetFiles("*.htm"))
                {
                    if (Utils.CompareStrings(Path.GetFileNameWithoutExtension(file.Name), pchName))
                    {
                        status = true;
                        break;
                    }
                }
            }
            return status;
        }
 /// <summary>
 /// Generates section markups.
 /// </summary>
 /// <param name="section">Section node.</param>
 /// <returns>Section markup.</returns>
 public string GenerateSectionMarkup(XmlTag section)
 {
     string markup = "";
     if (section.AttributeCount > 0)
     {
         foreach (LayoutAttribute attr in section.LSTAttributes)
         {
             switch (attr.Type)
             {
                 case XmlAttributeTypes.NAME:
                     markup = GetSectionMarkup(attr.Value, section);
                     break;
                 case XmlAttributeTypes.TYPE:
                     break;
                 case XmlAttributeTypes.SPLIT:
                     break;
             }
         }
     }
     return markup;
 }
        public string GetSectionMarkup(string name, XmlTag section)
        {
            string html = "";
            if (Enum.IsDefined(typeof(SectionTypes), name.ToUpper()))
            {
                SectionTypes _type = (SectionTypes)Enum.Parse(typeof(SectionTypes), name.ToUpper());


                switch (_type)
                {
                    case SectionTypes.TOP:
                        html = GetTopMarkup(section);
                        break;
                    case SectionTypes.MIDDLE:
                        html = GetMiddleWrapper(section);
                        break;
                    case SectionTypes.BOTTOM:
                        html = GetBottomMarkup(section);
                        break;

                }
            }
            return html;
        }
 /// <summary>
 /// Calculates the column width for the middle block
 /// Takes the ColumnWidth from the Parent Node which applies to right and left
 /// However the inline "width" attributes overrides the Parent's colwidth attribute
 /// </summary>
 /// <param name="section"></param>
 /// <param name="_type"></param>
 /// <returns></returns>
 public static string CalculateColumnWidth(XmlTag section, Placeholders _type)
 {
     string width = "20";
     foreach (XmlTag tag in section.LSTChildNodes)
     {
         if (Utils.CompareStrings(_type, Utils.GetAttributeValueByName(tag, XmlAttributeTypes.NAME)))
         {
             int widthIndex = -1;
             widthIndex = tag.LSTAttributes.FindIndex(
                 delegate(LayoutAttribute tagAttr)
                 {
                     return (Utils.CompareStrings(tagAttr.Name, XmlAttributeTypes.WIDTH));
                 }
                 );
             if (widthIndex > -1)
             {
                 width = tag.LSTAttributes[widthIndex].Value;
             }
             else
             {
                 foreach (LayoutAttribute attr in section.LSTAttributes)
                 {
                     if (Utils.CompareStrings(attr.Name, XmlAttributeTypes.WIDTH))
                     {
                         width = attr.Value;
                     }
                     else if (Utils.CompareStrings(attr.Name, XmlAttributeTypes.COLWIDTH))
                     {
                         width = attr.Value;
                     }
                 }
             }
         }
     }
     return width;
 }
Esempio n. 19
0
        public static List<KeyValue> CalculateMiddleBlockWidth(XmlTag middleBlock)
        {
            double left = 0.0, leftA = 0.0, leftB = 0.0;
            if (HasBlock(Placeholders.LEFTTOP, middleBlock) || HasBlock(Placeholders.LEFTBOTTOM, middleBlock) || (HasBlock(Placeholders.LEFTA, middleBlock) && HasBlock(Placeholders.LEFTB, middleBlock)))
            {
                if (HasBlock(Placeholders.LEFTA, middleBlock) && HasBlock(Placeholders.LEFTB, middleBlock))
                {
                    left = 2;
                    leftA = double.Parse(CalculateColumnWidth(middleBlock, Placeholders.LEFTA));
                    leftB = double.Parse(CalculateColumnWidth(middleBlock, Placeholders.LEFTB));
                }
                else if (HasBlock(Placeholders.LEFTA, middleBlock) && !HasBlock(Placeholders.LEFTB, middleBlock))
                {
                    left = 1;
                    leftA = double.Parse(CalculateColumnWidth(middleBlock, Placeholders.LEFTA));

                }
                else if (!HasBlock(Placeholders.LEFTA, middleBlock) && HasBlock(Placeholders.LEFTB, middleBlock))
                {
                    left = 1;
                    leftB = double.Parse(CalculateColumnWidth(middleBlock, Placeholders.LEFTB));
                }
            }
            else if (HasBlock(Placeholders.LEFTA, middleBlock))
            {
                left = 1;
                leftA = double.Parse(CalculateColumnWidth(middleBlock, Placeholders.LEFTA));
            }
            else if (HasBlock(Placeholders.LEFTB, middleBlock))
            {
                left = 1;
                leftB = double.Parse(CalculateColumnWidth(middleBlock, Placeholders.LEFTB));
            }

            double totalleft = left > 0 ? (leftA + leftB) / left : 0;

            double right = 0.0, rightA = 0.0, rightB = 0.0;
            if (HasBlock(Placeholders.RIGHTTOP, middleBlock) || HasBlock(Placeholders.RIGHTBOTTOM, middleBlock) || (HasBlock(Placeholders.RIGHTA, middleBlock) && HasBlock(Placeholders.RIGHTB, middleBlock)))
            {
                if (HasBlock(Placeholders.RIGHTA, middleBlock) && HasBlock(Placeholders.RIGHTB, middleBlock))
                {
                    right = 2;
                    rightA = double.Parse(CalculateColumnWidth(middleBlock, Placeholders.RIGHTA));
                    rightB = double.Parse(CalculateColumnWidth(middleBlock, Placeholders.RIGHTB));
                }
                else if (HasBlock(Placeholders.RIGHTA, middleBlock) && !HasBlock(Placeholders.RIGHTB, middleBlock))
                {
                    right = 1;
                    rightA = double.Parse(CalculateColumnWidth(middleBlock, Placeholders.RIGHTA));

                }
                else if (!HasBlock(Placeholders.RIGHTA, middleBlock) && HasBlock(Placeholders.RIGHTB, middleBlock))
                {
                    right = 1;

                    rightB = double.Parse(CalculateColumnWidth(middleBlock, Placeholders.RIGHTB));
                }
            }
            else if (HasBlock(Placeholders.RIGHTA, middleBlock))
            {
                right = 1;
                rightA = double.Parse(CalculateColumnWidth(middleBlock, Placeholders.RIGHTA));
            }
            else if (HasBlock(Placeholders.RIGHTB, middleBlock))
            {
                right = 1;
                rightB = double.Parse(CalculateColumnWidth(middleBlock, Placeholders.RIGHTB));
            }

            double totalright = right > 0 ? (rightA + rightB) / right : 0;
            double totalWidth = 100;
            rightA = (rightA * 100) / (totalright * right);
            rightA = rightA.ToString() == "NaN" ? 0 : rightA;
            rightB = totalWidth - rightA;
            rightB = rightB.ToString() == "NaN" ? 0 : rightB;

            double middle = totalWidth - totalright;
            middle = totalWidth - totalleft - totalright;

            //double leftWidth = (totalleft * 100) / (totalleft+middle);
            //double leftWidth=totalWidth-

            leftA = (leftA * 100) / (totalleft * left);
            leftA = leftA.ToString() == "NaN" ? 0 : leftA;
            leftB = totalWidth - leftA;
            leftB = leftB.ToString() == "NaN" ? 0 : leftB;
            middle = totalWidth - totalleft - totalright;

            // if (middle<100)
            // {
            //     middle = middle - 2;
            // }
            // leftA = leftA - 2;
            //leftB = leftB - 2;
            //rightA = rightA - 2;
            //rightB = rightB - 2;


            List<KeyValue> widthsKvp = new List<KeyValue>();
            widthsKvp.Add(new KeyValue("Left", totalleft.ToString()));
            widthsKvp.Add(new KeyValue("LeftA", leftA.ToString()));
            widthsKvp.Add(new KeyValue("LeftB", leftB.ToString()));
            widthsKvp.Add(new KeyValue("Right", totalright.ToString()));
            widthsKvp.Add(new KeyValue("RightA", rightA.ToString()));
            widthsKvp.Add(new KeyValue("RightB", rightB.ToString()));
            widthsKvp.Add(new KeyValue("Center", middle.ToString()));

            DecreaseWidthForAdjustment(ref widthsKvp);

            return widthsKvp;

        }
Esempio n. 20
0
 public static string GenerateMiddleBlockStart(XmlTag middleBlock)
 {
     StringBuilder sb = new StringBuilder();
     sb.Append(middleBlock.LSTChildNodes.Count == 0 ? GetMiddleWrapperBegin("100%") + GetMiddleDefaultBlock("100%") + GetMiddleWrapperEnd() : GetMiddleCustomMarkup(middleBlock));
     return sb.ToString();
 }
Esempio n. 21
0
        public static string GetMiddleCustomMarkup(XmlTag middleBlock)
        {
            List<KeyValue> widths = CalculateMiddleBlockWidth(middleBlock);
            StringBuilder sb = new StringBuilder();
            sb.Append(GetMiddleWrappersBegin());
            //Check for Left Blocks
            if (HasBlock(Placeholders.LEFTTOP, middleBlock) || HasBlock(Placeholders.LEFTBOTTOM, middleBlock) || (HasBlock(Placeholders.LEFTA, middleBlock) && HasBlock(Placeholders.LEFTB, middleBlock)))
            {
                if (HasBlock(Placeholders.LEFTTOP, middleBlock) && HasBlock(Placeholders.LEFTBOTTOM, middleBlock))
                {
                    if ((HasBlock(Placeholders.LEFTA, middleBlock) && HasBlock(Placeholders.LEFTB, middleBlock)))
                    {
                        //Every block is present on the left side
                        sb.Append(GetLeftBegin(widths[0].Value));
                        sb.Append(GetLeftTop());
                        sb.Append(GetLeftColsWrap(widths[1].Value, widths[2].Value, widths[0].Value));
                        sb.Append(GetLeftBottom());
                        sb.Append(GetLeftEnd());
                    }
                    else if (HasBlock(Placeholders.LEFTA, middleBlock) && !HasBlock(Placeholders.LEFTB, middleBlock))
                    {
                        sb.Append(GetLeftBegin(widths[0].Value));
                        sb.Append(GetLeftTop());
                        sb.Append(GetLeftA(widths[1].Value));
                        sb.Append(GetLeftBottom());
                        sb.Append(GetLeftEnd());
                    }
                    else if (!HasBlock(Placeholders.LEFTA, middleBlock) && HasBlock(Placeholders.LEFTB, middleBlock))
                    {
                        sb.Append(GetLeftBegin(widths[0].Value));
                        sb.Append(GetLeftTop());
                        sb.Append(GetLeftB(widths[2].Value));
                        sb.Append(GetLeftBottom());
                        sb.Append(GetLeftEnd());
                    }
                }
                else
                {
                    //Left Content Mass Blocks are not present
                    sb.Append(GetLeftBegin(widths[0].Value));
                    sb.Append(GetLeftColsWrap(widths[1].Value, widths[2].Value, widths[0].Value));
                    sb.Append(GetLeftEnd());
                }

            }
            else if (HasBlock(Placeholders.LEFTA, middleBlock))
            {
                if (HasBlock(Placeholders.LEFTTOP, middleBlock) && HasBlock(Placeholders.LEFTBOTTOM, middleBlock))
                {
                    //Every block is present on the left side
                    sb.Append(GetLeftBegin(widths[0].Value));
                    sb.Append(GetLeftTop());
                    sb.Append(GetLeftA(widths[1].Value));
                    sb.Append(GetLeftBottom());
                    sb.Append(GetLeftEnd());
                }
                else
                {
                    sb.Append(GetLeftBegin(widths[0].Value));
                    sb.Append(GetLeftA(widths[1].Value));
                    sb.Append(GetLeftEnd());
                }
            }
            else if (HasBlock(Placeholders.LEFTB, middleBlock))
            {
                if (HasBlock(Placeholders.LEFTTOP, middleBlock) && HasBlock(Placeholders.LEFTBOTTOM, middleBlock))
                {
                    //Every block is present on the left side
                    sb.Append(GetLeftBegin(widths[0].Value));
                    sb.Append(GetLeftTop());
                    sb.Append(GetLeftB(widths[2].Value));
                    sb.Append(GetLeftBottom());
                    sb.Append(GetLeftEnd());
                }
                else
                {
                    sb.Append(GetLeftBegin(widths[0].Value));
                    sb.Append(GetLeftB(widths[2].Value));
                    sb.Append(GetLeftEnd());
                }
            }

          


            //Check for Right Blocks
            if (HasBlock(Placeholders.RIGHTTOP, middleBlock) || HasBlock(Placeholders.RIGHTBOTTOM, middleBlock) || (HasBlock(Placeholders.RIGHTA, middleBlock) && HasBlock(Placeholders.RIGHTB, middleBlock)))
            {
                if (HasBlock(Placeholders.RIGHTTOP, middleBlock) && HasBlock(Placeholders.RIGHTBOTTOM, middleBlock))
                {
                    if (HasBlock(Placeholders.RIGHTA, middleBlock) && HasBlock(Placeholders.RIGHTB, middleBlock))
                    {
                        //Every block is present on the left side
                        sb.Append(GetRightBegin(widths[3].Value));
                        sb.Append(GetRightTop());
                        sb.Append(GetRightColsWrap(widths[4].Value, widths[5].Value, widths[3].Value));
                        sb.Append(GetRightBottom());
                        sb.Append(GetRightEnd());
                    }
                    else if (HasBlock(Placeholders.RIGHTA, middleBlock) && !HasBlock(Placeholders.RIGHTB, middleBlock))
                    {
                        sb.Append(GetRightBegin(widths[3].Value));
                        sb.Append(GetRightTop());
                        sb.Append(GetRightA(widths[4].Value));
                        sb.Append(GetRightBottom());
                        sb.Append(GetRightEnd());
                    }
                    else if (!HasBlock(Placeholders.RIGHTA, middleBlock) && HasBlock(Placeholders.RIGHTB, middleBlock))
                    {
                        sb.Append(GetRightBegin(widths[3].Value));
                        sb.Append(GetRightTop());
                        sb.Append(GetRightB(widths[5].Value));
                        sb.Append(GetRightBottom());
                        sb.Append(GetRightEnd());
                    }

                }
                else
                {
                    //Left Content Mass Blocks are not present
                    sb.Append(GetRightBegin(widths[3].Value));
                    sb.Append(GetRightColsWrap(widths[4].Value, widths[5].Value, widths[3].Value));
                    sb.Append(GetRightEnd());
                }

            }
            else if (HasBlock(Placeholders.RIGHTA, middleBlock))
            {

                if (HasBlock(Placeholders.RIGHTTOP, middleBlock) && HasBlock(Placeholders.RIGHTBOTTOM, middleBlock))
                {
                    //Every block is present on the Right side
                    sb.Append(GetRightBegin(widths[3].Value));
                    sb.Append(GetRightTop());
                    sb.Append(GetRightA(widths[4].Value));
                    sb.Append(GetRightBottom());
                    sb.Append(GetRightEnd());
                }
                else
                {
                    sb.Append(GetRightBegin(widths[3].Value));
                    sb.Append(GetRightA(widths[4].Value));
                    sb.Append(GetRightEnd());
                }
            }
            else if (HasBlock(Placeholders.RIGHTB, middleBlock))
            {
                if (HasBlock(Placeholders.RIGHTTOP, middleBlock) && HasBlock(Placeholders.RIGHTBOTTOM, middleBlock))
                {
                    //Every block is present on the Right side
                    sb.Append(GetRightBegin(widths[3].Value));
                    sb.Append(GetRightTop());
                    sb.Append(GetRightB(widths[5].Value));
                    sb.Append(GetRightBottom());
                    sb.Append(GetRightEnd());
                }
                else
                {
                    sb.Append(GetRightBegin(widths[3].Value));
                    sb.Append(GetRightA(widths[5].Value));
                    sb.Append(GetRightEnd());
                }
            }

           


            //Create the default Middle Block
            sb.Append(GetMiddleWrapperBegin(widths[6].Value));

            if (HasBlock(Placeholders.CONTENTTOP, middleBlock) || HasBlock(Placeholders.CONTENTBOTTOM, middleBlock))
            {
                if (HasBlock(Placeholders.CONTENTTOP, middleBlock) && HasBlock(Placeholders.CONTENTBOTTOM, middleBlock))
                {
                    //Has outer top and bottom
                    sb.Append(GetMiddleTopContent());
                    sb.Append(GetMiddleMainContentBegin());
                    if (HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {
                        sb.Append(GetMiddleMainTop());
                        sb.Append(GetMiddleMainCurrent());
                        sb.Append(GetMiddleMainBottom());
                    }
                    else if (HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && !HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {
                        sb.Append(GetMiddleMainTop());
                        sb.Append(GetMiddleMainCurrent());

                    }
                    else if (!HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {

                        sb.Append(GetMiddleMainCurrent());
                        sb.Append(GetMiddleMainBottom());
                    }
                    else if (!HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && !HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {

                        sb.Append(GetMiddleMainCurrent());

                    }
                    sb.Append(GetMiddleMainContentEnd());
                    sb.Append(GetMiddleBottomContent());
                }
                else if (HasBlock(Placeholders.CONTENTTOP, middleBlock) && !HasBlock(Placeholders.CONTENTBOTTOM, middleBlock))
                {
                    sb.Append(GetMiddleTopContent());
                    sb.Append(GetMiddleMainContentBegin());
                    if (HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {
                        sb.Append(GetMiddleMainTop());
                        sb.Append(GetMiddleMainCurrent());
                        sb.Append(GetMiddleMainBottom());
                    }
                    else if (HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && !HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {
                        sb.Append(GetMiddleMainTop());
                        sb.Append(GetMiddleMainCurrent());

                    }
                    else if (!HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {

                        sb.Append(GetMiddleMainCurrent());
                        sb.Append(GetMiddleMainBottom());
                    }
                    else if (!HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && !HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {

                        sb.Append(GetMiddleMainCurrent());

                    }
                    sb.Append(GetMiddleMainContentEnd());
                }
                else if (!HasBlock(Placeholders.CONTENTTOP, middleBlock) && HasBlock(Placeholders.CONTENTBOTTOM, middleBlock))
                {

                    sb.Append(GetMiddleMainContentBegin());
                    if (HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {
                        sb.Append(GetMiddleMainTop());
                        sb.Append(GetMiddleMainCurrent());
                        sb.Append(GetMiddleMainBottom());
                    }
                    else if (HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && !HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {
                        sb.Append(GetMiddleMainTop());
                        sb.Append(GetMiddleMainCurrent());

                    }
                    else if (!HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {

                        sb.Append(GetMiddleMainCurrent());
                        sb.Append(GetMiddleMainBottom());
                    }
                    else if (!HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && !HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {

                        sb.Append(GetMiddleMainCurrent());

                    }
                    sb.Append(GetMiddleMainContentEnd());
                    sb.Append(GetMiddleBottomContent());
                }
                else if (!HasBlock(Placeholders.CONTENTTOP, middleBlock) && !HasBlock(Placeholders.CONTENTBOTTOM, middleBlock))
                {

                    sb.Append(GetMiddleMainContentBegin());
                    if (HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {
                        sb.Append(GetMiddleMainTop());
                        sb.Append(GetMiddleMainCurrent());
                        sb.Append(GetMiddleMainBottom());
                    }
                    else if (HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && !HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {
                        sb.Append(GetMiddleMainTop());
                        sb.Append(GetMiddleMainCurrent());

                    }
                    else if (!HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {

                        sb.Append(GetMiddleMainCurrent());
                        sb.Append(GetMiddleMainBottom());
                    }
                    else if (!HasBlock(Placeholders.CONTENTMAINTOP, middleBlock) && !HasBlock(Placeholders.CONTENTMAINBOTTOM, middleBlock))
                    {

                        sb.Append(GetMiddleMainCurrent());

                    }
                    sb.Append(GetMiddleMainContentEnd());

                }


            }
            else
            {
                //Generate Default Middle Block
                sb.Append(GetMiddleDefaultBlock(widths[6].Value));
            }

            sb.Append(GetMiddleWrapperEnd());
            sb.Append(EndSingleDiv());
            return sb.ToString();


        }
        static string ParseNormalLeftRightBlocks(XmlTag placeholder, List<CustomWrapper> lstWrapper)
        {

            StringBuilder sb = new StringBuilder();
            string positions = placeholder.InnerHtml;
            string[] positionsAr = positions.Split(',');
            bool fullWidth = Utils.GetAttributeValueByName(placeholder, XmlAttributeTypes.WIDTH) == "" ? true : false;
            string[] arrWidth = (Utils.GetAttributeValueByName(placeholder, XmlAttributeTypes.WIDTH) == "" ? "100" : Utils.GetAttributeValueByName(placeholder, XmlAttributeTypes.WIDTH)).Split(',');
            if (positionsAr.Length > 1)
            {
                sb.Append(Mode == 2 ? "<div class='sfMoreblocks clearfix'>" : "<div class='sfMoreblocks sfCurve clearfix'>");
            }
            for (int i = 0; i < positionsAr.Length; i++)
            {
                string style = "";               
                foreach (CustomWrapper start in lstWrapper)
                {
                    if (start.Type == "position")
                    {
                        List<KeyValue> lstWidths = new List<KeyValue>();
                        int wrapperwidth = Calculator.CalculateWrapperWidth(positionsAr, arrWidth, start.LSTPositions.ToArray(), "normal", out lstWidths);

                        if (start.Start.ToLower() == positionsAr[i])
                        {
                            string divwidth = string.Format("{0}%", (wrapperwidth).ToString());
                            for (int j = 1; j <= start.Depth; j++)
                            {
                                if (j == 1)
                                {
                                    string wrapstyle = start.Depth > 1 ? string.Format("sfWrap sfInnerwrap{0}{1}", start.Index, start.Class == "" ? "" : string.Format(" {0}", start.Class)) : string.Format("sfWrap sfInnerwrap{0}{1} clearfix", start.Index, start.Class == "" ? "" : string.Format(" {0}", start.Class));
                                    string floatstyle = divwidth == "100%" ? string.Format("width:{0}", divwidth) : string.Format("width:{0};float:left", divwidth);
                                    sb.Append("<div style='" + floatstyle + "' class='" + wrapstyle + "'>");
                                }
                                else
                                {
                                    string multiplewrappers = start.Depth == j ? string.Format("sfWrap {0} sf{1} clearfix", start.Class, j) : string.Format("sfWrap {0} sf{1}", start.Class == "" ? "" : string.Format(" {0}", start.Class), j);
                                    string floatstyle = divwidth == "100%" ? string.Format("width:{0}", divwidth) : string.Format("width:{0};float:left", divwidth);
                                    sb.Append("<div style='" + floatstyle + "' class='" + multiplewrappers + "'>");
                                }
                            }
                        }
                        if (start.LSTPositions.Contains(positionsAr[i]))
                        {
                            int width = Calculator.CalculatePostWrapWidth(start.LSTPositions.ToArray(), positionsAr[i], wrapperwidth, "normal", lstWidths);
                            style = Mode == 0 ? string.Format("width:{0}%;float:left", width) : width == 100 ? "float:left" : string.Format("width:{0}%;float:left", width);

                        }
                    }

                }
                string customStyle = Utils.GetAttributeValueByName(placeholder, XmlAttributeTypes.MINHEIGHT) == "" ? string.Format("{0}", style) : string.Format("{0};min-height:{1}px", style, Utils.GetAttributeValueByName(placeholder, XmlAttributeTypes.MINHEIGHT));
                if (customStyle != "")
                {
                    string id = string.Format("sf{0}", Utils.UppercaseFirst(positionsAr[i]));
                    sb.Append("<div id=" + id + " style='" + customStyle + "'>");
                }
                sb.Append(Mode == 2 ? "<div class='sfWrapper'>" : "<div class='sfWrapper sfCurve'>");
                //sb.Append(positionsAr[i]);
                sb.Append(HtmlBuilder.AddPlaceholder(positionsAr[i], Mode));
                sb.Append("</div>");
                if (customStyle != "")
                    sb.Append("</div>");

                if (arrWidth.Length == i)
                {
                    //sb.Append("<div class='clearfix'></div>");
                }
                foreach (CustomWrapper start in lstWrapper)
                {
                    if (start.End.ToLower() == positionsAr[i] && start.Type == "position")
                    {
                        for (int j = 1; j <= start.Depth; j++)
                        {
                            sb.Append("</div>");
                        }
                    }
                }
            }
            if (positionsAr.Length > 1)
            {
                sb.Append("</div>");
            }
            return sb.ToString();
        }
Esempio n. 23
0
 public static bool IsValidTag(XmlTag tag)
 {
     return(Enum.IsDefined(typeof(XmlTagTypes),tag.TagName.ToUpper())); 
 }
 /// <summary>
 /// Returns bottom markup.
 /// </summary>
 /// <param name="section">Section node.</param>
 /// <returns>Bottom markup.</returns>
 public string GetBottomMarkup(XmlTag section)
 {
     StringBuilder sb = new StringBuilder();
     sb.Append(LayoutControlBuilder.GetBottomBlocks(section));
     return sb.ToString();
 }
        public static string GenerateBlockWrappers(XmlTag pch, ref List<int> wrapperdepth)
        {
            StringBuilder sb = new StringBuilder();
            int wrapinner = int.Parse(Utils.GetAttributeValueByName(pch, XmlAttributeTypes.WRAPINNER, "1"));
            int wrapouter = int.Parse(Utils.GetAttributeValueByName(pch, XmlAttributeTypes.WRAPOUTER, "1"));
            string customclass = Utils.GetAttributeValueByName(pch, XmlAttributeTypes.CLASS);
            wrapperdepth.Add(wrapouter);
            wrapperdepth.Add(wrapinner);
            if (wrapouter != 0)
            {
                for (int i = 1; i <= wrapouter; i++)
                {
                    if (i == 1)
                    {
                        string wrapperclass = wrapouter > 1 ? "sfOuterwrapper" : "sfOuterwrapper clearfix";
                        wrapperclass = customclass != "" ? string.Format("{0} {1}", wrapperclass, customclass) : wrapperclass;
                        sb.Append(string.Format("<div id='sf{0}' class='{1}'>", Utils.UppercaseFirst(Utils.GetAttributeValueByName(pch, XmlAttributeTypes.NAME)), wrapperclass));
                    }
                    else
                    {
                        string wrapperclass = wrapouter == i ? string.Format("sfOuterwrapper{0} clearfix", i - 1) : string.Format("sfOuterwrapper{0}", i - 1);
                        wrapperclass = customclass != "" ? string.Format("{0} {1}", wrapperclass, customclass) : wrapperclass;
                        sb.Append(string.Format("<div class='{0}'>", wrapperclass));
                    }

                }
            }
            else if (wrapouter == 0)
            {
                sb.Append(string.Format("<div id='sf{0}'>", Utils.UppercaseFirst(Utils.GetAttributeValueByName(pch, XmlAttributeTypes.NAME))));
            }
            if (wrapinner != 0)
            {
                for (int i = 1; i <= wrapinner; i++)
                {
                    if (i == 1)
                    {
                        string wrapperclass = wrapinner > 1 ? "sfInnerwrapper" : "sfInnerwrapper clearfix";
                        sb.Append(string.Format("<div class='{0}'>", wrapperclass));
                    }
                    else
                    {
                        string wrapperclass = wrapinner == i ? string.Format("sfInnerwrapper{0} clearfix", i - 1) : string.Format("sfInnerwrapper{0}", i - 1);
                        sb.Append(string.Format("<div class='{0}'>", wrapperclass));
                    }

                }
            }



            return sb.ToString();
        }
        /// <summary>
        /// Returns middle wrapper.
        /// </summary>
        /// <param name="section">Section name.</param>
        /// <returns>Middle wrapper.</returns>
        public string GetMiddleWrapper(XmlTag section)
        {
            StringBuilder sb = new StringBuilder();

            string layout = LayoutControlBuilder.GenerateMiddleBlockStart(section);
            sb.Append(layout);
            return sb.ToString();
        }
        public static string ProcessLeftRightPlaceholders(Placeholders placeholder, XmlTag middleblock, List<CustomWrapper> lstWrapper, int _Mode,string Width)
        {
            Mode = _Mode;
            StringBuilder sb = new StringBuilder();
            bool isAvailable = false;
            foreach (XmlTag pch in middleblock.LSTChildNodes)
            {
                if (Utils.GetAttributeValueByName(pch, XmlAttributeTypes.NAME).ToLower() == placeholder.ToString().ToLower())
                {
                    foreach (CustomWrapper start in lstWrapper)
                    {
                        if (start.Type == "placeholder" && Utils.GetAttributeValueByName(pch, XmlAttributeTypes.NAME).ToLower().Equals(start.Start))
                        {
                            string style = "";
                            for (int i = 1; i <= start.Depth; i++)
                            {
                                if (i == 1)
                                {
                                    style = start.Depth > 1 ? string.Format("sfBlockwrap {0}", start.Class) : string.Format("sfBlockwrap {0} clearfix", start.Class);
                                    sb.Append("<div class='" + style + "'>");
                                }
                                else
                                {
                                    style = start.Depth == i ? string.Format("sfBlockwrap {0} sf{1} clearfix", start.Class, i) : string.Format("sfBlockwrap {0} sf{1}", start.Class, i);
                                    sb.Append("<div class='" + style + "'>");
                                }
                            }

                        }
                    }

                    string[] positions = pch.InnerHtml.Split(',');
                    int mode = Utils.GetAttributeValueByName(pch, XmlAttributeTypes.MODE) == "" ? 0 : 1;
                    string wrapperclass = string.Format("sf{0} clearfix", Utils.UppercaseFirst(Utils.GetAttributeValueByName(pch, XmlAttributeTypes.NAME)));                                            
                    wrapperclass = string.Format("{0} {1}", wrapperclass, Utils.GetAttributeValueByName(pch, XmlAttributeTypes.CLASS));
                    string colwidth = string.Format("class='{0}' style='width:{1}'",wrapperclass,Width);
                    sb.Append("<div "+colwidth+">");
                    switch (mode)
                    {
                        case 0:
                            sb.Append(ParseNormalLeftRightBlocks(pch, lstWrapper));
                            break;
                        case 1:
                            sb.Append(ParseFixedBlocks(pch, lstWrapper));
                            break;
                    }
                    sb.Append("</div>");
                    foreach (CustomWrapper start in lstWrapper)
                    {
                        string pchName = Utils.GetAttributeValueByName(pch, XmlAttributeTypes.NAME).ToLower();
                        if (start.Type == "placeholder" && pchName.Equals(start.End))
                        {
                            for (int i = 1; i <= start.Depth; i++)
                            {
                                sb.Append("</div>");
                            }
                        }
                    }
                    isAvailable = true;
                }

            }
            if (!isAvailable)
            {
                sb.Append(Mode == 2 ? "<div class='" + placeholder.ToString().ToLower() + "'><div class='sfWrapper'>" : "<div class='" + placeholder.ToString().ToLower() + "'><div class='sfWrapper sfCurve'>");
                sb.Append(HtmlBuilder.AddPlaceholder(placeholder.ToString().ToLower(), Mode));
                sb.Append("</div></div>");
            }

            return sb.ToString();
        }
Esempio n. 28
0
 /// <summary>
 /// Obtain inner HTML tag.
 /// </summary>
 /// <param name="pch">Placeholders.<see cref="T:SageFrame.Templating.Placeholders"/></param>
 /// <param name="middleBlock"></param>
 /// <returns></returns>
 public static string GetTagInnerHtml(Placeholders pch, XmlTag middleBlock)
 {
     XmlTag currentTag = new XmlTag();
     currentTag = middleBlock.LSTChildNodes.Find(
         delegate(XmlTag tag)
         {
             return (Utils.CompareStrings(Utils.GetAttributeValueByName(tag, XmlAttributeTypes.NAME), pch));
         }
         );
     return currentTag.InnerHtml;
 }
Esempio n. 29
0
 public string GetEndTag(XmlTag tag)
 {
     return("</" + tag.TagName + ">");
 }
Esempio n. 30
0
 public static string GetBottomBlockMarkupCustom(XmlTag section)
 {
     StringBuilder sb = new StringBuilder();
     foreach (XmlTag placeholder in section.LSTChildNodes)
     {
         if (IsCustomBlockDefined(placeholder))
         {
             sb.Append(ParseCustomBlocks(placeholder));
         }
         else
         {
             if (IsSpotLight(placeholder))
             {
                 sb.Append(ParseSpotlight(placeholder));
             }
             else
             {
                 string id = "sf" + UppercaseFirst(GetAttributeValueByName(placeholder, XmlAttributeTypes.NAME));
                 sb.Append("<div id='" + id + "' class='sfOuterwrapper sfCurve'>");
                 sb.Append(GetCommonWrapper(placeholder.InnerHtml));
                 sb.Append("</div>");
             }
         }
     }
     return sb.ToString();
 }
Esempio n. 31
0
 public static string GetBottomBlocks(XmlTag BottomBlock)
 {
     StringBuilder sb = new StringBuilder();
     sb.Append(BottomBlock.LSTChildNodes.Count == 0 ? GetBottomBlockMarkupDefault() : GetBottomBlockMarkupCustom(BottomBlock));
     return sb.ToString();
 }
Esempio n. 32
0
        public static string GetMiddleCustomMarkup(XmlTag middleBlock,List<CustomWrapper> lstWrapper,int Mode)
        {
            List<KeyValue> widths = Calculator.CalculateMiddleBlockWidth(middleBlock);
            StringBuilder sb = new StringBuilder();
            sb.Append(HtmlBuilder.GetMiddleWrappersBegin());
            if (Decide.HasBlock(Placeholders.FULLTOPSPAN, middleBlock))
            {
                sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.FULLTOPSPAN, middleBlock,lstWrapper,Mode));
            }
            //Check for Left Blocks
            foreach (CustomWrapper start in lstWrapper)
            {
                if (start.Type == "placeholder" && start.Start == "left")
                {
                    string style = "";
                    for (int i = 1; i <= start.Depth; i++)
                    {
                        if (i == 1)
                        {
                            style = start.Depth > 1 ? string.Format("sfBlockwrap {0}", start.Class) : string.Format("sfBlockwrap {0} clearfix", start.Class);
                            sb.Append("<div class='" + style + "'>");
                        }
                        else
                        {
                            style = start.Depth == i ? string.Format("sfBlockwrap {0} sf{1} clearfix", start.Class, i) : string.Format("sfBlockwrap {0} sf{1}", start.Class, i);
                            sb.Append("<div class='" + style + "'>");
                        }
                    }

                }
            }
            if (Decide.HasBlock(Placeholders.LEFTTOP, middleBlock) || Decide.HasBlock(Placeholders.LEFTBOTTOM, middleBlock) || (Decide.HasBlock(Placeholders.LEFTA, middleBlock) && Decide.HasBlock(Placeholders.LEFTB, middleBlock)))
            {
                if (Decide.HasBlock(Placeholders.LEFTTOP, middleBlock) && Decide.HasBlock(Placeholders.LEFTBOTTOM, middleBlock))
                {
                    if ((Decide.HasBlock(Placeholders.LEFTA, middleBlock) && Decide.HasBlock(Placeholders.LEFTB, middleBlock)))
                    {
                        //Every block is present on the left side
                        sb.Append(HtmlBuilder.GetLeftBegin(widths[0].Value));
                        sb.Append(HtmlBuilder.GetLeftTop(Mode));
                        sb.Append(HtmlBuilder.GetLeftColsWrap(widths[1].Value, widths[2].Value, widths[0].Value,Mode));
                        sb.Append(HtmlBuilder.GetLeftBottom(Mode));
                        sb.Append(HtmlBuilder.GetLeftEnd());
                    }
                    else if (Decide.HasBlock(Placeholders.LEFTA, middleBlock) && !Decide.HasBlock(Placeholders.LEFTB, middleBlock))
                    {
                        sb.Append(HtmlBuilder.GetLeftBegin(widths[0].Value));
                        sb.Append(HtmlBuilder.GetLeftTop(Mode));
                        sb.Append(HtmlBuilder.GetLeftA(widths[1].Value, Mode));
                        sb.Append(HtmlBuilder.GetLeftBottom(Mode));
                        sb.Append(HtmlBuilder.GetLeftEnd());
                    }
                    else if (!Decide.HasBlock(Placeholders.LEFTA, middleBlock) && Decide.HasBlock(Placeholders.LEFTB, middleBlock))
                    {
                        sb.Append(HtmlBuilder.GetLeftBegin(widths[0].Value));
                        sb.Append(HtmlBuilder.GetLeftTop(Mode));
                        sb.Append(HtmlBuilder.GetLeftB(widths[2].Value, Mode));
                        sb.Append(HtmlBuilder.GetLeftBottom(Mode));
                        sb.Append(HtmlBuilder.GetLeftEnd());
                    }
                }
                else
                {
                    //Left Content Mass Blocks are not present
                    sb.Append(HtmlBuilder.GetLeftBegin(widths[0].Value));
                    sb.Append(HtmlBuilder.GetLeftColsWrap(widths[1].Value, widths[2].Value, widths[0].Value, Mode));
                    sb.Append(HtmlBuilder.GetLeftEnd());
                }

            }
            else if (Decide.HasBlock(Placeholders.LEFTA, middleBlock))
            {
                if (Decide.HasBlock(Placeholders.LEFTTOP, middleBlock) && Decide.HasBlock(Placeholders.LEFTBOTTOM, middleBlock))
                {
                    //Every block is present on the left side
                    sb.Append(HtmlBuilder.GetLeftBegin(widths[0].Value));
                    sb.Append(HtmlBuilder.GetLeftTop(Mode));
                    sb.Append(HtmlBuilder.GetLeftA(widths[1].Value, Mode));
                    sb.Append(HtmlBuilder.GetLeftBottom(Mode));
                    sb.Append(HtmlBuilder.GetLeftEnd());
                }
                else
                {
                    sb.Append(HtmlBuilder.GetLeftBegin(widths[0].Value));
                    sb.Append(HtmlBuilder.GetLeftA(widths[1].Value, Mode));
                    sb.Append(HtmlBuilder.GetLeftEnd());
                }
            }
            else if (Decide.HasBlock(Placeholders.LEFTB, middleBlock))
            {
                if (Decide.HasBlock(Placeholders.LEFTTOP, middleBlock) && Decide.HasBlock(Placeholders.LEFTBOTTOM, middleBlock))
                {
                    //Every block is present on the left side
                    sb.Append(HtmlBuilder.GetLeftBegin(widths[0].Value));
                    sb.Append(HtmlBuilder.GetLeftTop(Mode));
                    sb.Append(HtmlBuilder.GetLeftB(widths[2].Value, Mode));
                    sb.Append(HtmlBuilder.GetLeftBottom(Mode));
                    sb.Append(HtmlBuilder.GetLeftEnd());
                }
                else
                {
                    sb.Append(HtmlBuilder.GetLeftBegin(widths[0].Value));
                    sb.Append(HtmlBuilder.GetLeftB(widths[2].Value, Mode));
                    sb.Append(HtmlBuilder.GetLeftEnd());
                }
            }

            foreach (CustomWrapper start in lstWrapper)
            {
                if (start.Type == "placeholder" && start.End == "left")
                {

                    for (int i = 1; i <= start.Depth; i++)
                    {
                        sb.Append("</div>");
                    }

                }
            }


            //Check for Right Blocks
            foreach (CustomWrapper start in lstWrapper)
            {
                if (start.Type == "placeholder" && start.Start == "right")
                {
                    string style = "";
                    for (int i = 1; i <= start.Depth; i++)
                    {
                        if (i == 1)
                        {
                            style = start.Depth > 1 ? string.Format("sfBlockwrap {0}", start.Class) : string.Format("sfBlockwrap {0} clearfix", start.Class);
                            sb.Append("<div class='" + style + "'>");
                        }
                        else
                        {
                            style = start.Depth == i ? string.Format("sfBlockwrap {0} sf{1} clearfix", start.Class, i) : string.Format("sfBlockwrap {0} sf{1}", start.Class, i);
                            sb.Append("<div class='" + style + "'>");
                        }
                    }

                }
            }
            if (Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) || Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock) || (Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && Decide.HasBlock(Placeholders.RIGHTB, middleBlock)))
            {
                if (Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) && Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock))
                {
                    if (Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
                    {
                        //Every block is present on the left side
                        sb.Append(HtmlBuilder.GetRightBegin(widths[3].Value));
                        sb.Append(HtmlBuilder.GetRightTop(Mode));
                        sb.Append(HtmlBuilder.GetRightColsWrap(widths[4].Value, widths[5].Value, widths[3].Value, Mode));
                        sb.Append(HtmlBuilder.GetRightBottom(Mode));
                        sb.Append(HtmlBuilder.GetRightEnd());
                    }
                    else if (Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && !Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
                    {
                        sb.Append(HtmlBuilder.GetRightBegin(widths[3].Value));
                        sb.Append(HtmlBuilder.GetRightTop(Mode));
                        sb.Append(HtmlBuilder.GetRightA(widths[4].Value,Mode));
                        sb.Append(HtmlBuilder.GetRightBottom(Mode));
                        sb.Append(HtmlBuilder.GetRightEnd());
                    }
                    else if (!Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
                    {
                        sb.Append(HtmlBuilder.GetRightBegin(widths[3].Value));
                        sb.Append(HtmlBuilder.GetRightTop(Mode));
                        sb.Append(HtmlBuilder.GetRightB(widths[5].Value, Mode));
                        sb.Append(HtmlBuilder.GetRightBottom(Mode));
                        sb.Append(HtmlBuilder.GetRightEnd());
                    }

                }
                else
                {
                    //Left Content Mass Blocks are not present
                    sb.Append(HtmlBuilder.GetRightBegin(widths[3].Value));
                    sb.Append(HtmlBuilder.GetRightColsWrap(widths[4].Value, widths[5].Value, widths[3].Value, Mode));
                    sb.Append(HtmlBuilder.GetRightEnd());
                }

            }
            else if (Decide.HasBlock(Placeholders.RIGHTA, middleBlock))
            {

                if (Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) && Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock))
                {
                    //Every block is present on the Right side
                    sb.Append(HtmlBuilder.GetRightBegin(widths[3].Value));
                    sb.Append(HtmlBuilder.GetRightTop(Mode));
                    sb.Append(HtmlBuilder.GetRightA(widths[4].Value, Mode));
                    sb.Append(HtmlBuilder.GetRightBottom(Mode));
                    sb.Append(HtmlBuilder.GetRightEnd());
                }
                else
                {
                    sb.Append(HtmlBuilder.GetRightBegin(widths[3].Value));
                    sb.Append(HtmlBuilder.GetRightA(widths[4].Value, Mode));
                    sb.Append(HtmlBuilder.GetRightEnd());
                }
            }
            else if (Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
            {
                if (Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) && Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock))
                {
                    //Every block is present on the Right side
                    sb.Append(HtmlBuilder.GetRightBegin(widths[3].Value));
                    sb.Append(HtmlBuilder.GetRightTop(Mode));
                    sb.Append(HtmlBuilder.GetRightB(widths[5].Value, Mode));
                    sb.Append(HtmlBuilder.GetRightBottom(Mode));
                    sb.Append(HtmlBuilder.GetRightEnd());
                }
                else
                {
                    sb.Append(HtmlBuilder.GetRightBegin(widths[3].Value));
                    sb.Append(HtmlBuilder.GetRightA(widths[5].Value, Mode));
                    sb.Append(HtmlBuilder.GetRightEnd());
                }
            }
            foreach (CustomWrapper start in lstWrapper)
            {
                if (start.Type == "placeholder" && start.End == "right")
                {

                    for (int i = 1; i <= start.Depth; i++)
                    {
                        sb.Append("</div>");
                    }
                }
            }


            //Create the default Middle Block
            foreach (CustomWrapper start in lstWrapper)
            {
                if (start.Type == "placeholder" && start.Start == "middle")
                {
                    string style = "";
                    for (int i = 1; i <= start.Depth; i++)
                    {
                        if (i == 1)
                        {
                            style = start.Depth > 1 ? string.Format("sfBlockwrap {0}", start.Class) : string.Format("sfBlockwrap {0} clearfix", start.Class);
                            sb.Append("<div class='" + style + "'>");
                        }
                        else
                        {
                            style = start.Depth == i ? string.Format("sfBlockwrap {0} sf{1} clearfix", start.Class, i) : string.Format("sfBlockwrap {0} sf{1}", start.Class, i);
                            sb.Append("<div class='" + style + "'>");
                        }
                    }

                }
            }
            sb.Append(HtmlBuilder.GetMiddleWrapperBegin(widths[6].Value));

            if (Decide.HasBlock(Placeholders.MIDDLETOP, middleBlock) || Decide.HasBlock(Placeholders.MIDDLEBOTTOM, middleBlock) || 1 == 1)
            {
                if (Decide.HasBlock(Placeholders.MIDDLETOP, middleBlock) && Decide.HasBlock(Placeholders.MIDDLEBOTTOM, middleBlock))
                {
                    //Has outer top and bottom
                    sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLETOP, middleBlock,lstWrapper,Mode));
                    sb.Append(HtmlBuilder.GetMiddleMainContentBegin());
                    if (Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINTOP, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINBOTTOM, middleBlock, lstWrapper, Mode));
                    }
                    else if (Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && !Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINTOP, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));

                    }
                    else if (!Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {

                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINBOTTOM, middleBlock, lstWrapper, Mode));
                    }
                    else if (!Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && !Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {

                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));

                    }
                    sb.Append(HtmlBuilder.GetMiddleMainContentEnd());
                    sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEBOTTOM, middleBlock, lstWrapper, Mode));
                }
                else if (Decide.HasBlock(Placeholders.MIDDLETOP, middleBlock) && !Decide.HasBlock(Placeholders.MIDDLEBOTTOM, middleBlock))
                {
                    sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLETOP, middleBlock, lstWrapper, Mode));
                    sb.Append(HtmlBuilder.GetMiddleMainContentBegin());
                    if (Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINTOP, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINBOTTOM, middleBlock, lstWrapper, Mode));
                    }
                    else if (Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && !Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINTOP, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));

                    }
                    else if (!Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {

                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINBOTTOM, middleBlock, lstWrapper, Mode));
                    }
                    else if (!Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && !Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {

                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));

                    }
                    sb.Append(HtmlBuilder.GetMiddleMainContentEnd());
                }
                else if (!Decide.HasBlock(Placeholders.MIDDLETOP, middleBlock) && Decide.HasBlock(Placeholders.MIDDLEBOTTOM, middleBlock))
                {

                    sb.Append(HtmlBuilder.GetMiddleMainContentBegin());
                    if (Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINTOP, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINBOTTOM, middleBlock, lstWrapper, Mode));
                    }
                    else if (Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && !Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINTOP, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));

                    }
                    else if (!Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {

                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINBOTTOM, middleBlock, lstWrapper, Mode));
                    }
                    else if (!Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && !Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {

                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));

                    }
                    sb.Append(HtmlBuilder.GetMiddleMainContentEnd());
                    sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEBOTTOM, middleBlock, lstWrapper, Mode));
                }
                else if (!Decide.HasBlock(Placeholders.MIDDLETOP, middleBlock) && !Decide.HasBlock(Placeholders.MIDDLEBOTTOM, middleBlock))
                {

                    sb.Append(HtmlBuilder.GetMiddleMainContentBegin());
                    if (Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINTOP, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINBOTTOM, middleBlock, lstWrapper, Mode));
                    }
                    else if (Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && !Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINTOP, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));

                    }
                    else if (!Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {

                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));
                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINBOTTOM, middleBlock, lstWrapper, Mode));
                    }
                    else if (!Decide.HasBlock(Placeholders.MIDDLEMAINTOP, middleBlock) && !Decide.HasBlock(Placeholders.MIDDLEMAINBOTTOM, middleBlock))
                    {

                        sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.MIDDLEMAINCURRENT, middleBlock, lstWrapper, Mode));

                    }
                    sb.Append(HtmlBuilder.GetMiddleMainContentEnd());


                }
                foreach (CustomWrapper start in lstWrapper)
                {
                    if (start.Type == "placeholder" && start.End == "middle")
                    {

                        for (int i = 1; i <= start.Depth; i++)
                        {
                            sb.Append("</div>");
                        }
                    }
                }

            }
            else
            {
                //Generate Default Middle Block
                sb.Append(HtmlBuilder.GetMiddleDefaultBlock(widths[6].Value,Mode));
                foreach (CustomWrapper start in lstWrapper)
                {
                    if (start.Type == "placeholder" && start.End == "middle")
                    {

                        for (int i = 1; i <= start.Depth; i++)
                        {
                            sb.Append("</div>");
                        }
                    }
                }
            }

            sb.Append(HtmlBuilder.GetMiddleWrapperEnd());

            if (Decide.HasBlock(Placeholders.FULLBOTTOMSPAN, middleBlock))
            {
                sb.Append(BlockParser.ProcessMiddlePlaceholders(Placeholders.FULLBOTTOMSPAN, middleBlock,lstWrapper,Mode));
            }
            sb.Append(HtmlBuilder.EndSingleDiv());
            sb.Append(HtmlBuilder.EndSingleDiv());

            return sb.ToString();


        }
Esempio n. 33
0
        static string ParseCustomBlocks(XmlTag placeholder)
        {
            string activeTemplate = HttpContext.Current.Session["SageFrame.ActiveTemplate"] != null ? HttpContext.Current.Session["SageFrame.ActiveTemplate"].ToString() : "Default";

            string FilePath = "E://DotNetProjects//sftemplating//SageFrame//" + activeTemplate + "//sections";
            string fileName = GetAttributeValueByName(placeholder, XmlAttributeTypes.NAME);
            fileName = UppercaseFirst(fileName);
            FilePath = FilePath + fileName + ".htm";
            HTMLBuilder hb = new HTMLBuilder();
            StringBuilder sb = new StringBuilder();
            sb.Append(hb.ReadHTML(FilePath));
            return sb.ToString();
        }
Esempio n. 34
0
        public static string GetBottomBlocks(XmlTag BottomBlock, List<CustomWrapper> lstWrappers, int Mode)
        {           
            StringBuilder sb = new StringBuilder();
            try
            {
                sb.Append(BottomBlock.LSTChildNodes.Count == 0 ? HtmlBuilder.GetBottomBlockMarkupDefault() : BlockParser.ProcessPlaceholder(BottomBlock, lstWrappers,Mode));
                return sb.ToString();
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }
Esempio n. 35
0
        static string ParseSpotlight(XmlTag placeholder)
        {
            StringBuilder sb = new StringBuilder();
            string positions = placeholder.InnerHtml;
            string[] positionsAr = positions.Split(',');
            double spotWidth = 100 / positionsAr.Length;
            string width = spotWidth.ToString() + "%";
            string minheight = GetAttributeValueByName(placeholder, XmlAttributeTypes.MINHEIGHT, "200px");


            sb.Append("<div id='sfSpotLight' class='sfOuterwrapper sfCurve'><div class='sfContainer sfCurve clearfix'>");

            for (int i = 0; i < positionsAr.Length; i++)
            {
                string adjustedWidth = width;
               
                string style = GetAttributeValueByName(placeholder, XmlAttributeTypes.CSSCLASS);
                if (i == 0)
                {
                    style += " sfFirst";
                }
                if (i == positionsAr.Length - 1)
                {
                    style += " sfLast";
                }

                sb.Append("<div class='sfSpotLight" + style + "' style='width:" + adjustedWidth + ";'><div class='sfWrapper sfCurve'>");
                //sb.Append(positionsAr[i]);
                sb.Append(AppendDroppableArea(positionsAr[i]));
                sb.Append("</div></div>");
            }
            sb.Append("</div></div>");
            return sb.ToString();
        }
Esempio n. 36
0
        public static int RightBlockMode(XmlTag middleBlock)
        {
            int status = 0;
            if (Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) && Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock) && Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
            {
                status = 1;
            }
            else if (Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) && Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock) && Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && !Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
            {
                status = 2;
            }
            else if (Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) && Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock) && !Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
            {
                status = 3;
            }
            else if (Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) && !Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock) && Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && !Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
            {
                status = 4;
            }
            else if (Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) && !Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock) && !Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
            {
                status = 5;
            }
            else if (!Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) && Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock) && !Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
            {
                status = 6;
            }
            else if (!Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) && Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock) && Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && !Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
            {
                status = 7;
            }
            else if (!Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) && !Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock) && Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
            {
                status = 8;
            }
            else if (!Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) && !Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock) && Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && !Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
            {
                status = 10;
            }
            else if (!Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) && !Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock) && !Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
            {
                status = 9;
            }
            else if (Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) && !Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock) && Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
            {
                status = 11;
            }
            else if (!Decide.HasBlock(Placeholders.RIGHTTOP, middleBlock) && Decide.HasBlock(Placeholders.RIGHTBOTTOM, middleBlock) && Decide.HasBlock(Placeholders.RIGHTA, middleBlock) && Decide.HasBlock(Placeholders.RIGHTB, middleBlock))
            {
                status = 12;
            }
            return status;

        }