Exemplo n.º 1
0
        public virtual object New(Window window, ScreenRepository screenRepository)
        {
            object o = @class.New(window, screenRepository);

            @class.EachField(delegate(FieldInfo fieldInfo)
            {
                if (nonInjectedTypes.IsAssignableFrom(fieldInfo.FieldType))
                {
                    return;
                }
                object injectedObject = null;
                if (typeof(IUIItem).IsAssignableFrom(fieldInfo.FieldType))
                {
                    var interceptor = new UIItemInterceptor(SearchCondition(fieldInfo), window, screenRepository.SessionReport);
                    injectedObject  = DynamicProxyGenerator.Instance.CreateProxy(interceptor, fieldInfo.FieldType);
                }
                else if (typeof(AppScreenComponent).IsAssignableFrom(fieldInfo.FieldType))
                {
                    var componentScreenClass = new ScreenClass(new Class(fieldInfo.FieldType));
                    injectedObject           = componentScreenClass.New(window, screenRepository);
                }

                if (injectedObject != null)
                {
                    fieldInfo.SetValue(o, injectedObject);
                }
            });
            return(o);
        }
        public virtual MainScreen SetUp(InitializeOption initializeOption)
        {
            WinFormTestConfiguration configuration = new WinFormTestConfiguration(string.Empty);

            application = configuration.Launch();
            ScreenRepository screenRepository = new ScreenRepository(application.ApplicationSession);

            mainScreen = screenRepository.Get <MainScreen>("Form1", initializeOption);
            return(mainScreen);
        }
Exemplo n.º 3
0
        public void New_screen_containing_component()
        {
            MockRepository   mocks            = new MockRepository();
            Window           window           = mocks.CreateMock <Window>();
            ScreenRepository screenRepository = mocks.CreateMock <ScreenRepository>();

            mocks.ReplayAll();
            Class @class = new Class(typeof(ScreenClassContainingComponent));

            new ScreenClass(@class).New(window, screenRepository);
        }
Exemplo n.º 4
0
 public RepositoryComponent(Window window, ScreenRepository screenRepository)
 {
     this.window           = window;
     this.screenRepository = screenRepository;
 }
Exemplo n.º 5
0
 public AppScreen(Window window, ScreenRepository screenRepository) : base(window, screenRepository)
 {
 }
Exemplo n.º 6
0
 public ScreenClassComponent(Window window, ScreenRepository screenRepository) : base(window, screenRepository)
 {
 }
 public SearchMoviesScreen(Core.UIItems.WindowItems.Window window, Repository.ScreenRepository screenRepository)
     : base(window, screenRepository)
 {
 }
 public AppScreenComponent(Window window, ScreenRepository screenRepository) : base(window, screenRepository)
 {
 }