예제 #1
0
파일: Program.cs 프로젝트: erith-c/warden
        static void Main(string[] args)
        {
            //Core.Start();
            Console.WriteLine("<<//...\n");
            Console.WriteLine("//===================================//" +
                              "    </ THE [OVERSEER] GREETS YOU />    " +
                              "\\\\===================================\\\\");
            Console.Write("    [OVERSEER]\n</ PLEASE ENTER A VALUE TO CONVERT. />\n  << ");
            int Value = Convert.ToInt32(Console.ReadLine());

            SequenceConverter Base10 = new SequenceConverter("0123456789");
            SequenceConverter Base16 = new SequenceConverter("0123456789ABCDEF");
            SequenceConverter Base3  = new SequenceConverter("NOS");

            Base10.UpdateValue(Value);
            Base16.UpdateValue(Value);
            Base3.UpdateValue(Value);

            Console.WriteLine("//PROCESSING//");
            Console.WriteLine($"    [OVERSEER]\n</ THE INPUTTED VALUE IS [{Value}] />");
            Console.WriteLine($"    [OVERSEER]\n</ THE BASE10 VALUE IS [{Base10.ConvertValue()}] />");
            Console.WriteLine($"    [OVERSEER]\n</ THE CONVERTED BASE16 VALUE IS [{Base16.ConvertValue()}] />");
            Console.WriteLine($"    [OVERSEER]\n</ THE CONVERTED BASE3 VALUE IS [{Base3.ConvertValue()}] />");
            Console.WriteLine("    [OVERSEER]\n</ PLEASE RECORD THIS VALUE FOR FUTURE USE. />");
            Console.WriteLine("\n...//>>");
        }
 /// <summary>
 /// Performs the conversion procedure.
 /// </summary>
 /// <param name="expr">The expression to convert.</param>
 /// <returns>The conversion result.</returns>
 public override string Convert(LatexExpression expr)
 {
     var bld = new StringBuilder("<h3 class=\"subsection\">\n<a id=\"");
     int sectIndex = expr.Customization.SectionContents[expr.Customization.CurrentSectionType].Count - 1;
     var section = expr.Customization.SectionContents[expr.Customization.CurrentSectionType][sectIndex];
     var title = SequenceConverter.ConvertOutline(expr.Expressions[0], expr.Customization);
     int index = section.Subsections[SectionType.Unnumbered].Count;
     section.Subsections[SectionType.Unnumbered].Add(title);            
     bld.Append(expr.Customization.CurrentSectionType == SectionType.Numbered ? "ns" : "nns");
     bld.Append(sectIndex);
     bld.Append("nnss");
     bld.Append(index);
     bld.Append("\">");
     bld.Append(title);
     bld.Append("</a></h3>\n");
     return bld.ToString();
 }