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();
            }
        }
Exemple #2
0
        private Configuration LoadConfiguration(string[] args)
        {
            IConfigurationBuilder      configurationBuilder       = new ConfigurationBuilderImpl();
            ConfigurationBuildDirector configurationBuildDirector = new ConfigurationBuildDirector(configurationBuilder);
            Configuration configuration = configurationBuildDirector.Construct(args);

            return(configuration);
        }
        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);
        }