• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# xmlparser.XmlTag类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SageFrame.Templating.xmlparser.XmlTag的典型用法代码示例。如果您正苦于以下问题:C# XmlTag类的具体用法?C# XmlTag怎么用?C# XmlTag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



XmlTag类属于SageFrame.Templating.xmlparser命名空间,在下文中一共展示了XmlTag类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GeneratePlaceHolderMarkup

 /// <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 "";
 }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:12,代码来源:LayoutControlGenerator.cs


示例2: ProcessPlaceholder

        /// <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();
        }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:67,代码来源:BlockParser.cs


示例3: GetXmlTags

 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;
 }
开发者ID:RexSystemsbd,项目名称:SageFrameV2.1Source,代码行数:25,代码来源:XmlParser.cs


示例4: GeneratePlaceholderStart

        /// <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();
        }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:19,代码来源:HtmlBuilder.cs


示例5: TagBuilder

 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;
 }
开发者ID:Dashboard-X,项目名称:Aspxcommerce,代码行数:9,代码来源:TemplateHelper.cs


示例6: IsSpotLight

 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;
 }
开发者ID:RexSystemsbd,项目名称:SageFrameV2.1Source,代码行数:10,代码来源:Decide.cs


示例7: HasBlock

 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;
 }
开发者ID:RexSystemsbd,项目名称:SageFrameV2.1Source,代码行数:11,代码来源:Decide.cs


示例8: GetAttributeValueByName

 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;
 }
开发者ID:Dashboard-X,项目名称:Aspxcommerce,代码行数:13,代码来源:TemplateHelper.cs


示例9: GenerateSectionMarkup

 /// <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;
 }
开发者ID:xiaoxiaocoder,项目名称:AspxCommerce2.7,代码行数:26,代码来源:LayoutControlGenerator.cs


示例10: IsCustomBlockDefined

        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;
        }
开发者ID:RexSystemsbd,项目名称:SageFrameV2.1Source,代码行数:21,代码来源:Decide.cs


示例11: GetSectionMarkup

        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;
        }
开发者ID:Dashboard-X,项目名称:Aspxcommerce,代码行数:24,代码来源:LayoutControlGenerator.cs


示例12: CalculateColumnWidth

 /// <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;
 }
开发者ID:RexSystemsbd,项目名称:SageFrameV2.1Source,代码行数:44,代码来源:Calculator.cs


示例13: GetBottomBlockMarkupCustom

 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();
 }
开发者ID:Dashboard-X,项目名称:Aspxcommerce,代码行数:26,代码来源:TemplateHelper.cs


示例14: ParseCustomBlocks

        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();
        }
开发者ID:Dashboard-X,项目名称:Aspxcommerce,代码行数:13,代码来源:TemplateHelper.cs


示例15: GenerateBlockWrappers

        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();
        }
开发者ID:RexSystemsbd,项目名称:SageFrameV2.1Source,代码行数:53,代码来源:BlockParser.cs


示例16: GetBottomBlocks

 public static string GetBottomBlocks(XmlTag BottomBlock)
 {
     StringBuilder sb = new StringBuilder();
     sb.Append(BottomBlock.LSTChildNodes.Count == 0 ? GetBottomBlockMarkupDefault() : GetBottomBlockMarkupCustom(BottomBlock));
     return sb.ToString();
 }
开发者ID:Dashboard-X,项目名称:Aspxcommerce,代码行数:6,代码来源:TemplateHelper.cs


示例17: GetMiddleCustomMarkup

        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))
//.........这里部分代码省略.........
开发者ID:Dashboard-X,项目名称:Aspxcommerce,代码行数:101,代码来源:TemplateHelper.cs


示例18: CalculateMiddleBlockWidth

        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()));
//.........这里部分代码省略.........
开发者ID:Dashboard-X,项目名称:Aspxcommerce,代码行数:101,代码来源:TemplateHelper.cs


示例19: IsValidTag

 public static bool IsValidTag(XmlTag tag)
 {
     return(Enum.IsDefined(typeof(XmlTagTypes),tag.TagName.ToUpper())); 
 }
开发者ID:Dashboard-X,项目名称:Aspxcommerce,代码行数:4,代码来源:Utils.cs


示例20: GetBottomBlocks

        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;
            }

        }
开发者ID:Dashboard-X,项目名称:Aspxcommerce,代码行数:15,代码来源:BlockBuilder.cs



注:本文中的SageFrame.Templating.xmlparser.XmlTag类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Web.SageFrameConfig类代码示例发布时间:2022-05-26
下一篇:
C# Common.RequestContext类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap