Exemplo n.º 1
0
		protected string ProcessListIsActiveVisibleSection(IsActiveVisible isactivevisible, string template)
		{

			return template;
		}
Exemplo n.º 2
0
		protected string ProcessBoolIsActiveVisibleSection(IsActiveVisible isactivevisible, string template)
		{
			string sectionStartTag;
			string sectionEndTag;
			string sectionTag;
			string sectionValue;
			
			string invertedSectionTag;
			string invertedSectionValue;
			string invertedSectionStartTag ;
            string invertedSectionEndTag;
				
			#region Bool Section Processing

            #region Get Section Tag/Value

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

			#endregion
			
			#region Get Inverted Section Tag/Value

            invertedSectionStartTag = "{{^IsActive}}";
            invertedSectionEndTag = "{{/IsActive}}";
            invertedSectionTag = TemplateUtil.GetSectionTag(template, invertedSectionStartTag, invertedSectionEndTag);
            invertedSectionValue = invertedSectionTag.Replace(invertedSectionStartTag, "").Replace(invertedSectionEndTag, "");

            #endregion

            #region Bool Section

			if (sectionTag.Trim().Length > 0)
			{
				template = template.Replace(sectionTag, isactivevisible.IsActive ? sectionValue : "");
            }

            if (invertedSectionTag.Trim().Length > 0)
            {
                template = template.Replace(invertedSectionTag, isactivevisible.IsActive ? "" : invertedSectionValue);
            }                    

            #endregion

            #endregion
			
			return template;
		}
Exemplo n.º 3
0
		protected string ProcessListIsActiveVisibleSection(IsActiveVisible isactivevisible, 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 = "{{#IsActive}}";
			sectionEndTag = "{{/IsActive}}";
            sectionTag = TemplateUtil.GetSectionTag(template, sectionStartTag, sectionEndTag);
			sectionValue = sectionTag.Replace(sectionStartTag, "").Replace(sectionEndTag, "");

			#endregion

            #region List Section

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

            if (sectionTag.Trim().Length > 0)
            {
                template = template.Replace(sectionTag, sectionValueList);
            }
            if ((invertedSectionTag.Trim().Length > 0) && ((sectionValueList.Trim().Length == 0)||(isactivevisible.IsActiveList ==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 = "{{#IsInActive}}";
			sectionEndTag = "{{/IsInActive}}";
            sectionTag = TemplateUtil.GetSectionTag(template, sectionStartTag, sectionEndTag);
			sectionValue = sectionTag.Replace(sectionStartTag, "").Replace(sectionEndTag, "");

			#endregion

            #region List Section

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

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

            #endregion

            #endregion

			return template;
		}