Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
        public void Execute(GitUIBaseEventArgs e)
        {
            var updateForm = new Updates(e.GitVersion)
            {
                AutoClose = false
            };

            updateForm.ShowDialog();
        }
Ejemplo n.º 3
0
 public bool Execute(GitUIBaseEventArgs e)
 {
     using (var updateForm = new Updates(e.GitModule.GitVersion)
     {
         AutoClose = false
     })
         updateForm.ShowDialog(e.OwnerForm as IWin32Window);
     return(false);
 }
Ejemplo n.º 4
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();
                }
            }
        }
Ejemplo n.º 5
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();
        }
Ejemplo n.º 6
0
 public void Execute(GitUIBaseEventArgs e)
 {
     var updateForm = new Updates(e.GitVersion) {AutoClose = false};
     updateForm.ShowDialog();
 }
Ejemplo n.º 7
0
 public bool Execute(GitUIBaseEventArgs e)
 {
     var updateForm = new Updates(e.GitVersion) {AutoClose = false};
     updateForm.ShowDialog(e.OwnerForm as IWin32Window);
     return false;
 }
Ejemplo n.º 8
0
 public void Execute(IGitUIEventArgs e)
 {
     Updates updateForm = new Updates(e.GitVersion);
     updateForm.AutoClose = false;
     updateForm.ShowDialog();
 }
Ejemplo n.º 9
0
 public override bool Execute(GitUIBaseEventArgs e)
 {
     using (var updateForm = new Updates(e.GitModule.GitVersion) { AutoClose = false })
         updateForm.ShowDialog(e.OwnerForm);
     return false;
 }