Exemplo n.º 1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var types = new List <Type>
            {
                typeof(Rectangle),
                typeof(Triangle),
                typeof(Segment),
                typeof(Polygon)
            };

            var app = new AppDependencyContainer();

            app.RegisterStartForm <IFiguresDrawerView, Index, FiguresDrawerPresenter>();
            app.RegisterFiguresTypes(types);

            app.RegisterFigureSerialuzer <XmlFigureSerializer>();
            app.RegisterFigureFactory(new FigurePointsFactory());

            app.RegisterForm <IFiguresCreatorView, FiguresCreatorForm, FiguresCreatorPresenter>();
            app.RegisterForm <IFiguresSettingsView, FiguresSettingsForm, FiguresSettingsPresenter>();
            app.RegisterForm <IFigureInfoPresenterView, FigureInfoPresenterForm, FigureInfoPresenter>();

            AppDependencies.Initialize(app);

            var form = AppDependencies.CreateStartForm();

            Application.Run(form.View);
        }
 static public void Initialize(AppDependencyContainer manager)
 {
     _manager = manager ?? throw new ArgumentNullException(nameof(manager));
 }