public void OnClick(object sender, EventArgs e) { IButtonMetadata meta = PluginManager.GetMedadata(); MessageBox.Show(string.Format("{0} has been pressed\r\n\r\nDataGrid contains {1} rows", meta.Text, PluginManager.DataGrid.Rows.Count), this.GetType().Assembly.GetName().Name, MessageBoxButtons.OK); PluginLogger.Debug("{0} has been pressed", meta.Text); }
public static void LogAsDebug(this object message) { var method = new StackFrame(1).GetMethod(); string caller = method.DeclaringType.ToString() + "." + method.Name; PluginLogger.Debug(caller + "|" + message ?? "<null>"); }
public void OnClick(object sender, EventArgs e) { IMenuMetadata meta = PluginManager.GetMedadata(); MessageBox.Show(string.Format("{0} has been pressed", meta.Text), this.GetType().Assembly.GetName().Name, MessageBoxButtons.OK); PluginLogger.Debug("{0} has been pressed", meta.Text); }
public static void LogAsDebugAsync(this object message, int asyncDelay = 0) { Task.Factory.StartNew(() => { if (asyncDelay > 0) { System.Threading.Thread.Sleep(asyncDelay); } PluginLogger.Debug(message); }); }
public void SubMenuOnClick(object sender, EventArgs e) { MessageBox.Show(string.Format("{0} has been pressed", ((ToolStripMenuItem)sender).Text), this.GetType().Assembly.GetName().Name, MessageBoxButtons.OK); PluginLogger.Debug("{0} has been pressed", ((ToolStripMenuItem)sender).Text); }