private void UpdateCameraControls()
{
if (this.InvokeRequired)
{
this.Invoke(new Action(this.UpdateCameraControls));
return;
}
var camera = this.GetSelectedCamera();
if (camera == null)
{
_liveViewButton.Enabled = false;
_takePictureButton.Enabled = false;
}
else
{
try
{
if (camera.IsInHostLiveViewMode)
{
_liveViewButton.Text = Resources.StopLiveViewButtonLabel;
_takePictureButton.Enabled = false;
_liveViewPictureButton.Enabled = true;
}
else
{
_liveViewButton.Text = Resources.StartLiveViewButtonLabel;
_takePictureButton.Enabled = true;
_liveViewPictureButton.Enabled = false;
}
_liveViewButton.Enabled = true;
}
catch (EosException)
{
_liveViewButton.Text = Resources.LiveViewNotSupportedButtonLabel;
_takePictureButton.Enabled = false;
}
}
}