/// <summary> /// Creates an OxTailFileViewer instance and starts viewing the specified filename. /// </summary> /// <param name="filename">The full file path of the file to view.</param> public OxTailFileWatcher(string filename) { this.Header = Path.GetFileName(filename); this.ToolTip = filename; this.Uid = filename; this.Interval = 1000; this._streamReader = new StreamReader(FileHelper.OpenFile(filename)); this._grid = new Grid(); this.Visibility = System.Windows.Visibility.Visible; this.AddChild(this._grid); this._viewer = new ColourfulListView(); this._viewer.Visibility = System.Windows.Visibility.Visible; this._grid.Children.Add(this._viewer); this._bw = new BackgroundWorker(); this._bw.WorkerSupportsCancellation = true; this._bw.DoWork += new DoWorkEventHandler(_bw_DoWork); this._bw.RunWorkerAsync(); this.GotFocus += new RoutedEventHandler(OxTailFileViewer_GotFocus); }
/// <summary> /// Creates an OxTailFileViewer instance and starts viewing the specified filename. /// </summary> /// <param name="filename">The full file path of the file to view.</param> public OxTailFileViewer(string filename) { this.Header = Path.GetFileName(filename); this.ToolTip = filename; this.Uid = filename; this.Interval = 1000; this._streamReader = new StreamReader(FileHelper.OpenFile(filename)); this._grid = new Grid(); this.Visibility = System.Windows.Visibility.Visible; this.AddChild(this._grid); this._viewer = new ColourfulListView(); this._viewer.Visibility = System.Windows.Visibility.Visible; this._grid.Children.Add(this._viewer); this._bw = new BackgroundWorker(); this._bw.WorkerSupportsCancellation = true; this._bw.DoWork += new DoWorkEventHandler(_bw_DoWork); this._bw.RunWorkerAsync(); this.GotFocus += new RoutedEventHandler(OxTailFileViewer_GotFocus); }