public void SetUpFixture()
        {
            generator = new MockDesignerGenerator();
            view      = new FormsDesignerViewContent(null, new MockOpenedFile("Test.rb"));
            generator.Attach(view);

            view.DesignerCodeFileContent = GetFormCode();
            loader = new DerivedRubyDesignerLoader(generator);

            // Begin load.
            mockDesignerLoaderHost = new MockDesignerLoaderHost();
            mockResourceService    = new MockResourceService();
            mockDesignerLoaderHost.AddService(typeof(IResourceService), mockResourceService);

            mockTypeResolutionService = mockDesignerLoaderHost.TypeResolutionService;

            mockExtenderProviderService = new MockExtenderProviderService();
            mockDesignerLoaderHost.AddService(typeof(IExtenderProviderService), mockExtenderProviderService);
            mockDesignerLoaderHost.AddService(typeof(ProjectResourceService), new ProjectResourceService(new MockProjectContent()));

            mockEventBindingService = new MockEventBindingService();
            mockDesignerLoaderHost.AddService(typeof(IEventBindingService), mockEventBindingService);

            serializationManager = new DesignerSerializationManager(mockDesignerLoaderHost);

            System.Console.WriteLine("Before BeginLoad");
            loader.BeginLoad(mockDesignerLoaderHost);
            System.Console.WriteLine("After BeginLoad");
            rootComponent = mockDesignerLoaderHost.RootComponent;

            designedForm      = new Form();
            designedForm.Name = "NewMainForm";
            mockDesignerLoaderHost.RootComponent = designedForm;
            loader.CallPerformFlush(serializationManager);
        }
Ejemplo n.º 2
0
        void CreateScriptingDesignerLoader()
        {
            fakeGenerator = new MockDesignerGenerator();
            loader        = new TestableScriptingDesignerLoader(fakeGenerator);

            formsDesignerView = new FormsDesignerViewContent(new MockViewContent(), new MockOpenedFile("Test.py"));
            fakeGenerator.Attach(formsDesignerView);
        }