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

            var mainForm = new MainForm();

            var tableLayoutWrapperFactory      = new TableLayoutWrapperFactory();
            var centralLayoutBuilderDecorators = new List <ITableLayoutDecorator>
            {
                new EqualColumnsTableLayoutDecorator(2)
            };
            var centralLayoutBuilder = new CentralLayoutBuilder(new TableLayoutDecoratorApplier(), centralLayoutBuilderDecorators, tableLayoutWrapperFactory, new PropertyApplier <IControlProperties>());

            var textBoxStyleApplier = new PropertyApplier <ITextBoxProperties>();

            var dataEntryFormManager = new DataEntryFormManager(
                new DataEntryFormBuilder(tableLayoutWrapperFactory),
                new DataMapper(new EditableTextBoxBuilder(new TextBoxWrapperFactory(), new SwappableStrategyFactory(textBoxStyleApplier), new EditableTextBoxFactory()), new ControlPropertiesFactory()));

            var verticalScrollStrategy = new VerticalScrollStrategy(new Win32Adapter(new NativeMethods()));

            var mainFormProcessor = new MainFormProcessor(mainForm.MainLayoutPanel,
                                                          centralLayoutBuilder,
                                                          dataEntryFormManager,
                                                          verticalScrollStrategy);

            mainForm.MainFormProcessor = mainFormProcessor;
            mainFormProcessor.SetUpStatPage();

            Application.Run(mainForm);
        }
Esempio n. 2
0
        public void SetUpStatPage_CorrectCalls()
        {
            A.CallTo(() => _centralLayoutBuilder.Build(A <IControlPropertiesStyle> .Ignored)).Returns(_createdTableLayoutWrapper);

            _mainFormProcessor.SetUpStatPage();

            A.CallTo(() => _tableLayoutWrapper.AccessControls.Add(A <IControl> .Ignored, 2, 1)).MustHaveHappened();
        }