public void GetSvnInfo(Rainmeter.Settings.InstanceSettings Instance) { path = Instance.INI_Value("LocalRepoPath"); WriteBatch(); var alias = Instance.INI_Value("RepoAlias"); var logLimit = Convert.ToInt16(Instance.INI_Value("LogLimit")); var p = new Process { StartInfo = { CreateNoWindow = true, UseShellExecute = false, RedirectStandardOutput = true, FileName = bat, Arguments = path, WindowStyle = ProcessWindowStyle.Hidden } }; p.StartInfo.UseShellExecute = false; p.Start(); string output = p.StandardOutput.ReadToEnd(); p.WaitForExit(); svn = new SvnInfo(alias, output, logLimit); }
public string GetString(Rainmeter.Settings.InstanceSettings Instance) { var counter = 0; var updateCounter = 1; var retVal = "Error"; if (!String.IsNullOrEmpty(Instance.GetVariable("counter"))) counter = Convert.ToInt32(Instance.GetVariable("counter")); if (!String.IsNullOrEmpty(Instance.INI_Value("UpdateDivider"))) updateCounter = Convert.ToInt32(Instance.INI_Value("UpdateDivider")); if (!String.IsNullOrEmpty(Instance.GetVariable("retVal"))) retVal = Instance.GetVariable("retVal"); if (!String.IsNullOrEmpty(Instance.INI_Value("Width"))) width = Convert.ToInt16(Instance.INI_Value("Width")); if (counter % updateCounter == 0) { try { GetSvnInfo(Instance); retVal = svn.Alias + new string(' ', width - svn.Alias.Length - svn.Updates.Length) + svn.Updates; Instance.SetVariable("retVal", retVal); } catch (Exception e) { Debug.Write("Exception", e.ToString()); } return retVal; } else { Instance.SetVariable("counter", counter++); return retVal; } }