public void LoadFile() { var openFileDialog = new OpenFileDialog { DefaultExt = ".log", Filter = "Log files (.log)|*.log|Text files (.txt)|*.txt|All files (*.*)|*.*", Multiselect = true }; bool?selected = openFileDialog.ShowDialog(); if (selected != true) { return; } foreach (var filePath in openFileDialog.FileNames) { if (Files.Any(f => f.FilePath == filePath)) { continue; } var tailFile = new TailFile(filePath); Files.Add(tailFile); _tailReader.AddFile(tailFile); } }
public ChangeColorViewModel(TailFile file) { _file = file; }
public void LoadFile() { var openFileDialog = new OpenFileDialog { DefaultExt = ".log", Filter = "Log files (.log)|*.log|Text files (.txt)|*.txt|All files (*.*)|*.*", Multiselect = true }; bool? selected = openFileDialog.ShowDialog(); if (selected != true) return; foreach (var filePath in openFileDialog.FileNames) { if (Files.Any(f => f.FilePath == filePath)) continue; var tailFile = new TailFile(filePath); Files.Add(tailFile); _tailReader.AddFile(tailFile); } }
public void AddFile(TailFile tailFile) { _tailFiles.Add(tailFile); }