using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Tango.Video.DirectCapture { /// /// Used to hold a frame rate value for a CaptureDevice. /// public class FrameRate : INotifyPropertyChanged { /// /// Initializses a new instance of FrameRate. /// public FrameRate() { } /// /// Initializes a new FrameRate instance. /// /// The frame rate. public FrameRate(double rate) : this() { Rate = rate; } private double _rate; /// /// Gets or sets the current frame rate. /// public double Rate { get { return _rate; } set { _rate = value; RaisePropertyChanged("Rate"); } } /// /// Returns a strings representation of the current frame rate. /// /// Frame rate. public override string ToString() { return Rate.ToString("0.#") + " fps"; } private void RaisePropertyChanged(String propName) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propName)); } public event PropertyChangedEventHandler PropertyChanged; } }