Source code for the CoDocker CSharp to HTML converter from OfItselfSo.com
using System; using System.Collections.Generic; using System.Linq; using System.Text; /// +------------------------------------------------------------------------------------------------------------------------------+ /// ¦ TERMS OF USE: MIT License ¦ /// +------------------------------------------------------------------------------------------------------------------------------¦ /// ¦Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation ¦ /// ¦files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, ¦ /// ¦modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software¦ /// ¦is furnished to do so, subject to the following conditions: ¦ /// ¦ ¦ /// ¦The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.¦ /// ¦ ¦ /// ¦THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE ¦ /// ¦WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR ¦ /// ¦COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ¦ /// ¦ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ¦ /// +------------------------------------------------------------------------------------------------------------------------------+ namespace CoDocker { /// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= /// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= /// <summary> /// A class to hold a file name and its include type. /// </summary> /// <history> /// 03 Mar 11 Cynic - Started /// </history> public class OutputFileContainer : IComparable<OutputFileContainer> { private string includeType = ""; private string htmlOutputFileName = ""; private string fileDisplayName = ""; private string fileNameAndPath = ""; /// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= /// <summary> /// Constructor /// </summary> /// <param name="htmlOutputFileNameIn">html output file name</param> /// <param name="includeTypeIn">include type</param> /// <param name="fileDisplayNameIn">the display name of the file</param> /// <param name="fileNameAndPath">the full name and path of the file</param> /// <history> /// 03 Mar 11 Cynic - Started /// </history> public OutputFileContainer(string includeTypeIn, string htmlOutputFileNameIn, string fileDisplayNameIn, string fileNameAndPathIn) { includeType = includeTypeIn; htmlOutputFileName = htmlOutputFileNameIn; fileDisplayName = fileDisplayNameIn; fileNameAndPath = fileNameAndPathIn; } /// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= /// <summary> /// Generic CompareTo for IComparable /// </summary> /// <history> /// 03 Mar 11 Cynic - Started /// </history> public int CompareTo(OutputFileContainer ofcObj) { // we always just compare alphabetically on the fileDisplayName return this.fileDisplayName.CompareTo(ofcObj.fileDisplayName); } /// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= /// <summary> /// Gets/Sets the includeType value. Will never get or set null /// </summary> /// <history> /// 03 Mar 11 Cynic - Started /// </history> public string IncludeType { get { if (includeType == null) includeType = ""; return includeType; } set { includeType = value; if (includeType == null) includeType = ""; } } /// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= /// <summary> /// Gets/Sets the htmlOutputFileName value. Will never get or set null /// </summary> /// <history> /// 03 Mar 11 Cynic - Started /// </history> public string HtmlOutputFileName { get { if (htmlOutputFileName == null) htmlOutputFileName = ""; return htmlOutputFileName; } set { htmlOutputFileName = value; if (htmlOutputFileName == null) htmlOutputFileName = ""; } } /// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= /// <summary> /// Gets/Sets the fileDisplayName value. Will never get or set null /// </summary> /// <history> /// 03 Mar 11 Cynic - Started /// </history> public string FileDisplayName { get { if (fileDisplayName == null) fileDisplayName = ""; return fileDisplayName; } set { fileDisplayName = value; if (fileDisplayName == null) fileDisplayName = ""; } } /// +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= /// <summary> /// Gets/Sets the fileNameAndPath value. Will never get or set null /// </summary> /// <history> /// 03 Mar 11 Cynic - Started /// </history> public string FileNameAndPath { get { if (fileNameAndPath == null) fileNameAndPath = ""; return fileNameAndPath; } set { fileNameAndPath = value; if (fileNameAndPath == null) fileNameAndPath = ""; } } } }