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; } }
public static int ConfigHeight(Rainmeter.Settings.InstanceSettings Instance) { IntPtr hwnd = (IntPtr)(UInt32.Parse(Rainmeter.PluginBridge("GetWindow", Rainmeter.PluginBridge("GetConfig", Instance.INI_File)))); RECT rct; GetWindowRect(hwnd, out rct); return rct.Bottom - rct.Top; }
public UpdateThread(Rainmeter.Settings.InstanceSettings _Instance) { this.Instance = _Instance; }
public GetStringThread(Rainmeter.Settings.InstanceSettings _Instance) { this.Instance = _Instance; }
public ExecuteBangThread(Rainmeter.Settings.InstanceSettings _Instance, string _Command) { this.Instance = _Instance; this.Command = _Command; }
public double Update2(Rainmeter.Settings Plugin, UInt32 id) { bool bAlreadyRunning = (bool)Plugin.Instances[id].GetTempValue("__RMT_U2_AlreadyRunning", false); if (!bAlreadyRunning) { Update2Thread thread_details = new Update2Thread(Plugin.Instances[id]); Thread thread = new Thread(new ThreadStart(thread_details.Go)); thread.Start(); } try { return (double)Plugin.Instances[id].GetTempValue("__RMT_U2_LastValue", 0.0); } catch { return 0.0; } }
public string GetString(Rainmeter.Settings Plugin, UInt32 id) { bool bAlreadyRunning = (bool)Plugin.Instances[id].GetTempValue("__RMT_GS_AlreadyRunning", false); if (!bAlreadyRunning) { GetStringThread thread_details = new GetStringThread(Plugin.Instances[id]); Thread thread = new Thread(new ThreadStart(thread_details.Go)); thread.Start(); } try { return (string)Plugin.Instances[id].GetTempValue("__RMT_GS_LastValue", string.Empty); } catch { return string.Empty; } }
public void ExecuteBang(Rainmeter.Settings Plugin, UInt32 id, string sArguments) { bool bAlreadyRunning = (bool)Plugin.Instances[id].GetTempValue("__RMT_EB_AlreadyRunning", false); if (!bAlreadyRunning) { ExecuteBangThread thread_details = new ExecuteBangThread(Plugin.Instances[id], sArguments); Thread thread = new Thread(new ThreadStart(thread_details.Go)); thread.Start(); } return; }
public static string SkinName(Rainmeter.Settings.InstanceSettings Instance) { try { return Instance.ConfigName; /* if (Instance.GetTempValue("_internal_SkinPath", string.Empty).ToString() == string.Empty) { string sAppDataPath = System.Environment.GetEnvironmentVariable("AppData").Trim(); string sRainmeterINIText = System.IO.File.ReadAllText(sAppDataPath + "\\Rainmeter\\Rainmeter.ini"); string sSkinPath = Chopper(sRainmeterINIText.Replace('\n', '\r'), "SkinPath=", "\r").Trim().TrimEnd(new char[] { '\\' }); Instance.SetTempValue("_internal_SkinPath", sSkinPath); } System.IO.FileInfo fi = new System.IO.FileInfo(Instance.INI_File); return fi.DirectoryName.Replace(Instance.GetTempValue("_internal_SkinPath", string.Empty).ToString(), string.Empty).TrimEnd(new char[] { '\\' }).TrimStart(new char[] { '\\' }); */ } catch { } return string.Empty; }
// Call this function to determine if the parent skin is topmost public static bool ParentIsTopmost(Rainmeter.Settings.InstanceSettings Instance) { IntPtr hwnd = (IntPtr)(UInt32.Parse(Rainmeter.PluginBridge("GetWindow", Rainmeter.PluginBridge("GetConfig", Instance.INI_File)))); WINDOWINFO info = new WINDOWINFO(true); GetWindowInfo(hwnd, ref info); return ((info.dwExStyle & 0x00000008L) > 0); }
public static IntPtr GetConfigWindow(Rainmeter.Settings.InstanceSettings Instance) { return (IntPtr)(UInt32.Parse(Rainmeter.PluginBridge("GetWindow", Rainmeter.PluginBridge("GetConfig", Instance.INI_File)))); }
// 'ExecuteBang' is a way of Rainmeter telling your plugin to do something *right now*. // What it wants to do can be defined by the 'Command' parameter. public void ExecuteBang(Rainmeter.Settings.InstanceSettings Instance, string Command) { return; }
public double Update2(Rainmeter.Settings.InstanceSettings Instance) { return 7.0; }
// 'Update', 'Update2', and 'GetString' all return data back to Rainmeter, depending on // if the Rainmeter measure wants a numeric value or a string/text data. // // The 'Instance' member contains all of the data necessary to read the INI file // passed to your plugin when this instance was first initialized. Remember: your plugin // may be initialized multiple times. For example, a plugin that reads the free space // of a hard drive may be called multiple times -- once for each installed hard drive. public UInt32 Update(Rainmeter.Settings.InstanceSettings Instance) { return 7; }