Beispiel #1
0
        public WorkspaceViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _workspaceDataUnit = dataUnitLocator.ResolveDataUnit<IWorkspaceDataUnit>();
            _crmDataUnit = dataUnitLocator.ResolveDataUnit<ICrmDataUnit>();
            _eventDataUnit = dataUnitLocator.ResolveDataUnit<IEventDataUnit>();

            var time = (int?)ApplicationSettings.Read("LogoutTime");
            _logoutTime = (time.HasValue && time.Value > 0) ? time.Value : 30; // 30 minutes - default logout time

            EventManager.RegisterClassHandler(typeof(Window), UIElement.KeyDownEvent, new RoutedEventHandler(Window_KeyDown));
            EventManager.RegisterClassHandler(typeof(Window), UIElement.MouseDownEvent, new RoutedEventHandler(Window_MouseDown));
            EventManager.RegisterClassHandler(typeof(Window), UIElement.MouseMoveEvent, new RoutedEventHandler(Window_MouseMove));
            EventManager.RegisterClassHandler(typeof(Window), UIElement.MouseWheelEvent, new RoutedEventHandler(Window_MouseWheel));

            _timer = new Timer(LogoutByInactivity, null, 1000 * 60 * _logoutTime, Timeout.Infinite);

            _updateTimer = new DispatcherTimer { Interval = TimeSpan.FromSeconds(30) };
            _updateTimer.Tick += UpdateTimer_Tick;

            _updateTimer.Start();

            _updateTimerEvents = new DispatcherTimer { Interval = TimeSpan.FromSeconds(30) };
            _updateTimerEvents.Tick += _updateTimerEvents_Tick;

            _updateTimerEvents.Start();
        }
Beispiel #2
0
        public WorkspaceViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _workspaceDataUnit = dataUnitLocator.ResolveDataUnit <IWorkspaceDataUnit>();
            _crmDataUnit       = dataUnitLocator.ResolveDataUnit <ICrmDataUnit>();
            _eventDataUnit     = dataUnitLocator.ResolveDataUnit <IEventDataUnit>();

            var time = (int?)ApplicationSettings.Read("LogoutTime");

            _logoutTime = (time.HasValue && time.Value > 0) ? time.Value : 30; // 30 minutes - default logout time

            EventManager.RegisterClassHandler(typeof(Window), UIElement.KeyDownEvent, new RoutedEventHandler(Window_KeyDown));
            EventManager.RegisterClassHandler(typeof(Window), UIElement.MouseDownEvent, new RoutedEventHandler(Window_MouseDown));
            EventManager.RegisterClassHandler(typeof(Window), UIElement.MouseMoveEvent, new RoutedEventHandler(Window_MouseMove));
            EventManager.RegisterClassHandler(typeof(Window), UIElement.MouseWheelEvent, new RoutedEventHandler(Window_MouseWheel));

            _timer = new Timer(LogoutByInactivity, null, 1000 * 60 * _logoutTime, Timeout.Infinite);

            _updateTimer = new DispatcherTimer {
                Interval = TimeSpan.FromSeconds(30)
            };
            _updateTimer.Tick += UpdateTimer_Tick;

            _updateTimer.Start();

            _updateTimerEvents = new DispatcherTimer {
                Interval = TimeSpan.FromSeconds(30)
            };
            _updateTimerEvents.Tick += _updateTimerEvents_Tick;

            _updateTimerEvents.Start();
        }
Beispiel #3
0
        public WelcomeViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve<IDataUnitLocator>();
            _workspaceDataUnit = dataUnitLocator.ResolveDataUnit<IWorkspaceDataUnit>();

            ApplicationVersion = GetApplicationVersion();

            UserLoginCommand = new RelayCommand(UserLoginCommandExecuted, UserLoginCommandCanExecute);
        }
Beispiel #4
0
        public WelcomeViewModel()
        {
            var dataUnitLocator = ContainerAccessor.Instance.GetContainer().Resolve <IDataUnitLocator>();

            _workspaceDataUnit = dataUnitLocator.ResolveDataUnit <IWorkspaceDataUnit>();

            ApplicationVersion = GetApplicationVersion();

            UserLoginCommand = new RelayCommand(UserLoginCommandExecuted, UserLoginCommandCanExecute);
        }