public bool GetCameraPropertyRange(CameraControlProperty property, out int minValue, out int maxValue, out int stepSize, out int defaultValue, out CameraControlFlags controlFlags)
{
bool flag = true;
if (deviceMoniker == null || string.IsNullOrEmpty(deviceMoniker))
{
throw new ArgumentException("Video source is not specified.");
}
lock (sync)
{
object obj = null;
try
{
obj = FilterInfo.CreateFilter(deviceMoniker);
}
catch
{
throw new ApplicationException("Failed creating device object for moniker.");
}
if (!(obj is IAMCameraControl))
{
throw new NotSupportedException("The video source does not support camera control.");
}
IAMCameraControl iAMCameraControl = (IAMCameraControl)obj;
int range = iAMCameraControl.GetRange(property, out minValue, out maxValue, out stepSize, out defaultValue, out controlFlags);
flag = (range >= 0);
Marshal.ReleaseComObject(obj);
return(flag);
}
}