コード例 #1
0
 public Information(ModelHelpers modelHelpers)
 {
     this.modelHelpers = modelHelpers;
     InitializeComponent();
     DataContext = new InformationModel(modelHelpers.Gallifrey);
     modelHelpers.Gallifrey.TrackEvent(TrackingType.InformationShown);
 }
コード例 #2
0
ファイル: Export.xaml.cs プロジェクト: BlythMeister/Gallifrey
 public Export(ModelHelpers modelHelpers, Guid timerId, TimeSpan? exportTime, bool skipJiraCheck = false)
 {
     this.modelHelpers = modelHelpers;
     InitializeComponent();
     progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);
     SetupContext(modelHelpers.Gallifrey.JiraTimerCollection.GetTimer(timerId), exportTime, skipJiraCheck);
 }
コード例 #3
0
        public Settings(ModelHelpers modelHelpers)
        {
            this.modelHelpers = modelHelpers;
            InitializeComponent();

            DataContext = new SettingModel(modelHelpers.Gallifrey.Settings, modelHelpers.Gallifrey.VersionControl);
        }
コード例 #4
0
 public BulkExport(ModelHelpers modelHelpers, List<JiraTimer> timers)
 {
     this.modelHelpers = modelHelpers;
     InitializeComponent();
     progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);
     DataContext = new BulkExportContainerModel();
     SetupContext(timers);
 }
コード例 #5
0
        public LockedTimer(ModelHelpers modelHelpers)
        {
            this.modelHelpers = modelHelpers;
            InitializeComponent();

            var idleTimers = modelHelpers.Gallifrey.IdleTimerCollection.GetUnusedLockTimers().ToList();

            DataContext = new LockedTimerCollectionModel(idleTimers);
        }
コード例 #6
0
        public EditTimer(ModelHelpers modelHelpers, Guid selected)
        {
            this.modelHelpers = modelHelpers;
            InitializeComponent();

            progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);

            EditedTimerId = selected;
            DataContext = new EditTimerModel(modelHelpers.Gallifrey, EditedTimerId);
        }
コード例 #7
0
ファイル: Search.xaml.cs プロジェクト: BlythMeister/Gallifrey
        public Search(ModelHelpers modelHelpers, bool openFromAdd = false, bool openFromEdit = false, DateTime? selectedDateTab = null)
        {
            this.modelHelpers = modelHelpers;
            this.openFromAdd = openFromAdd;
            this.openFromEdit = openFromEdit;
            this.selectedDateTab = selectedDateTab ?? DateTime.Now.Date;
            InitializeComponent();
            progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);

            LoadSearch();
        }
コード例 #8
0
        public AddTimer(ModelHelpers modelHelpers, string jiraRef = null, DateTime? startDate = null, bool? enableDateChange = null, List<IdleTimer> idleTimers = null, bool? startNow = null)
        {
            this.modelHelpers = modelHelpers;
            InitializeComponent();
            progressDialogHelper = new ProgressDialogHelper(modelHelpers.DialogContext);

            if (!modelHelpers.Gallifrey.Settings.InternalSettings.IsPremium && startNow.HasValue && startNow.Value)
            {
                startNow = false;
            }

            DataContext = new AddTimerModel(modelHelpers.Gallifrey, jiraRef, startDate, enableDateChange, idleTimers, startNow);
            AddedTimer = false;
        }
コード例 #9
0
        public MainViewModel(ModelHelpers modelHelpers)
        {
            ModelHelpers = modelHelpers;
            TimerDates = new ObservableCollection<TimerDateModel>();

            var backgroundRefresh = new Timer(3600000);
            backgroundRefresh.Elapsed += (sender, args) => RefreshModel();
            backgroundRefresh.Start();

            modelHelpers.Gallifrey.VersionControl.NewVersionInstalled += (sender, args) => NewVersionInstalled();
            modelHelpers.Gallifrey.IsPremiumChanged += (sender, args) => PremiumChanged();
            modelHelpers.Gallifrey.BackendModifiedTimers += (sender, args) => BackendModification();
            modelHelpers.Gallifrey.SettingsChanged += (sender, args) => SettingsChanged();
            modelHelpers.Gallifrey.JiraConnection.LoggedIn += (sender, args) => UserLoggedIn();
            modelHelpers.Gallifrey.JiraTimerCollection.GeneralTimerModification += (sender, args) => GeneralTimerModification();
            modelHelpers.Gallifrey.DailyTrackingEvent += (sender, args) => DailyEvent();
            modelHelpers.RefreshModelEvent += (sender, args) => RefreshModel();
            modelHelpers.SelectRunningTimerEvent += (sender, args) => SelectRunningTimer();
            modelHelpers.SelectTimerEvent += (sender, timerId) => SetSelectedTimer(timerId);
        }
コード例 #10
0
        public MainWindow(InstanceType instance)
        {
            InitializeComponent();

            var gallifrey = new Backend(instance);
            modelHelpers = new ModelHelpers(gallifrey, FlyoutsControl);
            exceptionlessHelper = new ExceptionlessHelper(modelHelpers);
            exceptionlessHelper.RegisterExceptionless();
            var viewModel = new MainViewModel(modelHelpers);
            modelHelpers.RefreshModel();
            modelHelpers.SelectRunningTimer();

            DataContext = viewModel;

            gallifrey.NoActivityEvent += GallifreyOnNoActivityEvent;
            gallifrey.ExportPromptEvent += GallifreyOnExportPromptEvent;
            SystemEvents.SessionSwitch += SessionSwitchHandler;

            Height = gallifrey.Settings.UiSettings.Height;
            Width = gallifrey.Settings.UiSettings.Width;
            ThemeHelper.ChangeTheme(gallifrey.Settings.UiSettings.Theme, gallifrey.Settings.UiSettings.Accent);

            if (gallifrey.VersionControl.IsAutomatedDeploy)
            {
                PerformUpdate(false, true);
                var updateHeartbeat = new Timer(TimeSpan.FromMinutes(1).TotalMilliseconds);
                updateHeartbeat.Elapsed += AutoUpdateCheck;
                updateHeartbeat.Enabled = true;
            }

            var idleDetectionHeartbeat = new Timer(TimeSpan.FromSeconds(30).TotalMilliseconds);
            idleDetectionHeartbeat.Elapsed += IdleDetectionCheck;
            idleDetectionHeartbeat.Enabled = true;

            var flyoutOpenCheck = new Timer(100);
            flyoutOpenCheck.Elapsed += FlyoutOpenCheck;
            flyoutOpenCheck.Enabled = true;
        }
コード例 #11
0
ファイル: Error.xaml.cs プロジェクト: BlythMeister/Gallifrey
 public Error(ModelHelpers modelHelpers, Event exceptionlessEvent)
 {
     this.modelHelpers = modelHelpers;
     InitializeComponent();
     DataContext = new ErrorModel(exceptionlessEvent);
 }
コード例 #12
0
 public ProgressDialogHelper(ModelHelpers modelHelpers)
 {
     this.modelHelpers = modelHelpers;
 }
コード例 #13
0
        public ExceptionlessHelper(ModelHelpers modelHelpers)
        {
            this.modelHelpers = modelHelpers;

            modelHelpers.Gallifrey.DailyTrackingEvent += GallifreyOnDailyTrackingEvent;
        }