Esempio n. 1
0
        public MainWindow()
        {
            this.DataContext = this;
            this.InitializeComponent();

            KeyboardShortcuts.SetMainWindow(this);

            this.interopHelper = new WindowInteropHelper(this);

            this.views = new IMainView[] { this.overlayView, this.loginView, this.timerEntryListView };

            this.hideAllViews();

            this.initializeColorScheme();
            this.initializeEvents();
            this.initializeContextMenu();
            this.initializeTaskbarIcon();
            this.initializeWindows();
            this.initializeCustomNotifications();
            this.initializeSyncingIndicator();
            this.initializeTutorialManager();
            this.initializeExperimentManager();
            this.initializeSessionNotification();

            this.idleDetectionTimer.Tick += this.onIdleDetectionTimerTick;

            this.finalInitialisation();
            this.trackingWindowSize();
            this.Loaded += onMainWindowLoaded;
        }
        public MainWindow()
        {
            this.DataContext = this;
            this.InitializeComponent();

            KeyboardShortcuts.SetMainWindow(this);

            this.interopHelper = new WindowInteropHelper(this);

            this.views = new IMainView[] { this.missingWSView, this.loginView, this.timerEntryListView };

            this.hideAllViews();

            this.initializeEvents();
            this.initializeContextMenu();
            this.initializeTaskbarIcon();
            this.initializeWindows();
            this.initializeCustomNotifications();
            this.initializeSyncingIndicator();
            this.initializeTutorialManager();
            this.initializeExperimentManager();

            this.startHook.KeyPressed    += this.onGlobalStartKeyPressed;
            this.showHook.KeyPressed     += this.onGlobalShowKeyPressed;
            this.idleDetectionTimer.Tick += this.onIdleDetectionTimerTick;

            this.finalInitialisation();
        }
Esempio n. 3
0
        public MiniTimerWindow(MainWindow mainWindow)
        {
            this.contextMenu = mainWindow.ContextMenu;
            this.InitializeComponent();
            this.WindowStyle = WindowStyle.SingleBorderWindow;

            this.interopHelper = new WindowInteropHelper(this);

            KeyboardShortcuts.RegisterShortcuts(this);
        }
Esempio n. 4
0
        public EditViewPopup()
        {
            this.InitializeComponent();

            this.MinWidth       = this.EditView.MinWidth + 16;
            this.mainGrid.Width = 0;

            Toggl.OnTimeEntryEditor += this.onTimeEntryEditor;

            KeyboardShortcuts.RegisterShortcuts(this);
        }
Esempio n. 5
0
 private void onGlobalStartKeyPressed(object sender, HotkeyEventArgs args)
 {
     if (this.IsTracking)
     {
         using (Performance.Measure("stopping time entry from global short cut", this.IsInManualMode))
         {
             Toggl.Stop();
         }
     }
     else
     {
         using (Performance.Measure("starting time entry from global short cut, manual mode: {0}", this.IsInManualMode))
         {
             KeyboardShortcuts.StartTimeEntry(true);
         }
     }
 }
        public MiniTimerWindow(MainWindow mainWindow)
        {
            this.contextMenu = mainWindow.cogButton.ContextMenu;
            this.InitializeComponent();
            this.Closing += OnClosing;
            var sizeChangedObservable = Observable.FromEventPattern <SizeChangedEventHandler, SizeChangedEventArgs>(
                handler => this.SizeChanged += handler,
                handler => this.SizeChanged -= handler);

            sizeChangedObservable
            .Where(x => x.EventArgs.WidthChanged)
            .Throttle(TimeSpan.FromMilliseconds(500))
            .ObserveOnDispatcher()
            .Subscribe(x => ((Window)x.Sender).SizeToContent = SizeToContent.Height);

            this.timer.MouseCaptured += OnMouseCaptured;

            KeyboardShortcuts.RegisterShortcuts(this);
        }