private void UpdateInterface() { borderNumeric.BorderBrush = controlType.Color; lblNumType.Foreground = controlType.Color; lblLine1.Foreground = controlType.Color; lblLine2.Foreground = controlType.Color; lblLine3.Foreground = controlType.Color; lblLine1.Visibility = Visibility.Visible; lblLine2.Visibility = Visibility.Visible; lblLine3.Visibility = Visibility.Visible; lblNumType.Text = App.Language.Localize(ControlType.LookupString(controlType.Value)); switch (controlType.Value) { default: case ControlType.Values.ABP: case ControlType.Values.IABP_AP: break; case ControlType.Values.ECG: lblLine2.Visibility = Visibility.Hidden; lblLine3.Visibility = Visibility.Hidden; break; } }
private void UpdateInterface() { borderNumeric.BorderBrush = controlType.Color; lblNumType.Foreground = controlType.Color; lblLine1.Foreground = controlType.Color; lblLine2.Foreground = controlType.Color; lblLine3.Foreground = controlType.Color; lblLine1.Visibility = Visibility.Visible; lblLine2.Visibility = Visibility.Visible; lblLine3.Visibility = Visibility.Visible; lblNumType.Text = App.Language.Localize(ControlType.LookupString(controlType.Value)); /* Set lines to be visible/hidden as appropriate */ switch (controlType.Value) { default: case ControlType.Values.NIBP: case ControlType.Values.ABP: case ControlType.Values.PA: break; case ControlType.Values.ECG: case ControlType.Values.T: case ControlType.Values.RR: case ControlType.Values.CVP: case ControlType.Values.IAP: lblLine2.Visibility = Visibility.Hidden; lblLine3.Visibility = Visibility.Hidden; break; case ControlType.Values.SPO2: case ControlType.Values.ETCO2: case ControlType.Values.ICP: lblLine3.Visibility = Visibility.Hidden; break; } /* Set menu items enabled/disabled accordingly */ switch (controlType.Value) { default: menuZeroTransducer.IsEnabled = false; break; case ControlType.Values.ABP: case ControlType.Values.CVP: case ControlType.Values.IAP: case ControlType.Values.ICP: case ControlType.Values.PA: menuZeroTransducer.IsEnabled = true; break; } }
private void InitInterface() { // Context Menu (right-click menu!) ContextMenu contextMenu = new ContextMenu(); layoutGrid.ContextMenu = contextMenu; lblNumType.ContextMenu = contextMenu; lblLine1.ContextMenu = contextMenu; lblLine2.ContextMenu = contextMenu; lblLine3.ContextMenu = contextMenu; vbLine1.ContextMenu = contextMenu; vbLine2.ContextMenu = contextMenu; vbLine3.ContextMenu = contextMenu; MenuItem menuZeroTransducer = new MenuItem(); menuZeroTransducer.Header = App.Language.Dictionary ["MENU:MenuZeroTransducer"]; menuZeroTransducer.Click += MenuZeroTransducer_Click; contextMenu.Items.Add(menuZeroTransducer); contextMenu.Items.Add(new Separator()); MenuItem menuAddNumeric = new MenuItem(); menuAddNumeric.Header = App.Language.Dictionary ["MENU:MenuAddNumeric"]; menuAddNumeric.Click += MenuAddNumeric_Click; contextMenu.Items.Add(menuAddNumeric); MenuItem menuRemoveNumeric = new MenuItem(); menuRemoveNumeric.Header = App.Language.Dictionary ["MENU:MenuRemoveNumeric"]; menuRemoveNumeric.Click += MenuRemoveNumeric_Click; contextMenu.Items.Add(menuRemoveNumeric); contextMenu.Items.Add(new Separator()); MenuItem menuSelectInput = new MenuItem(); menuSelectInput.Header = App.Language.Dictionary ["MENU:MenuSelectInputSource"]; foreach (ControlType.Values v in Enum.GetValues(typeof(ControlType.Values))) { MenuItem mi = new MenuItem(); mi.Header = App.Language.Dictionary [ControlType.LookupString(v)]; mi.Name = v.ToString(); mi.Click += MenuSelectInputSource; menuSelectInput.Items.Add(mi); } contextMenu.Items.Add(menuSelectInput); }
private void UpdateInterface() { borderNumeric.BorderBrush = controlType.Color; lblNumType.Foreground = controlType.Color; lblLine1.Foreground = controlType.Color; lblLine2.Foreground = controlType.Color; lblLine3.Foreground = controlType.Color; lblLine1.Visibility = Visibility.Visible; lblLine2.Visibility = Visibility.Visible; lblLine3.Visibility = Visibility.Visible; lblNumType.Text = App.Language.Dictionary [ControlType.LookupString(controlType.Value)]; switch (controlType.Value) { default: case ControlType.Values.NIBP: case ControlType.Values.ABP: case ControlType.Values.PA: break; case ControlType.Values.ECG: case ControlType.Values.T: case ControlType.Values.RR: case ControlType.Values.CVP: case ControlType.Values.IAP: lblLine2.Visibility = Visibility.Hidden; lblLine3.Visibility = Visibility.Hidden; break; case ControlType.Values.SPO2: case ControlType.Values.ETCO2: case ControlType.Values.ICP: lblLine3.Visibility = Visibility.Hidden; break; } }