public string GetString(Rainmeter.Settings.InstanceSettings Instance) { try { MeasureResult result = Measure(Instance); return(result.AsString(Instance)); } catch (Exception e) { Rainmeter.Log(Rainmeter.LogLevel.Error, "Sorry, " + e.ToString()); return("Sorry, " + e.ToString()); } }
public double Update2(Rainmeter.Settings.InstanceSettings Instance) { try { MeasureResult result = Measure(Instance); return(result.AsDouble(Instance)); } catch (Exception e) { Rainmeter.Log(Rainmeter.LogLevel.Error, "Sorry, " + e.ToString()); return(double.NaN); } }
public void Go() { this.Instance.SetTempValue("__RMT_EB_AlreadyRunning", true); try { new OutlookPlugin().ExecuteBang(this.Instance, this.Command); } catch (Exception ex) { Rainmeter.Log(Rainmeter.LogLevel.Error, "C# plugin in GetString(), " + ex.GetType().ToString() + ": " + ex.Message); } this.Instance.SetTempValue("__RMT_EB_AlreadyRunning", false); }
public void Go() { this.Instance.SetTempValue("__RMT_U2_AlreadyRunning", true); try { this.Instance.SetTempValue("__RMT_U2_LastValue", new OutlookPlugin().Update2(this.Instance)); } catch (Exception ex) { Rainmeter.Log(Rainmeter.LogLevel.Error, "C# plugin in GetString(), " + ex.GetType().ToString() + ": " + ex.Message); } this.Instance.SetTempValue("__RMT_U2_AlreadyRunning", false); }
// '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) { //string[] args = Command.Split(' '); //Command = args[0]; try { switch (Command) { case "ClearCache": resetId++; return; } MeasureResult mr = Measure(Instance); mr.Bang(GetOutlook(), Command); } catch (Exception e) { Rainmeter.Log(Rainmeter.LogLevel.Error, e.ToString()); } return; }