コード例 #1
0
        private void GitUiCommandsPreBrowse(object sender, GitUIBaseEventArgs e)
        {
            //Only check at startup when plugin is enabled
            if (!Settings.GetSetting("Enabled (true / false)").Equals("true", StringComparison.InvariantCultureIgnoreCase))
                return;

            int days;
            if (!int.TryParse(Settings.GetSetting("Check every # days"), out days))
                days = 7;

            try
            {
                if (DateTime.ParseExact(
                    Settings.GetSetting("Last check (yyyy/M/dd)"),
                    "yyyy/M/dd",
                    CultureInfo.InvariantCulture).AddDays(days) >= DateTime.Now)
                    return;
            }
            catch (FormatException)
            {
            }
            finally
            {
                Settings.SetSetting("Last check (yyyy/M/dd)",
                                    DateTime.Now.ToString("yyyy/M/dd", CultureInfo.InvariantCulture));
            }

            var updateForm = new Updates(e.GitVersion) {AutoClose = true};
            updateForm.ShowDialog();
        }
コード例 #2
0
        void gitUICommands_PreBrowse(IGitUIEventArgs e)
        {
            //Only check at startup when plugin is enabled
            if (Settings.GetSetting("Enabled (true / false)").Equals("true", StringComparison.InvariantCultureIgnoreCase))
            {
                int days = 0;
                if (!int.TryParse(Settings.GetSetting("Check every # days"), out days))
                    days = 0;

                if (DateTime.ParseExact(Settings.GetSetting("Last check (yyyy/M/dd)"), "yyyy/M/dd", CultureInfo.InvariantCulture).AddDays(7) < DateTime.Now)
                {
                    Settings.SetSetting("Last check (yyyy/M/dd)", DateTime.Now.ToString("yyyy/M/dd", CultureInfo.InvariantCulture));

                    Updates updateForm = new Updates(e.GitVersion);
                    updateForm.AutoClose = true;
                    updateForm.ShowDialog();
                }
            }
        }
コード例 #3
0
        private void GitUiCommandsPreBrowse(object sender, GitUIBaseEventArgs e)
        {
            //Only check at startup when plugin is enabled
            if (!Settings.GetSetting("Enabled (true / false)").Equals("true", StringComparison.InvariantCultureIgnoreCase))
            {
                return;
            }

            int days;

            if (!int.TryParse(Settings.GetSetting("Check every # days"), out days))
            {
                days = 7;
            }

            try
            {
                if (DateTime.ParseExact(
                        Settings.GetSetting("Last check (yyyy/M/dd)"),
                        "yyyy/M/dd",
                        CultureInfo.InvariantCulture).AddDays(days) >= DateTime.Now)
                {
                    return;
                }
            }
            catch (FormatException)
            {
            }
            finally
            {
                Settings.SetSetting("Last check (yyyy/M/dd)",
                                    DateTime.Now.ToString("yyyy/M/dd", CultureInfo.InvariantCulture));
            }

            var updateForm = new Updates(e.GitVersion)
            {
                AutoClose = true
            };

            updateForm.ShowDialog();
        }
コード例 #4
0
 public void Execute(GitUIBaseEventArgs e)
 {
     var updateForm = new Updates(e.GitVersion) {AutoClose = false};
     updateForm.ShowDialog();
 }
コード例 #5
0
 public bool Execute(GitUIBaseEventArgs e)
 {
     var updateForm = new Updates(e.GitVersion) {AutoClose = false};
     updateForm.ShowDialog(e.OwnerForm as IWin32Window);
     return false;
 }
コード例 #6
0
 public void Execute(IGitUIEventArgs e)
 {
     Updates updateForm = new Updates(e.GitVersion);
     updateForm.AutoClose = false;
     updateForm.ShowDialog();
 }
コード例 #7
0
 public override bool Execute(GitUIBaseEventArgs e)
 {
     using (var updateForm = new Updates(e.GitModule.GitVersion) { AutoClose = false })
         updateForm.ShowDialog(e.OwnerForm);
     return false;
 }