Skip to content

Commit

Permalink
Update settings to load set volume correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktar Karpach committed Mar 29, 2018
1 parent 285f237 commit a3c892c
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ public ChromecastCommandSettingsForm(ChromecastCommandSettings settings)
Settings = settings;
_txtCommandName.Text = Settings.CommandName;
_txtDelay.Text = Settings.ExecutionDelay?.ToString() ?? "0";
_tbVolume.Enabled = Settings.Volume.HasValue;
if (settings.Volume.HasValue)
{
_tbVolume.Value = (int)(settings.Volume.Value * 10);
}
_chkVolume.Checked = Settings.Volume.HasValue;
Task.Factory.StartNew(async () => {
string[] receivers = (await new DeviceLocator().FindReceiversAsync()).Select(r => r.FriendlyName).ToArray();
_cbxChromeCast.DataSource = receivers;
Expand Down Expand Up @@ -125,8 +131,7 @@ private void InitializeComponent()
this._cbxChromeCast.TabIndex = 2;
//
// _tbVolume
//
this._tbVolume.Enabled = false;
//
this._tbVolume.Location = new System.Drawing.Point(151, 118);
this._tbVolume.Name = "_tbVolume";
this._tbVolume.Size = new System.Drawing.Size(234, 45);
Expand Down

0 comments on commit a3c892c

Please sign in to comment.