using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Tango.Video.DirectCapture { /// /// Holds a resolution (width and height) for a DeviceCapture object. /// public class Resolution : INotifyPropertyChanged { /// /// Initializes a new instance of Resolution. /// public Resolution() { } /// /// Initializes a new instance of Resoultion. /// /// desired frame width. /// desired frame height. public Resolution(int width, int height) : this() { Width = width; Height = height; } private int _width; /// /// Gets or sets the current frame width. /// public int Width { get { return _width; } set { _width = value; RaisePropertyChanged("Width"); } } private int _height; /// /// Gets or sets the current frame height. /// public int Height { get { return _height; } set { _height = value; RaisePropertyChanged("Height"); } } /// /// Returns a string representation of the current resolution. /// /// public override string ToString() { return Width + "x" + Height; } private void RaisePropertyChanged(String propName) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propName)); } public event PropertyChangedEventHandler PropertyChanged; } }