示例#1
0
        static void Main(string[] args)
        {
            if (ArgumentChecker.CheckArguments(args))
            {
                IConfigurationBuilder configurationBuilder = new ConfigurationBuilderImpl();

                ArgumentHandler argHandler = new DefaultHandler();

                for (int i = 0; i < args.Length; i += 2)
                {
                    argHandler.HandleArgument(new Tuple <string, string>(args[i], args[i + 1]), configurationBuilder);
                }

                ConfigurationBuildDirector configurationBuildDirector = new ConfigurationBuildDirector(configurationBuilder);
                Configuration configuration = configurationBuildDirector.Construct();

                if (!configuration.IsConfigurationValid())
                {
                    Console.WriteLine("Argumenti nisu valjani! Provjerite argumente!");
                    return;
                }

                Router.Initialize(configuration);

                IndexModel indexModel = new IndexModel();
                IndexView  indexView  = new IndexView(configuration);

                indexView.Initialize(indexModel);
                indexModel.Attach(indexView);

                indexView.MakeController();
                indexView.Activate();
            }
        }
示例#2
0
        private Configuration LoadConfiguration(string[] args)
        {
            IConfigurationBuilder      configurationBuilder       = new ConfigurationBuilderImpl();
            ConfigurationBuildDirector configurationBuildDirector = new ConfigurationBuildDirector(configurationBuilder);
            Configuration configuration = configurationBuildDirector.Construct(args);

            return(configuration);
        }
示例#3
0
        private Configuration LoadConfiguration(string[] args)
        {
            IConfigurationBuilder configurationBuilder = new ConfigurationBuilderImpl();

            ArgumentHandler generatorSeedHandler = new GeneratorSeedHandler();

            for (int i = 0; i < args.Length; i += 2)
            {
                generatorSeedHandler.HandleArgument(new Tuple <string, string>(args[i], args[i + 1]), configurationBuilder);
            }

            ConfigurationBuildDirector configurationBuildDirector = new ConfigurationBuildDirector(configurationBuilder);
            Configuration configuration = configurationBuildDirector.Construct();

            return(configuration);
        }