public static BitmapImage GetLogIcon(LogIcon image) { switch (image) { case LogIcon.Error: return(new BitmapImage(new Uri(@"pack://*****:*****@"pack://application:,,,/Images/LogIcons/Start.png"))); case LogIcon.Success: return(new BitmapImage(new Uri(@"pack://*****:*****@"pack://application:,,,/Images/LogIcons/Warning.png"))); case LogIcon.Info: return(new BitmapImage(new Uri(@"pack://*****:*****@"pack://application:,,,/Images/LogIcons/Buy.png"))); case LogIcon.Item: return(new BitmapImage(new Uri(@"pack://*****:*****@"pack://application:,,,/Images/LogIcons/Item - No Price.png"))); case LogIcon.Notification: return(new BitmapImage(new Uri(@"pack://application:,,,/Images/LogIcons/Notification.png"))); } return(null); }
private void UpdateLog(LogIcon icon, string message) { Pixbuf pb; string messageType; string timeStr = DateTime.Now.ToShortTimeString(); switch (icon) { case LogIcon.Info: pb = infoIcon; messageType = "[ INFO ]"; break; case LogIcon.Warning: pb = warningIcon; messageType = "[WARNING]"; break; case LogIcon.Error: pb = errorIcon; messageType = "[ ERROR ]"; break; default: throw new Exception("Invalid LogIcon"); } logStore.AppendValues(pb, timeStr, message); scannerLog.AppendFormat("[{0}] {1} {2}\n", timeStr, messageType, message); }
private void updateStatus(string entry, LogIcon icon = LogIcon.Ready, bool displayTime = true, bool onlyStatusBar = false) { if (statusUpdated != null) statusUpdated(entry); if (onlyStatusBar) { labelStatus.GetCurrentParent().HybridInvoke(() => labelStatus.Text = entry); } else { Console.ProgramLog.Add(new LogEntry(entry, icon)); lsvLog.HybridInvoke(() => { if (lsvLog.Items.Count > 0 && showTime) { lsvLog.Items[lsvLog.Items.Count - 1].SubItems.Add((getTimeSinceLastCheck().TotalMilliseconds / 1000).ToString("F2") + "s"); } showTime = displayTime; switch (icon) { case LogIcon.Error: case LogIcon.Warning: lsvLog.Items.Add(entry, (int)icon); break; default: lsvLog.Items.Add(entry, (int)icon); labelStatus.Text = entry; break; } }); } }
private static extern SpriteTexture Internal_GetLogIcon(LogIcon icon, int size, bool dark);
/// <summary> /// Retrieves an icon that represents different types of log entries. /// </summary> /// <param name="icon">Type of icon to retrieve.</param> /// <param name="size">Size of the icon in pixels. Nearest available size will be returned.</param> /// <param name="dark">Controls should the dark or light version of the icon be returned.</param> /// <returns>Sprite texture of the icon.</returns> public static SpriteTexture GetLogIcon(LogIcon icon, int size, bool dark) { return(Internal_GetLogIcon(icon, size, dark)); }
/// <summary> /// Retrieves an icon that represents different types of log entries. /// </summary> /// <param name="icon">Type of icon to retrieve.</param> /// <param name="size">Size of the icon in pixels. Nearest available size will be returned.</param> /// <param name="dark">Controls should the dark or light version of the icon be returned.</param> /// <returns>Sprite texture of the icon.</returns> public static SpriteTexture GetLogIcon(LogIcon icon, int size, bool dark) { return Internal_GetLogIcon(icon, size, dark); }
private void UpdateLog(LogIcon icon, string message) { Pixbuf pb; string messageType; string timeStr = DateTime.Now.ToShortTimeString(); switch(icon) { case LogIcon.Info: pb = infoIcon; messageType = "[ INFO ]"; break; case LogIcon.Warning: pb = warningIcon; messageType = "[WARNING]"; break; case LogIcon.Error: pb = errorIcon; messageType = "[ ERROR ]"; break; default: throw new Exception("Invalid LogIcon"); } logStore.AppendValues(pb, timeStr, message); scannerLog.AppendFormat("[{0}] {1} {2}\n", timeStr, messageType, message); }
public DisplayLogItem(string logText, LogIcon logImage) { this.LogImage = GetLogIcon(logImage); this.LogText = logText; }
public void AppendLogText(LogIcon icon, int line, string text) { string sLine = line.ToString(); if(line == -1) //line-Werte von -1 werden nicht dargestellt! sLine = ""; if(icon == LogIcon.Note){ //Darstellung des Note-Pics (Ausrufezeichen) ListViewItem item = this.lstv.Items.Add("",0); item.SubItems.Add(sLine); item.SubItems.Add(text); } if(icon == LogIcon.Error){ //Darstellung des Error-Pics (X) ListViewItem item = this.lstv.Items.Add("",1); item.SubItems.Add(sLine); item.SubItems.Add(text); } if(icon == LogIcon.Question){ //Darstellung des Question-Pics (Fragezeichen) ListViewItem item = this.lstv.Items.Add("",2); item.SubItems.Add(sLine); item.SubItems.Add(text); } }