Beispiel #1
0
        public DataController(CompositionContainer container, IMessageService messageService,
            DataService dataService, ProxyController proxyController)
        {
            this.container = container;
            this.messageService = messageService;
            this.dataService = dataService;
            this.proxyController = proxyController;

            this.refreshBugsCommand = new DelegateCommand(RefreshBugsCommandExecute, CanRefreshBugsCommandExecute);

            this.timerStarted = false;

            AddWeakEventListener(this.proxyController.ProxyService, ProxyServicePropertyChanged);
        }
Beispiel #2
0
        public void RestoreWindowLocationAndSizeSpecial()
        {
            DataService dataService = new DataService();
            MockPresentationService presentationService = (MockPresentationService)Container.GetExportedValue<IPresentationService>();
            presentationService.VirtualScreenWidth = 1000;
            presentationService.VirtualScreenHeight = 700;

            MainViewModel viewModel = Container.GetExportedValue<MainViewModel>();
            IShellService shellService = Container.GetExportedValue<IShellService>();
            MockMainView view = (MockMainView)Container.GetExportedValue<IMainView>();
            view.SetNAForLocationAndSize();

            SetSettingsValues();
            new MainViewModel(view, dataService, shellService, presentationService).Close();
            AssertSettingsValues(double.NaN, double.NaN, double.NaN, double.NaN);

            // Height is 0 => don't apply the Settings values
            SetSettingsValues(0, 0, 1, 0);
            new MainViewModel(view, dataService, shellService, presentationService).Close();
            AssertSettingsValues(double.NaN, double.NaN, double.NaN, double.NaN);

            // Left = 100 + Width = 901 > VirtualScreenWidth = 1000 => don't apply the Settings values
            SetSettingsValues(100, 100, 901, 100);
            new MainViewModel(view, dataService, shellService, presentationService).Close();
            AssertSettingsValues(double.NaN, double.NaN, double.NaN, double.NaN);

            // Top = 100 + Height = 601 > VirtualScreenWidth = 600 => don't apply the Settings values
            SetSettingsValues(100, 100, 100, 601);
            new MainViewModel(view, dataService, shellService, presentationService).Close();
            AssertSettingsValues(double.NaN, double.NaN, double.NaN, double.NaN);

            // Use the limit values => apply the Settings values
            SetSettingsValues(0, 0, 1000, 700);
            new MainViewModel(view, dataService, shellService, presentationService).Close();
            AssertSettingsValues(0, 0, 1000, 700);
        }
Beispiel #3
0
        public void RestoreWindowLocationAndSizeSpecial()
        {
            DataService dataService = new DataService();
            MockPresentationService presentationService = (MockPresentationService)Container.GetExportedValue<IPresentationService>();
            presentationService.VirtualScreenWidth = 1000;
            presentationService.VirtualScreenHeight = 700;

            FloatingViewModel viewModel = Container.GetExportedValue<FloatingViewModel>();
            MockFloatingView view = (MockFloatingView)Container.GetExportedValue<IFloatingView>();
            view.SetNAForLocationAndSize();

            SetSettingsValues();
            new FloatingViewModel(view, dataService, presentationService).Close();
            AssertSettingsValues(0, 0);

            // Left = 881 + Width(120) = 901 > VirtualScreenWidth = 1000 => don't apply the Settings values
            SetSettingsValues(881, 100);
            new FloatingViewModel(view, dataService, presentationService).Close();
            AssertSettingsValues(0, 0);

            // Top = 681 + Height(20) = 701 > VirtualScreenWidth = 600 => don't apply the Settings values
            SetSettingsValues(100, 681);
            new FloatingViewModel(view, dataService, presentationService).Close();
            AssertSettingsValues(0, 0);

            // Use the limit values => apply the Settings values
            SetSettingsValues(880, 680);
            new FloatingViewModel(view, dataService, presentationService).Close();
            AssertSettingsValues(880, 680);
        }