private void SetPropertyValue(object sender, EventArgs e) { PropertyControlSave pc = (PropertyControlSave)sender; int value = pc.GetValue(); bool auto = pc.GetAutoMode(); if (Object.ReferenceEquals(pc.GetProperty().GetType(), new CameraControlProperty().GetType())) { pCameraControl.Set((CameraControlProperty)pc.GetProperty(), value, auto ? CameraControlFlags.Auto : CameraControlFlags.Manual); } else { // VideoProcAmpProperty pVideoProcAmp.Set((VideoProcAmpProperty)pc.GetProperty(), value, auto ? VideoProcAmpFlags.Auto : VideoProcAmpFlags.Manual); } }
public void SyncValue(PropertyControlSave pc) { trackBar.Value = pc.GetValue(); cbAuto.Checked = pc.GetAutoMode(); }