Exemplo n.º 1
0
		/////////////////////////////////////////////////////////////////////////////


		TagList GetSource( string src, string callerName )
		{
			const string REGION = "#region code";
			const string ENDREGION = "#endregion";

			// ******
			//var searchStr = $"{REGION} {callerName}";
			var indexStart = src.IndexOf( REGION );
			if( indexStart < 0 ) {
				return new TagList( null, new QuickTag( "div" ).SetValue( $"unable to locate method {callerName}" ) );
			}

			var indexEnd = src.IndexOf( ENDREGION, indexStart );
			var length = (indexEnd - indexStart) + ENDREGION.Length;

			var code = src.Substring( indexStart, length ).Replace( "\t", "  ");

			var codeTag = new QuickTag( "code", null, "data-language = csharp" )
						.SetValue( code );

			var preTag = new QuickTag( "pre");
			preTag.AppendChildren( codeTag );

			var tagList = new TagList( null, preTag);

			return tagList;
		}
Exemplo n.º 2
0
		/////////////////////////////////////////////////////////////////////////////

		#region code
		//
		// template is in Templates.cs
		//
		Tag ModifyTags( AccountSummaryData.Data data, int row, int column, Tag tag )
		{
			// ******
			Tag returnTag = null;

			// ******
			if( 0 == row && column > 3 ) {
				returnTag = new QuickTag( "s" );
				returnTag.Value = tag.Value;
				tag.Value = null;
			}

			// ******
			if( 6 == column && data.Col7 < 0 ) {
				tag.AddStyles( "color : red" );
			}

			// ******
			return returnTag;
		}