Ejemplo n.º 1
0
		protected string ProcessListIsDefaultVisibleSection(IsDefaultVisible isdefaultvisible, string template)
		{
			string sectionValueList;
			string sectionStartTag;
			string sectionEndTag;
			string sectionTag;
			string sectionValue;
			string invertedSectionTag;
			string invertedSectionValue;

			#region List Section Processing

			#region Initialize Variables
 				
			sectionTag = "";
			sectionValue = "";
			invertedSectionTag = "";
			invertedSectionValue = "";
			
			#endregion

			#region Get Section Tag/Value

			sectionStartTag = "{{#IsDefault}}";
			sectionEndTag = "{{/IsDefault}}";
            sectionTag = TemplateUtil.GetSectionTag(template, sectionStartTag, sectionEndTag);
			sectionValue = sectionTag.Replace(sectionStartTag, "").Replace(sectionEndTag, "");

			#endregion

            #region List Section

            sectionValueList ="";
			if ((sectionTag.Trim().Length > 0) && (isdefaultvisible.IsDefaultList !=null))
			{
				foreach (var isdefault in isdefaultvisible.IsDefaultList)
                {
					var sectionValueInstance = sectionValue;
					sectionValueInstance = sectionValueInstance.Replace("{{DataIndex}}", string.IsNullOrEmpty(isdefault.DataIndex)==false ? isdefault.DataIndex : "");
					sectionValueList += sectionValueInstance;
                }
            }

            if (sectionTag.Trim().Length > 0)
            {
                template = template.Replace(sectionTag, sectionValueList);
            }
            if ((invertedSectionTag.Trim().Length > 0) && ((sectionValueList.Trim().Length == 0)||(isdefaultvisible.IsDefaultList ==null)))
            {
                template = template.Replace(invertedSectionTag, invertedSectionValue);
            }
			else if (invertedSectionTag.Trim().Length > 0)
			{
                template = template.Replace(invertedSectionTag, "");
			}

            #endregion

            #endregion

			#region List Section Processing

			#region Initialize Variables
 				
			sectionTag = "";
			sectionValue = "";
			invertedSectionTag = "";
			invertedSectionValue = "";
			
			#endregion

			#region Get Section Tag/Value

			sectionStartTag = "{{#IsNotDefault}}";
			sectionEndTag = "{{/IsNotDefault}}";
            sectionTag = TemplateUtil.GetSectionTag(template, sectionStartTag, sectionEndTag);
			sectionValue = sectionTag.Replace(sectionStartTag, "").Replace(sectionEndTag, "");

			#endregion

            #region List Section

            sectionValueList ="";
			if ((sectionTag.Trim().Length > 0) && (isdefaultvisible.IsNotDefaultList !=null))
			{
				foreach (var isnotdefault in isdefaultvisible.IsNotDefaultList)
                {
					var sectionValueInstance = sectionValue;
					sectionValueInstance = sectionValueInstance.Replace("{{DataIndex}}", string.IsNullOrEmpty(isnotdefault.DataIndex)==false ? isnotdefault.DataIndex : "");
					sectionValueList += sectionValueInstance;
                }
            }

            if (sectionTag.Trim().Length > 0)
            {
                template = template.Replace(sectionTag, sectionValueList);
            }
            if ((invertedSectionTag.Trim().Length > 0) && ((sectionValueList.Trim().Length == 0)||(isdefaultvisible.IsNotDefaultList ==null)))
            {
                template = template.Replace(invertedSectionTag, invertedSectionValue);
            }
			else if (invertedSectionTag.Trim().Length > 0)
			{
                template = template.Replace(invertedSectionTag, "");
			}

            #endregion

            #endregion

			return template;
		}
Ejemplo n.º 2
0
		protected string ProcessBoolIsDefaultVisibleSection(IsDefaultVisible isdefaultvisible, string template)
		{
			
			return template;
		}