Ejemplo n.º 1
0
        public void LogInfo(IHostWindow host, string source, string message)
        {
            ListViewItem lviMain = new ListViewItem();

            lviMain.Text       = "Info";
            lviMain.ImageIndex = 0;

            ListViewItem.ListViewSubItem lviHostWindow = new ListViewItem.ListViewSubItem();
            lviHostWindow.Text = host.Title;

            ListViewItem.ListViewSubItem lviMessage = new ListViewItem.ListViewSubItem();
            lviMessage.Text = message;

            ListViewItem.ListViewSubItem lviSource = new ListViewItem.ListViewSubItem();
            lviSource.Text = source;

            lviMain.SubItems.Add(lviHostWindow);
            lviMain.SubItems.Add(lviMessage);
            lviMain.SubItems.Add(lviSource);

            itemDictionary[host.Title].Add(lviMain);
            if (selectedWindowTitle == "All" || selectedWindowTitle == host.Title)
            {
                listViewLog.Items.Add(lviMain);
            }

            if (WindowState == FormWindowState.Minimized && host.Settings.NotifyOnLoggedInfo)
            {
                host.ShowNotification(1000, "Console Info", message, ToolTipIcon.Info);
            }
        }
Ejemplo n.º 2
0
        public void logError(IHostWindow host, string msg, string url, string line, string col, string error)
        {
            ListViewItem lviMain = new ListViewItem();

            lviMain.Text       = "Error";
            lviMain.ImageIndex = 2;

            ListViewItem.ListViewSubItem lviHostWindow = new ListViewItem.ListViewSubItem();
            lviHostWindow.Text = host.Title;

            ListViewItem.ListViewSubItem lviSource = new ListViewItem.ListViewSubItem();
            lviSource.Text = url;

            ListViewItem.ListViewSubItem lviLine = new ListViewItem.ListViewSubItem();
            lviLine.Text = line;

            ListViewItem.ListViewSubItem lviCol = new ListViewItem.ListViewSubItem();
            lviCol.Text = col;

            ListViewItem.ListViewSubItem lviMessage = new ListViewItem.ListViewSubItem();
            lviMessage.Text = msg;

            lviMain.SubItems.Add(lviHostWindow);
            lviMain.SubItems.Add(lviMessage);
            lviMain.SubItems.Add(lviSource);
            lviMain.SubItems.Add(lviLine);
            lviMain.SubItems.Add(lviCol);

            itemDictionary[host.Title].Add(lviMain);
            if (selectedWindowTitle == "All" || selectedWindowTitle == host.Title)
            {
                listViewLog.Items.Add(lviMain);
            }

            if (WindowState == FormWindowState.Minimized && host.Settings.NotifyOnLoggedErrors)
            {
                host.ShowNotification(1000, "Console Error", msg, ToolTipIcon.Error);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Displays a windows system tray notification.
 /// </summary>
 /// <param name="title">The notification title.</param>
 /// <param name="message">The notification message.</param>
 public void ShowNotification(string title, string message)
 {
     host.ShowNotification(2000, title, message, System.Windows.Forms.ToolTipIcon.Info);
 }