/// <summary> /// Replaces the gui controls by the ones that are bound to the settings. /// this is a fugly way to do it, but the gui designer doesn't allow us to ref CECSettings, since it uses symbols from LibCecSharp /// </summary> public void InitialiseSettingsComponent(CECSettings settings) { settings.OverridePhysicalAddress.ReplaceControls(this, Configuration.Controls, cbOverrideAddress); settings.OverrideTVVendor.ReplaceControls(this, Configuration.Controls, cbVendorOverride); settings.PhysicalAddress.ReplaceControls(this, Configuration.Controls, tbPhysicalAddress); settings.DetectPhysicalAddress.ReplaceControls(this, Configuration.Controls, cbDetectAddress); settings.HDMIPort.ReplaceControls(this, Configuration.Controls, lPortNumber, cbPortNumber); settings.ConnectedDevice.ReplaceControls(this, Configuration.Controls, lConnectedDevice, cbConnectedDevice); settings.DeviceType.ReplaceControls(this, Configuration.Controls, lDeviceType, cbDeviceType); settings.TVVendor.ReplaceControls(this, Configuration.Controls, cbVendorId); settings.StartHidden.ReplaceControls(this, Configuration.Controls, cbStartMinimised); settings.WakeDevices.ReplaceControls(this, powerTab.Controls, lWakeDevices, cbWakeDevices); settings.PowerOffDevices.ReplaceControls(this, powerTab.Controls, lPowerOff, cbPowerOffDevices); settings.ActivateSource.ReplaceControls(this, powerTab.Controls, cbActivateSource); settings.StopTvStandby.ReplaceControls(this, powerTab.Controls, cbStopTvStandby); settings.StandbyScreen.ReplaceControls(this, powerTab.Controls, lStandbyScreen, cbStandbyScreen); settings.TVAutoPowerOn.ReplaceControls(this, powerTab.Controls, cbTVAutoPowerOn); var idleTimeSetting = settings.StandbyScreen.AsSettingIdleTime; var cbIdleTime = (idleTimeSetting.ValueControl as ComboBox); cbIdleTime.SelectedValueChanged += delegate { SetControlVisible(pbIdleTime, (cbIdleTime.SelectedIndex > 0)); }; if (idleTimeSetting.TimeoutEnabled) { SetControlVisible(pbIdleTime, true); } SetControlVisible(settings.TVAutoPowerOn.ValueControl, false); }
public static ApplicationController FromString(CECController controller, CECSettings settings, string serialisedConfig) { var splitString = serialisedConfig.Split(';'); if (splitString.Length != 4) { throw new InvalidDataException("incorrect number of parameters"); } return(new ApplicationController(controller, splitString[0], splitString[1], splitString[2], splitString[3])); }
public ConfigureApplication(CECSettings settings, CECController controller) { _cecController = controller; _settings = settings; InitializeComponent(); // take the icon of the main window ComponentResourceManager resources = new ComponentResourceManager(typeof(CECTray)); Icon = resources.GetObject("$this.Icon") as Icon; Text = Resources.add_new_application; }
/// <summary> /// Replaces the gui controls by the ones that are bound to the settings. /// this is a fugly way to do it, but the gui designer doesn't allow us to ref CECSettings, since it uses symbols from LibCecSharp /// </summary> public void InitialiseSettingsComponent(CECSettings settings) { settings.WakeDevices.ReplaceControls(this, Configuration.Controls, lWakeDevices, cbWakeDevices); settings.PowerOffDevices.ReplaceControls(this, Configuration.Controls, lPowerOff, cbPowerOffDevices); settings.OverridePhysicalAddress.ReplaceControls(this, Configuration.Controls, cbOverrideAddress); settings.OverrideTVVendor.ReplaceControls(this, Configuration.Controls, cbVendorOverride); settings.PhysicalAddress.ReplaceControls(this, Configuration.Controls, tbPhysicalAddress); settings.HDMIPort.ReplaceControls(this, Configuration.Controls, lPortNumber, cbPortNumber); settings.ConnectedDevice.ReplaceControls(this, Configuration.Controls, lConnectedDevice, cbConnectedDevice); settings.ActivateSource.ReplaceControls(this, Configuration.Controls, cbActivateSource); settings.DeviceType.ReplaceControls(this, Configuration.Controls, lDeviceType, cbDeviceType); settings.TVVendor.ReplaceControls(this, Configuration.Controls, cbVendorId); settings.StartHidden.ReplaceControls(this, Configuration.Controls, cbStartMinimised); }