private unsafe static string PluginBridge(string sCommand, string sData) { try { return(new string(PluginBridge(Rainmeter.String(sCommand), Rainmeter.String(sData)))); } catch { } return(string.Empty); }
// If an INI is missing, a blank string will be returned to avoid raising exceptions private unsafe static string ReadConfigString(string sSection, string sKey) { try { char *szString = ReadConfigString(Rainmeter.String(sSection), Rainmeter.String(sKey), Rainmeter.String(string.Empty)); if (szString != null) { return(new string(szString)); } } catch { } return(string.Empty); }
public unsafe static char *GetPluginAuthor() { if (!string.IsNullOrEmpty(Plugin.Email) && !string.IsNullOrEmpty(Plugin.Comments)) { return(Rainmeter.String(Plugin.Author + " (" + Plugin.Email + "): " + Plugin.Comments)); } if (!string.IsNullOrEmpty(Plugin.Email)) { return(Rainmeter.String(Plugin.Author + " (" + Plugin.Email + ")")); } if (!string.IsNullOrEmpty(Plugin.Comments)) { return(Rainmeter.String(Plugin.Author + ": " + Plugin.Comments)); } return(Rainmeter.String(Plugin.Author)); }
// You can call this function directly to log to Rainmeter.log // // Rainmeter needs to be configured to allow debug logging, of course. public static unsafe bool Log(LogLevel level, string sText) { return(Rainmeter.LSLog((int)level, Rainmeter.String("C# plugin"), Rainmeter.String(sText)) != 0); }
/// <summary> /// Rainmeter's request for text data from the plugin. /// </summary> /// <param name="id">The unique instance ID of this request.</param> /// <param name="flags">Unused still as of Dec 2nd, 2010.</param> /// <returns></returns> public unsafe static char *GetString(UInt32 id, UInt32 flags) { // Do not modify this member. Instead, update your code in 'OutlookPlugin.cs'. return(Rainmeter.String(new YourPlugin().GetString(Plugin, id))); }