protected virtual void OnFileUpdated(FileUpdatedEventArgs e) { if (FileUpdated != null) { FileUpdated(this, e); } }
private void FileWatch_Updated(object sender, FileUpdatedEventArgs e) { this.UpdateFile(e.FullPath); }
void Worker_FileUpdated(object sender, FileUpdatedEventArgs e) { Binding.FireChange(x => x.File); UpdateState(); UpdateSize(); }
/// <summary> /// Custom code executed when the file has been updated. Waits 100ms to ensure the file has had chance to close. /// Enqueues any newly read values. /// </summary> /// <param name="source">System.</param> /// <param name="e">Updated File arguments.</param> private void OnFileUpdateEvent(object source, FileUpdatedEventArgs e) { Thread.Sleep(100); string fileText = ReadFile(); if (fileText != "") { _lastIncomingMessage = DateTime.Now; string info = "Incoming data received from {0}: '{1}'"; info = string.Format(info, _fileName, fileText); DebugOutput.Print(info); EnqueueData(new Value() { Type = ValueType.String, EventTime = DateTime.Now, StringValue = fileText, Inbound = true }); //InboundDataQueue.Enqueue(new Value() //{ // ValueType = ValueType.String, // CommType = CommunicatorType.FlatFile, // EventTime = DateTime.Now, // StringValue = fileText, // Inbound = true //}); } }