System.Drawing.Size.Equals C# (CSharp) Метод

Equals() публичный Метод

Tests to see whether the specified object is a with the same dimensions as this .

public Equals ( object obj ) : bool
obj object
Результат bool
        public override bool Equals(object obj)
        {
            if (!(obj is Size))
                return false;

            Size comp = (Size)obj;
            return (comp._width == _width) && (comp._height == _height);
        }

Usage Example

 private void setVideoResolution()
 {
     for (int i = 0; i < _vSource.VideoCapabilities.Length; i++)
     {
         if (_currentResolution.Equals(_vSource.VideoCapabilities[i].FrameSize))
         {
             _vSource.VideoResolution = _vSource.VideoCapabilities[i];
         }
     }
 }
All Usage Examples Of System.Drawing.Size::Equals