Esempio n. 1
0
        public MainForm()
        {
            settings = new Settings();
            settings.Load();

            restRequestFactory    = new RestRequestFactory();
            jiraApiRequestFactory = new JiraApiRequestFactory(restRequestFactory);

            restClientFactory         = new RestClientFactory();
            restClientFactory.BaseUrl = this.settings.JiraBaseUrl;

            jiraApiRequester = new JiraApiRequester(restClientFactory, jiraApiRequestFactory);

            jiraClient = new JiraClient(jiraApiRequestFactory, jiraApiRequester);

            InitializeComponent();

            cbFilters.DropDownStyle = ComboBoxStyle.DropDownList;
            cbFilters.DisplayMember = "Name";

            ticker = new Timer();
            // First run should be almost immediately after start
            ticker.Interval = firstDelay;
            ticker.Tick    += ticker_Tick;
        }
Esempio n. 2
0
        public MainForm()
        {
            settings = Settings.Instance;
            if (!settings.Load())
            {
                MessageBox.Show(string.Format("An error occurred while loading settings for Jira StopWatch. Your configuration file has most likely become corrupted.{0}{0}And older configuration file has been loaded instead, so please verify your settings.", Environment.NewLine), "Jira StopWatch");
            }

            Logger.Instance.LogfilePath = Path.Combine(Application.UserAppDataPath, "jirastopwatch.log");
            Logger.Instance.Enabled     = settings.LoggingEnabled;

            restRequestFactory    = new RestRequestFactory();
            jiraApiRequestFactory = new JiraApiRequestFactory(restRequestFactory);

            restClientFactory         = new RestClientFactory();
            restClientFactory.BaseUrl = this.settings.JiraBaseUrl;

            jiraApiRequester = new JiraApiRequester(restClientFactory, jiraApiRequestFactory);

            jiraClient = new JiraClient(jiraApiRequestFactory, jiraApiRequester);

            InitializeComponent();

            pMain.HorizontalScroll.Maximum = 0;
            pMain.AutoScroll             = false;
            pMain.VerticalScroll.Visible = false;
            pMain.AutoScroll             = true;

            Text = string.Format("{0} v. {1}", Application.ProductName, Application.ProductVersion);

            cbFilters.DropDownStyle = ComboBoxStyle.DropDownList;
            cbFilters.DisplayMember = "Name";

            ticker = new System.Windows.Forms.Timer();
            // First run should be almost immediately after start
            ticker.Interval = firstDelay;
            ticker.Tick    += ticker_Tick;

            serialConnection = new SerialConnection(this.settings);

            List <string> comPortNames = new List <string>();

            serialConnection.GetComPorts(comPortNames);

            this.settings.ComPort = comPortNames;

            serialConnection.PositionEvent += new SerialConnection.PositionEventDelegate(PositionEventHandler);


            tcpConnection = new TcpConnection(this.settings);
            tcpConnection.PositionEvent += new TcpConnection.PositionEventDelegate(PositionEventHandler);

            waitForTimeKeepPosition = false;
            issueKeyForNewPosition  = "";
        }
Esempio n. 3
0
        public IssueControl(JiraClient jiraClient, Settings settings)
            : base()
        {
            InitializeComponent();

            Comment = null;

            this.settings = settings;

            this.jiraClient = jiraClient;
            this.WatchTimer = new WatchTimer();
        }
        public IssueControl(JiraClient jiraClient, Settings settings)
            : base()
        {
            InitializeComponent();

            Comment = null;
            EstimateUpdateMethod = EstimateUpdateMethods.Auto;
            EstimateUpdateValue = null;

            this.settings = settings;

            this.jiraClient = jiraClient;
            this.WatchTimer = new WatchTimer();
        }
Esempio n. 5
0
        public MainForm()
        {
            InitializeComponent();

            settings = new Settings();
            jiraClient = new JiraClient();

            cbFilters.DropDownStyle = ComboBoxStyle.DropDownList;
            cbFilters.DisplayMember = "Name";

            LoadSettings();

            ticker = new Timer();
            // First run should be almost immediately after start
            ticker.Interval = firstDelay;
            ticker.Tick += ticker_Tick;
        }
Esempio n. 6
0
        public IssueControl(JiraClient jiraClient)
            : base()
        {
            InitializeComponent();

            cbJira.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            cbJira.DropDownStyle = ComboBoxStyle.DropDown;
            cbJira.DrawMode = DrawMode.OwnerDrawVariable;
            cbJira.DrawItem += cbJira_DrawItem;
            cbJira.MeasureItem += cbJira_MeasureItem;
            cbJira.SelectedIndexChanged += cbJira_SelectedIndexChanged;
            cbJira.DisplayMember = "Key";
            cbJira.ValueMember = "Key";

            this.jiraClient = jiraClient;
            this.WatchTimer = new WatchTimer();
        }
Esempio n. 7
0
        public MainForm()
        {
            settings = Settings.Instance;
            if (!settings.Load())
            {
                MessageBox.Show(string.Format("An error occurred while loading settings for Jira StopWatch. Your configuration file has most likely become corrupted.{0}{0}And older configuration file has been loaded instead, so please verify your settings.", Environment.NewLine), "Jira StopWatch");
            }

            Logger.Instance.LogfilePath = Path.Combine(Application.UserAppDataPath, "jirastopwatch.log");
            Logger.Instance.Enabled     = settings.LoggingEnabled;

            restRequestFactory    = new RestRequestFactory();
            jiraApiRequestFactory = new JiraApiRequestFactory(restRequestFactory);

            restClientFactory         = new RestClientFactory();
            restClientFactory.BaseUrl = this.settings.JiraBaseUrl;

            jiraApiRequester = new JiraApiRequester(restClientFactory, jiraApiRequestFactory, new HttpBasicAuthenticator(this.settings.Username, this.settings.PrivateApiToken));

            jiraClient = new JiraClient(jiraApiRequestFactory, jiraApiRequester);

            InitializeComponent();
            UpdateTheme();

            Text = string.Format("{0} v. {1}", Application.ProductName, Application.ProductVersion);

            cbFilters.DropDownStyle = ComboBoxStyle.DropDownList;
            cbFilters.DisplayMember = "Name";

            ticker = new Timer();
            // First run should be almost immediately after start
            ticker.Interval = firstDelay;
            ticker.Tick    += ticker_Tick;

            UpdateTotalTimeLogged(new TimeSpan());

            this.tabControl.TabPages[this.tabControl.TabCount - 1].Text = "";
            this.tabControl.Padding  = new Point(12, 4);
            this.tabControl.DrawMode = TabDrawMode.OwnerDrawFixed;

            this.tabControl.DrawItem         += tabControl1_DrawItem;
            this.tabControl.MouseDown        += tabControl1_MouseDown;
            this.tabControl.Selecting        += tabControl1_Selecting;
            this.tabControl.HandleCreated    += tabControl1_HandleCreated;
            this.tabControl.MouseDoubleClick += TabControl_MouseDoubleClick;
        }
Esempio n. 8
0
        public MainForm()
        {
            InitializeComponent();

            settings   = new Settings();
            jiraClient = new JiraClient();

            cbFilters.DropDownStyle = ComboBoxStyle.DropDownList;
            cbFilters.DisplayMember = "Name";

            LoadSettings();

            ticker = new Timer();
            // First run should be almost immediately after start
            ticker.Interval = firstDelay;
            ticker.Tick    += ticker_Tick;
        }
Esempio n. 9
0
        public IssueControl(JiraClient jiraClient, Settings settings)
            : base()
        {
            InitializeComponent();

            cbJiraTbEvents            = new ComboTextBoxEvents(cbJira);
            cbJiraTbEvents.Paste     += cbJiraTbEvents_Paste;
            cbJiraTbEvents.MouseDown += CbJiraTbEvents_MouseDown;

            Comment = null;
            EstimateUpdateMethod = EstimateUpdateMethods.Auto;
            EstimateUpdateValue  = null;

            this.settings = settings;

            this.jiraClient = jiraClient;
            this.WatchTimer = new WatchTimer();
        }
Esempio n. 10
0
 private void EditSettings()
 {
     using (var form = new SettingsForm(this.settings))
     {
         if (form.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
         {
             restClientFactory.BaseUrl = this.settings.JiraBaseUrl;
             jiraApiRequester          = new JiraApiRequester(restClientFactory, jiraApiRequestFactory, new HttpBasicAuthenticator(this.settings.Username, this.settings.PrivateApiToken));
             jiraClient = new JiraClient(jiraApiRequestFactory, jiraApiRequester);
             Logging.Logger.Instance.Enabled = settings.LoggingEnabled;
             if (IsJiraEnabled)
             {
                 AuthenticateJira(this.settings.Username, this.settings.PrivateApiToken);
             }
             InitializeIssueControls();
         }
     }
 }
Esempio n. 11
0
        public MainForm()
        {
            InitializeComponent();

            settings   = new Settings();
            jiraClient = new JiraClient();

            cbFilters.DropDownStyle = ComboBoxStyle.DropDownList;
            cbFilters.DisplayMember = "Name";

            LoadSettings();

            ticker = new Timer();
            // First run should be almost immediately after start
            ticker.Interval = firstDelay;
            ticker.Tick    += ticker_Tick;

            Microsoft.Win32.SystemEvents.SessionSwitch += new Microsoft.Win32.SessionSwitchEventHandler(SystemEvents_SessionSwitch);
        }
Esempio n. 12
0
        public MainForm()
        {
            InitializeComponent();

            settings = new Settings();
            jiraClient = new JiraClient();

            cbFilters.DropDownStyle = ComboBoxStyle.DropDownList;
            cbFilters.DisplayMember = "Name";

            LoadSettings();

            ticker = new Timer();
            // First run should be almost immediately after start
            ticker.Interval = firstDelay;
            ticker.Tick += ticker_Tick;

            Microsoft.Win32.SystemEvents.SessionSwitch += new Microsoft.Win32.SessionSwitchEventHandler(SystemEvents_SessionSwitch);
        }
Esempio n. 13
0
        public IssueControl(JiraClient jiraClient)
            : base()
        {
            InitializeComponent();

            cbJira.AutoCompleteMode      = AutoCompleteMode.SuggestAppend;
            cbJira.DropDownStyle         = ComboBoxStyle.DropDown;
            cbJira.DrawMode              = DrawMode.OwnerDrawVariable;
            cbJira.DrawItem             += cbJira_DrawItem;
            cbJira.MeasureItem          += cbJira_MeasureItem;
            cbJira.SelectedIndexChanged += cbJira_SelectedIndexChanged;
            cbJira.DisplayMember         = "Key";
            cbJira.ValueMember           = "Key";

            ignoreTextChange = false;

            Comment = null;

            this.jiraClient = jiraClient;
            this.WatchTimer = new WatchTimer();
        }
Esempio n. 14
0
        public MainForm()
        {
            settings = Settings.Instance;
            if (!settings.Load())
            {
                MessageBox.Show(string.Format("An error occurred while loading settings for Jira StopWatch. Your configuration file has most likely become corrupted.{0}{0}And older configuration file has been loaded instead, so please verify your settings.", Environment.NewLine), "Jira StopWatch");
            }

            Logger.Instance.LogfilePath = Path.Combine(Application.UserAppDataPath, "jirastopwatch.log");
            Logger.Instance.Enabled     = settings.LoggingEnabled;

            restRequestFactory    = new RestRequestFactory();
            jiraApiRequestFactory = new JiraApiRequestFactory(restRequestFactory);

            restClientFactory         = new RestClientFactory();
            restClientFactory.BaseUrl = this.settings.JiraBaseUrl;

            jiraApiRequester = new JiraApiRequester(restClientFactory, jiraApiRequestFactory);

            jiraClient = new JiraClient(jiraApiRequestFactory, jiraApiRequester);

            InitializeComponent();

            pMain.HorizontalScroll.Maximum = 0;
            pMain.AutoScroll             = false;
            pMain.VerticalScroll.Visible = false;
            pMain.AutoScroll             = true;

            Text = string.Format("{0} {1}", Application.ProductName, Application.ProductVersion);

            cbFilters.DropDownStyle = ComboBoxStyle.DropDownList;
            cbFilters.DisplayMember = "Name";

            ticker = new Timer();
            // First run should be almost immediately after start
            ticker.Interval = firstDelay;
            ticker.Tick    += ticker_Tick;

            idleTicker          = new Timer();
            idleTicker.Interval = idleCheckInterval;
            idleTicker.Tick    += idle_Tick;

            runningTicker          = new Timer();
            runningTicker.Interval = runningCheckInterval;
            runningTicker.Tick    += running_Tick;

            backupTicker          = new Timer();
            backupTicker.Interval = backupCheckInterval;
            backupTicker.Tick    += backup_Tick;

            backupTimer = new WatchTimer();

            // load backup timer state
            TimerState backupTimerState = new TimerState
            {
                TotalTime = settings.BackupTimer
            };

            backupTimer.SetState(backupTimerState);

            UpdateBackupTime();
        }
        public void Setup()
        {
            jiraApiRequestFactoryMock = new Mock<IJiraApiRequestFactory>();

            jiraApiRequesterMock = new Mock<IJiraApiRequester>();

            jiraClient = new JiraClient(jiraApiRequestFactoryMock.Object, jiraApiRequesterMock.Object);
        }
Esempio n. 16
0
        public MainForm()
        {
            settings = new Settings();
            settings.Load();

            Logger.Instance.LogfilePath = Path.Combine(Application.UserAppDataPath, "jirastopwatch.log");
            Logger.Instance.Enabled = settings.LoggingEnabled;

            restRequestFactory = new RestRequestFactory();
            jiraApiRequestFactory = new JiraApiRequestFactory(restRequestFactory);

            restClientFactory = new RestClientFactory();
            restClientFactory.BaseUrl = this.settings.JiraBaseUrl;

            jiraApiRequester = new JiraApiRequester(restClientFactory, jiraApiRequestFactory);

            jiraClient = new JiraClient(jiraApiRequestFactory, jiraApiRequester);

            InitializeComponent();

            Text = string.Format("{0} v. {1}", Application.ProductName, Application.ProductVersion);

            cbFilters.DropDownStyle = ComboBoxStyle.DropDownList;
            cbFilters.DisplayMember = "Name";

            ticker = new Timer();
            // First run should be almost immediately after start
            ticker.Interval = firstDelay;
            ticker.Tick += ticker_Tick;
        }