Example #1
0
        void Start()
        {
            string[] target_list = new string[2] {
                "plain",
                "html"
            };

            string target = target_list[1];

            if ("plain" == target)
            {
                TextBuilder textbuilder = new TextBuilder();
                Director    director    = new Director(textbuilder);
                director.construct();
                string result = textbuilder.getResult();
                Debug.Log(result);
            }
            else if ("html" == target)
            {
                HTMLBuilder htmlbuilder = new HTMLBuilder();
                Director    director    = new Director(htmlbuilder);
                director.construct();
                string filename = htmlbuilder.getResult();
                Debug.Log(filename + "が作成されました。");
            }
            else
            {
                usage();
            }
        }
Example #2
0
        public static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Usage();
                Environment.Exit(0);
            }

            if (args[0].Equals("plain"))
            {
                TextBuilder textBuilder = new TextBuilder();
                var         director    = new Director <string>(textBuilder);

                var result = director.construct();
                Console.WriteLine(result);
            }
            else if (args[0].Equals("html"))
            {
                HTMLBuilder htmlbuilder = new HTMLBuilder();
                var         director    = new Director <FileInfo>(htmlbuilder);

                var filePath = director.construct();
                Console.WriteLine(filePath.Name + "が作成されました。");
            }
            else
            {
                Usage();
                Environment.Exit(0);
            }

            Console.ReadLine();
        }
Example #3
0
        static void Main(string[] args)
        {
            try
            {
                TextBuilder textBuilder = new TextBuilder();
                Director    director    = new Director(textBuilder);
                director.Construct();
                string result = textBuilder.GetResult();
                WriteLine(result);

                HTMLBuilder htmlBuilder = new HTMLBuilder();
                Director    hDirector   = new Director(htmlBuilder);
                hDirector.Construct();
                string hResult = htmlBuilder.GetResult();
                WriteLine(hResult);

                ReadKey();
            }
            catch (Exception ex)
            {
                //throw;
            }
        }