/// <summary> /// Initializes the specified <see cref="DirectShowPropertyControl"/>. /// </summary> /// <param name="propertyControl">The property control.</param> /// <param name="currentValue">The current property value.</param> /// <param name="supportedValueDelegate">A delegate that allows to get camera supported values.</param> private void InitializePropertyControl( DirectShowPropertyControl propertyControl, DirectShowImageQualityPropertyValue currentValue, GetSupportedValuesDelegate supportedValueDelegate) { int defaultValue, minValue, maxValue, stepSize; // get supported values supportedValueDelegate(out minValue, out maxValue, out stepSize, out defaultValue); // initialize control propertyControl.Initialize(currentValue.Value, currentValue.Auto, defaultValue, minValue, maxValue, stepSize); }
/// <summary> /// Handles the Click event of RestoreButton object. /// </summary> private void restoreButton_Click(object sender, EventArgs e) { // for each control in this control foreach (Control control in imageQualityPropertiesGroupBox.Controls) { DirectShowPropertyControl propertiesControl = control as DirectShowPropertyControl; // if current control is property control if (propertiesControl != null) { propertiesControl.RestoreValue(); } } }