void LogMessage(string message)
        {
            DebugPane.Activate();
            DebugPane.OutputString(string.Format("{0}: {1} \r\n", PackageName, message));

            if (optionsPage.LoggingEnabled)
            {
                logger.Info(message);
            }
        }
示例#2
0
        private void MenuItemCallback(object sender, EventArgs e)
        {
            try
            {
                var processesKilled = CassiniUtil.KillAllCassiniInstances();

                DebugPane.Activate();
                DebugPane.OutputString($"{PackageName}: Mission Acquired. Hunting... \r\n");
                processesKilled.ForEach(p => DebugPane
                                        .OutputString($"{PackageName}: Killed {p.Name}: Id= {p.Id}, Handle= {p.Handle}.\r\n"));
                TaskBarUtil.RefreshNotificationArea();
                DebugPane.OutputString($"{PackageName}: Over and Out. \r\n");
            }
            catch (Exception exception)
            {
                Trace.WriteLine(CultureInfo.CurrentCulture, $"Exception: {exception.Message}");
            }
        }