コード例 #1
0
ファイル: View.cs プロジェクト: poulhoecherl/public
        /// <summary>
        /// Dump the Menu to the Console
        /// </summary>
        /// <param name="thisCatalog"></param>
        internal void DisplayMainMenu(Catalog thisCatalog)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendLine("***********************************");
            sb.AppendLine("Please select an Item by number");
            sb.AppendLine(" > Enter m to display Main Menu");
            sb.AppendLine(" > Enter c to display Categories");
            sb.AppendLine(" > Enter q to Quit");
            sb.AppendLine("***********************************");
            printC(sb.ToString(), ConsoleColor.White);
            sb.Clear();

            var lines = (from line in thisCatalog.ActiveCatalog
                         where (line.Length > 0) && (line.Substring(0, 1).Any(char.IsDigit))
                         select line).ToList();

            sb.AppendLine("-----------------------------------");
            sb.AppendLine(String.Format("{0} {1}   {2}", thisCatalog.LoadedHeaders[0], thisCatalog.LoadedHeaders[1], thisCatalog.LoadedHeaders[2])); //"Id      Product Name    Category"
            sb.AppendLine("-----------------------------------");
            sb.Append(thisCatalog.ToString());
            sb.Append("-----------------------------------");

            printC(sb.ToString(),ConsoleColor.Yellow);
        }
コード例 #2
0
ファイル: Controller.cs プロジェクト: poulhoecherl/public
 /// <summary>
 /// Ctor
 /// </summary>
 public Controller()
 {
     model = new Catalog();
     catalogData = model.ActiveCatalog;
     view = new View();
 }