private void LogFileUpdatedCallback(object sender, LogChangedEventArgs context) { _hasSeenErrorLogUpdate = !context.LogFileStatus.HasContent; _latestUpdatedLogFileStatus = context.LogFileStatus; UpdateOpenErrorLogCommandAccessibilityAndText(context.LogFileStatus); }
private void LogService_LogChanged(object sender, LogChangedEventArgs e) { LogText.text = e.Message + Environment.NewLine + LogText.text; if (LogText.text.Length > 1000) { LogText.text = LogText.text.Substring(0, 1000); } }
private void LogProviderOnLogChanged(object sender, LogChangedEventArgs logChangedEventArgs) { _uiContext.Send(state => { lock (MainWindow._lock) { _lastCount = (int)_logContext.LogProvider.Count; CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); } }, null); }
/// <summary> /// Executes the command, requesting all of the logdata from the service and returning it to the caller. /// </summary> /// <param name="args">args[1] is the message and args[0] is type</param> /// <param name="result">Speficies if the command executed corretly.</param> /// <returns>Eventargs containing the log infromation.</returns> string ICommand.Execute(string[] args, out bool result) { if (args != null && args.Length > 0) { result = true; LogsList.Add(new ISPair((MessageTypeEnum)int.Parse(args[0]), args[1])); return(""); } result = true; return(LogChangedEventArgs.CompleteLogToJSON(LogsList)); }
//TODO write the event args normally might cause bug due to multiple threads writing together public void OnLogChange(object sender, LogChangedEventArgs e) { foreach (var client in clients) { try { using (NetworkStream stream = client.GetStream()) using (StreamWriter writer = new StreamWriter(stream)) { writer.Write(e.ToString()); } } catch (Exception ex) { Console.WriteLine("error socket {0}", ex.Message); CloseClient(client); } } }
/// <summary> /// An event that is called when the service processes an image. /// Increments the photo ammount counter. /// </summary> /// <param name="sender">The service probably, not used</param> /// <param name="args">Also not used</param> public void PhotoAdded(object sender, LogChangedEventArgs args) { PhotoAmount++; }
private void TraceListenerOnLogChanged(object sender, LogChangedEventArgs e) { _stringBuilder.Append(e.Message); Log = _stringBuilder.ToString(); }
/// <summary> /// Function that is called when the log data has changed and the clients using the data (such as the gui) need to be updated. /// </summary> /// <param name="sender">The service.</param> /// <param name="args">args containing information about the changed log data.</param> public void OnLogChange(object sender, LogChangedEventArgs args) { LogsList.Add(new ISPair((MessageTypeEnum)args.Type, args.Message)); }
private void _OnLogChanged(object sender, LogChangedEventArgs e) { //AddItemThreadSafe(progressTextLabel, e.Time + " | " + e.Log); }