private void InitFromConstructors(bool suppressContinue) { this.txtContinue.Visibility = suppressContinue ? Visibility.Collapsed : Visibility.Visible; // Call before rendering which will trigger initial resize events this.widthManager = new ButtonGroupSizeSyncManager(this.btnYes, this.btnNo); this.widthManager.PrepForChange(); }
/// <summary>Default constructor required for designer load</summary> public UC_RunPage() { InitializeComponent(); this.buttonSizer = new ButtonGroupSizeSyncManager( this.btnConnect, this.btnDisconnect, this.btnExit, this.btnLog); this.buttonSizer.PrepForChange(); }
public CrashReport(Exception ex, Window parent, string appName) { InitializeComponent(); this.appName = appName; this.ProcessException(ex); this.buttonWidthManager = new ButtonGroupSizeSyncManager(this.btnCopy, this.btnCancel, this.btnEmail); this.buttonWidthManager.PrepForChange(); }
public CrashReport(ErrReport report, Window parent) { this.parent = parent; InitializeComponent(); this.ProcessException(report); this.buttonWidthManager = new ButtonGroupSizeSyncManager(this.btnCopy, this.btnCancel, this.btnEmail); this.buttonWidthManager.PrepForChange(); }
private void InitFromConstructors() { this.wrapper = DI.Wrapper; this.SizeToContent = SizeToContent.WidthAndHeight; // Call before rendering which will trigger initial resize events this.widthManager = new ButtonGroupSizeSyncManager(this.btnOk, this.btnCancel); this.widthManager.PrepForChange(); }
private CodeViewWin(Window parent, CodeSelectDisplayDataModel codeDataModel) { this.parent = parent; this.codeDataModel = codeDataModel; InitializeComponent(); this.Title = this.codeDataModel.Name; this.buttonWidthManager = new ButtonGroupSizeSyncManager(this.btnCopy, this.btnExit); this.buttonWidthManager.PrepForChange(); }
public MsgBoxEnterText(Window parent, string title, string msg, string defaultTxt = "") { InitializeComponent(); this.Title = title; this.txtBlock.Text = msg; this.txtInput.Text = defaultTxt; this.widthManager = new ButtonGroupSizeSyncManager(this.btnOk, this.btnCancel); this.widthManager.PrepForChange(); }
public BTSettings(Window parent) { this.parent = parent; InitializeComponent(); WPF_ControlHelpers.CenterChild(parent, this); this.SizeToContent = SizeToContent.WidthAndHeight; this.widthManager = new ButtonGroupSizeSyncManager( this.btnPair, this.btnUnpair, this.btnExit); this.widthManager.PrepForChange(); }
public BLE_Full(Window parent) { Instances++; this.parent = parent; InitializeComponent(); this.buttonSizer = new ButtonGroupSizeSyncManager( this.btnConnect, this.btnDisconnect, this.btnExit, this.btnLog, this.btnCommands); this.buttonSizer.PrepForChange(); this.timer = new DispatcherTimer(DispatcherPriority.Normal); this.timer.Interval = TimeSpan.FromMilliseconds(500); }
public TerminatorEditor(Window parent, IIndexItem <DefaultFileExtraInfo> index) { this.wrapper = DI.Wrapper; this.parent = parent; this.index = index; InitializeComponent(); // Call before rendering which will trigger initial resize events this.widthManager = new ButtonGroupSizeSyncManager(this.btnSave, this.btnCancel); this.widthManager.PrepForChange(); this.SizeToContent = SizeToContent.WidthAndHeight; }
public CommandSettings(Window parent) { this.parent = parent; InitializeComponent(); this.btnCmdsHc05.Content = string.Format("{0} (HC-05)", DI.Wrapper.GetText(MsgCode.commands)); WPF_ControlHelpers.CenterChild(parent, this); this.SizeToContent = SizeToContent.WidthAndHeight; this.widthManager = new ButtonGroupSizeSyncManager( this.btnExit, this.btnCmdsHc05); this.widthManager.PrepForChange(); }
public TerminatorSettings(Window parent) { this.parent = parent; InitializeComponent(); WPF_ControlHelpers.CenterChild(parent, this); this.btnDefault.Content = string.Format("{0} \\n\\r", DI.Wrapper.GetText(MsgCode.Default)); this.SizeToContent = SizeToContent.WidthAndHeight; this.widthManager = new ButtonGroupSizeSyncManager( this.btnExit, this.btnArduino); this.widthManager.PrepForChange(); }
public MsgBoxCode(Window parent, CommMedium helpType) { this.parent = parent; this.medium = helpType; InitializeComponent(); this.Title = DI.Wrapper.GetText(helpType); WrapErr.ToErrReport(9999, () => this.Icon = helpType.ResourceWhiteBitmap()); //this.codeBox.CurrentHighlighter = HighlighterManager.Instance.Highlighters["CPPDL"]; this.buttonWidthManager = new ButtonGroupSizeSyncManager(this.btnCopy, this.btnExit); this.buttonWidthManager.PrepForChange(); }
private BLECommandsEdit(Window parent, IIndexItem <BLECmdIndexExtraInfo> index, UseType useType, BLE_DataType dataType) { this.parent = parent; this.index = index; this.useType = useType; this.dataType = dataType; InitializeComponent(); this.Init(); this.widthManager = new ButtonGroupSizeSyncManager(this.btnCancel, this.btnOk); this.widthManager.PrepForChange(); this.SizeToContent = SizeToContent.WidthAndHeight; }
public DeviceInfo_BT(Window parent, BTDeviceInfo info) { this.parent = parent; this.info = info; InitializeComponent(); this.Init(); // Call before rendering which will trigger initial resize events this.widthManager = new ButtonGroupSizeSyncManager(this.btnExit, this.btnProperties); this.widthManager.PrepForChange(); this.SizeToContent = SizeToContent.WidthAndHeight; }
public DeviceEdit_USB(Window parent, SerialDeviceInfo info) { this.parent = parent; this.info = info; InitializeComponent(); this.Init(); this.SizeToContent = SizeToContent.WidthAndHeight; this.Title = info.PortName; // Call before rendering which will trigger initial resize events this.widthManager = new ButtonGroupSizeSyncManager(this.btnOk, this.btnCancel); this.widthManager.PrepForChange(); }
public MsgBoxWifiCred(Window parent, string title, string host, string service) { this.parent = parent; InitializeComponent(); this.Title = title; this.txtHostName.Text = host; this.txtServiceName.Text = service; WPF_ControlHelpers.CenterChild(parent, this); this.SizeToContent = SizeToContent.WidthAndHeight; // Call before rendering which will trigger initial resize events this.widthManager = new ButtonGroupSizeSyncManager(this.btnOk, this.btnCancel); this.widthManager.PrepForChange(); }
public DeviceInfo_BLESerial(Window parent, BluetoothLEDeviceInfo info) { this.parent = parent; InitializeComponent(); this.SizeToContent = SizeToContent.WidthAndHeight; this.borderInput.MouseLeftButtonDown += this.BorderInput_MouseLeftButtonDown; this.borderOutput.MouseLeftButtonDown += this.BorderOutput_MouseLeftButtonDown; this.widthManager = new ButtonGroupSizeSyncManager(this.btnExit, this.btnSave); this.widthManager.PrepForChange(); this.info = info; // TODO - check if any previous selections this.treeServices.ItemsSource = this.info.Services; }
public MsgBoxWifiCred(Window parent, IIndexItem <DefaultFileExtraInfo> index) { this.parent = parent; this.index = index; this.InitializeComponent(); this.PopulateFields(this.index); WPF_ControlHelpers.CenterChild(parent, this); this.btnOk.Content = DI.Wrapper.GetText(MsgCode.save); this.SizeToContent = SizeToContent.WidthAndHeight; // Call before rendering which will trigger initial resize events this.widthManager = new ButtonGroupSizeSyncManager(this.btnOk, this.btnCancel); this.widthManager.PrepForChange(); }
public BLESelectDataType(Window parent) { this.parent = parent; InitializeComponent(); this.lbDataTypes.Add(new BLETypeDisplay(BLE_DataType.Bool)); this.lbDataTypes.Add(new BLETypeDisplay(BLE_DataType.UInt_8bit)); this.lbDataTypes.Add(new BLETypeDisplay(BLE_DataType.UInt_16bit)); this.lbDataTypes.Add(new BLETypeDisplay(BLE_DataType.UInt_32bit)); this.cbDataTypes.ItemsSource = this.lbDataTypes; this.cbDataTypes.SelectedIndex = 0; this.widthManager = new ButtonGroupSizeSyncManager(this.btnCancel, this.btnOk); this.widthManager.PrepForChange(); this.SizeToContent = SizeToContent.WidthAndHeight; }
private void PopulateFields() { this.listboxMain.ItemsSource = DI.Wrapper.BLE_GetDeviceInfoForDisplay(info); if (info.Services.Count == 0) { this.btnServices.Collapse(); this.widthManager = new ButtonGroupSizeSyncManager(this.btnProperties, this.btnExit); } else { this.widthManager = new ButtonGroupSizeSyncManager(this.btnProperties, this.btnServices, this.btnExit); } this.widthManager.PrepForChange(); }
private LanguageSelector(Window parent, ILangFactory languageFactory) { this.parent = parent; this.languageFactory = languageFactory; InitializeComponent(); this.SizeToContent = SizeToContent.WidthAndHeight; // Connect to language event this.languageFactory.LanguageChanged += Languages_LanguageChanged; this.languageOnEntry = this.languageFactory.CurrentLanguageCode; // Call before rendering which will trigger initial resize events this.widthManager = new ButtonGroupSizeSyncManager(this.btnCancel, this.btnSave); this.widthManager.PrepForChange(); }
public MsgBoxWifiCred(Window parent) { this.parent = parent; InitializeComponent(); this.Title = DI.Wrapper.GetText(MsgCode.Create); this.lbSSID.Show(); this.txtSSID.Show(); this.txtHostName.Text = string.Empty; this.txtServiceName.Text = string.Empty; WPF_ControlHelpers.CenterChild(parent, this); this.SizeToContent = SizeToContent.WidthAndHeight; // Call before rendering which will trigger initial resize events this.widthManager = new ButtonGroupSizeSyncManager(this.btnOk, this.btnCancel); this.widthManager.PrepForChange(); }
public DeviceSelect_Ethernet(Window parent, bool isSelect) { this.parent = parent; InitializeComponent(); this.Init(); this.SizeToContent = SizeToContent.WidthAndHeight; // Call before rendering which will trigger initial resize events this.widthManager = new ButtonGroupSizeSyncManager(this.btnCancel, this.btnSelect); this.widthManager.PrepForChange(); if (!isSelect) { this.btnCancel.Collapse(); this.btnSelect.Collapse(); this.btnExit.Show(); } }
public ScriptCmdEdit(Window parent, ScriptItem scriptItem, bool viewOnly = false) { this.parent = parent; this.scriptItem = scriptItem; InitializeComponent(); this.txtName.Text = this.scriptItem.Display; this.txtCommand.Text = this.scriptItem.Command; // Call before rendering which will trigger initial resize events this.widthManager = new ButtonGroupSizeSyncManager(this.btnCancel, this.btnOk); this.widthManager.PrepForChange(); this.SizeToContent = SizeToContent.WidthAndHeight; this.txtCommand.IsEnabled = !viewOnly; this.txtName.IsEnabled = !viewOnly; }
public LanguageSelector(Window parent) { this.wrapper = DI.Wrapper; this.parent = parent; InitializeComponent(); this.SizeToContent = SizeToContent.WidthAndHeight; // Connect to language event this.wrapper.LanguageChanged += Languages_LanguageChanged; this.wrapper.CurrentLanguage((code) => { this.languageOnEntry = code; }); // Call before rendering which will trigger initial resize events this.widthManager = new ButtonGroupSizeSyncManager(this.btnCancel, this.btnSave); this.widthManager.PrepForChange(); }
private BLECmdEdit(Window parent, BLE_DataType dataType, ScriptItem cmdItem) { this.parent = parent; this.dataType = dataType; this.cmdItem = cmdItem; InitializeComponent(); if (this.dataType == BLE_DataType.UInt_32bit) { this.grdValueCol.MinWidth = 320; } DI.Wrapper.BLE_GetShortRangeDisplay( this.dataType, str => this.txtRange.Content = str, this.onFailure); this.widthManager = new ButtonGroupSizeSyncManager(this.btnCancel, this.btnOk); this.widthManager.PrepForChange(); this.Setup(); this.SizeToContent = SizeToContent.WidthAndHeight; }
public DeviceInfo_BLESerial(Window parent) { this.parent = parent; InitializeComponent(); this.SizeToContent = SizeToContent.WidthAndHeight; this.borderInput.MouseLeftButtonDown += this.BorderInput_MouseLeftButtonDown; this.borderOutput.MouseLeftButtonDown += this.BorderOutput_MouseLeftButtonDown; this.widthManager = new ButtonGroupSizeSyncManager(this.btnExit, this.btnSave); this.widthManager.PrepForChange(); #region Test data for info display // --------------------------------------------- BLE_ServiceDataModel service1 = new BLE_ServiceDataModel(); service1.DisplayName = "Hogwarts 1 service"; service1.Characteristics.Add(new BLE_CharacteristicDataModel()); service1.Characteristics[0].CharName = "George Characteristic"; service1.Characteristics[0].Descriptors.Add(new BLE_DescriptorDataModel()); service1.Characteristics[0].Descriptors[0].DisplayName = "Output descriptor"; service1.Characteristics.Add(new BLE_CharacteristicDataModel()); service1.Characteristics[1].CharName = "Fred Characteristic"; service1.Characteristics[1].Descriptors.Add(new BLE_DescriptorDataModel()); service1.Characteristics[1].Descriptors[0].DisplayName = "Input descriptor"; service1.Characteristics[1].Descriptors.Add(new BLE_DescriptorDataModel()); service1.Characteristics[1].Descriptors[1].DisplayName = "Name of stuff"; this.treeDict.Add("1", service1); // --------------------------------------------- // --------------------------------------------- BLE_ServiceDataModel service2 = new BLE_ServiceDataModel(); service2.DisplayName = "Hogwarts 2 service"; service2.Characteristics.Add(new BLE_CharacteristicDataModel()); service2.Characteristics[0].CharName = "Hermioni characteristic"; service2.Characteristics.Add(new BLE_CharacteristicDataModel()); service2.Characteristics[1].CharName = "Ginny characteristic"; this.treeDict.Add("2", service2); // Just pass list of Values to avoid headach in XAML this.treeServices.ItemsSource = this.treeDict.Values; #endregion // Set the input as the active this.borderInput.BorderThickness = new Thickness(2); }
/// <summary>Show or hide controls based on use type</summary> private void ShowControls() { switch (this.useType) { case UseType.View: this.btnCancel.Visibility = Visibility.Collapsed; this.txtName.IsEnabled = false; this.lbxCmds.IsEnabled = false; this.stPanelSideButtons.Visibility = Visibility.Collapsed; break; case UseType.Edit: case UseType.New: // Call before rendering which will trigger initial resize events this.widthManager = new ButtonGroupSizeSyncManager(this.btnCancel, this.btnOk); this.widthManager.PrepForChange(); break; } }
private void OnStartupSuccess() { this.wrapper.CommMediumList((items) => { foreach (var item in items) { if (item.MediumType != CommMediumType.None) { // The cross platform wrapper only returns the immediate icon path item.IconSource = string.Format("{0}{1}", IconBinder.GetIconPrefix(), item.IconSource); this.mediums.Add(item); } } }); this.cbComm.ItemsSource = this.mediums; this.cbComm.SelectedIndex = 0; // Terminators this.wrapper.GetCurrentTerminator(this.GetTerminatorsOk, this.GetTerminatorsOnErr); this.wrapper.CurrentTerminatorChanged += Wrapper_CurrentTerminatorChanged; // Language this.wrapper.LanguageChanged += this.LanguageChangedHandler; // Scripts this.wrapper.CurrentScriptChanged += this.Wrapper_CurrentScriptChanged; // BLE this.wrapper.BLE_DeviceDiscovered += this.BLE_DeviceDiscoveredHandler; this.wrapper.BLE_DeviceRemoved += this.BLE_DeviceRemovedHandler; this.wrapper.BLE_DeviceUpdated += this.BLE_DeviceUpdatedHandler; this.wrapper.BLE_DeviceDiscoveryComplete += BLE_DeviceDiscoveryCompleteHandler; // BT this.wrapper.BT_DeviceDiscovered += this.BT_DeviceDiscoveredHandler; this.wrapper.BT_DiscoveryComplete += this.BT_DiscoveryCompleteHandler; //this.wrapper.BT_DeviceInfoGathered += this.BT_DeviceInfoGatheredHandler; this.wrapper.BT_ConnectionCompleted += this.BT_ConnectionCompletedHandler; this.wrapper.BT_BytesReceived += this.BT_BytesReceivedHandler; this.wrapper.BT_PairInfoRequested += this.BT_PairInfoRequestedHandler; this.wrapper.BT_PairStatus += this.BT_PairStatusHandler; this.wrapper.BT_UnPairStatus += this.BT_UnPairStatusHandler; // WIFI this.wrapper.OnWifiError += this.Wrapper_OnWifiError; this.wrapper.DiscoveredWifiNetworks += this.Wrapper_DiscoveredWifiNetworks; this.wrapper.OnWifiConnectionAttemptCompleted += this.Wrapper_OnWifiConnectionAttemptCompletedHandler; this.wrapper.CredentialsRequestedEvent += this.Wifi_CredentialsRequestedEventHandler; this.wrapper.Wifi_BytesReceived += Wrapper_Wifi_BytesReceivedHandler; // Serial USB this.wrapper.SerialOnError += this.Wrapper_SerialOnErrorHandler; this.wrapper.SerialDiscoveredDevices += this.Wrapper_SerialDiscoveredDevicesHandler; this.wrapper.Serial_BytesReceived += this.Wrapper_Serial_BytesReceivedHandler; this.wrapper.OnSerialConfigRequest += this.Wrapper_OnSerialConfigRequestHandler; // Ethernet this.wrapper.EthernetParamsRequestedEvent += this.Wrapper_EthernetParamsRequestedEventHandler; this.wrapper.Ethernet_BytesReceived += this.Wrapper_Ethernet_BytesReceivedHandler; this.wrapper.OnEthernetConnectionAttemptCompleted += this.Wrapper_OnEthernetConnectionAttemptCompletedHandler; this.wrapper.OnEthernetError += this.Wrapper_OnEthernetErrorHandler; this.wrapper.OnEthernetListChange += this.Wrapper_OnEthernetListChangeHandler; App.STATIC_APP.LogMsgEvent += this.AppLogMsgEventHandler; // Call before rendering which will trigger initial resize events this.buttonSizer_BT = new ButtonGroupSizeSyncManager(this.btnBTConnect, this.btnBTDiscover); this.buttonSizer_BT.PrepForChange(); this.buttonSizer_BLE = new ButtonGroupSizeSyncManager(this.btnDiscoverLE, this.btnInfoLE, this.btnLEConnect); this.buttonSizer_BLE.PrepForChange(); this.buttonSizer_WIFI = new ButtonGroupSizeSyncManager(this.btnWifiDiscover, this.btnWifiConnect, this.btnWifiDisconnect); this.buttonSizer_WIFI.PrepForChange(); buttonSizer_MAIN = new ButtonGroupSizeSyncManager(this.btnExit, this.btnLog); buttonSizer_MAIN.PrepForChange(); this.wrapper.GetCurrentScript(this.PopulateScriptData, WindowHelpers.ShowMsg); }