Esempio n. 1
0
        private void AddNewInputParametersLine(ExcelManager.CExcelManager.Parameter a_parameters)
        {
            Label label = new Label();
            label.Width = inputWidth;
            label.Height = inputHeight;
            label.Padding = new Thickness(2);

            WrapPanel labelPanel = new WrapPanel();
            labelPanel.Orientation = Orientation.Horizontal;
            labelPanel.Width = inputWidth;
            labelPanel.Height = inputHeight;

            AutoSuggestControl.AutoSuggestBox parameterKeyBox = new AutoSuggestControl.AutoSuggestBox();
            parameterKeyBox.ListItemSelected += new RoutedPropertyChangedEventHandler<object>(parameterKeyBox_ListItemSelected);
            parameterKeyBox.InitOptionAutoSuggest();
            parameterKeyBox.Width = textboxParameterKeyWidth;
            parameterKeyBox.Height = textboxHeight;

            Label labelSeparator = new Label();
            labelSeparator.Width = labelParameterSaparatorWidth;
            labelSeparator.Height = textboxHeight;
            labelSeparator.Content = ":";

            AutoSuggestControl.AutoSuggestBox parameterValueBox = new AutoSuggestControl.AutoSuggestBox();
            parameterValueBox.ListItemSelected += new RoutedPropertyChangedEventHandler<object>(parameterValueBox_ListItemSelected);
            parameterValueBox.Width = textboxParameterValueWidth;
            parameterValueBox.Height = textboxHeight;

            Label labelDescription = new Label();
            //labelDescription.Width = labelParameterDescriptionWidth;
            labelDescription.Height = textboxHeight;
            labelDescription.FontSize = 13;
            labelDescription.FontFamily = new System.Windows.Media.FontFamily("Calibri");
            labelDescription.Foreground = new SolidColorBrush(Color.FromArgb(0xff, 0x40, 0x3e, 0x3c));

            Label space = new Label();
            space.Width = 10;
            space.Height = textboxHeight;

            Button removeButton = new Button();
            removeButton.Content = "-";
            removeButton.Width = removeButtonWidth;
            removeButton.Height = removeButtonHeight;
            removeButton.Background = Brushes.White;
            removeButton.BorderBrush = new SolidColorBrush(Color.FromArgb(0xff, 0xff, 0xcb, 0x8b));
            removeButton.Foreground = new SolidColorBrush(Color.FromArgb(0xff, 0xff, 0x52, 0x00));

            labelPanel.Children.Add(removeButton);
            labelPanel.Children.Add(space);
            labelPanel.Children.Add(parameterKeyBox);
            label.Content = labelPanel;

            label.Tag = m_noOfParameters;
            labelPanel.Tag = m_noOfInstruments;
            parameterKeyBox.Tag = m_noOfParameters;
            labelSeparator.Tag = m_noOfParameters;
            parameterValueBox.Tag = m_noOfParameters;
            labelDescription.Tag = m_noOfParameters;
            removeButton.Tag = m_noOfParameters;

            removeButton.PreviewMouseDown += new MouseButtonEventHandler(removeButton_Parameters_MouseDownEvent);
            //parameterKeyBox.PreviewKeyUp += new KeyEventHandler(keyTextbox_Parameters_KeyInput);

            parameterLabel.Add(label);
            parameterWrapPanel.Add(labelPanel);
            parameterKeyTextBox.Add(parameterKeyBox);
            parameterSeparatorLabel.Add(labelSeparator);
            parameterValueTextBox.Add(parameterValueBox);
            parameterDescriptionLabel.Add(labelDescription);
            parameterRemoveButton.Add(removeButton);

            Grid.SetColumn(label, 0);
            Grid.SetRow(label, m_noOfParameters);

            if (a_parameters != null)
            {
                parameterKeyBox.Text = a_parameters.Name;
                labelPanel.Children.Add(labelSeparator);

                parameterValueBox.Text = a_parameters.Value;
                labelPanel.Children.Add(parameterValueBox);

                //string description = FindParameterDescription()
            }

            Parameterslb.Items.Add(label);
            ++m_noOfParameters;
        }
Esempio n. 2
0
        private void AddNewInputInstrument(String a_instrument)
        {
            Label label = new Label();
            label.Width = inputWidth;
            label.Height = inputHeight;
            label.Padding = new Thickness(2);

            WrapPanel labelPanel = new WrapPanel();
            labelPanel.Orientation = Orientation.Horizontal;

            AutoSuggestControl.AutoSuggestBox instrumentBox = new AutoSuggestControl.AutoSuggestBox();
            instrumentBox.ListItemSelected += new RoutedPropertyChangedEventHandler<object>(instrumentBox_ListItemSelected);
            instrumentBox.InitInstrumentAutoSuggest();

            instrumentBox.Width = textboxWidth;
            instrumentBox.Height = textboxHeight;

            Label instrumentDescLabel = new Label();
            //instrumentDescLabel.Width = descriptionWidth;
            instrumentDescLabel.Height = textboxHeight;
            instrumentDescLabel.FontSize = 13;
            instrumentDescLabel.FontFamily = new System.Windows.Media.FontFamily("Calibri");
            instrumentDescLabel.Foreground = new SolidColorBrush(Color.FromArgb(0xff, 0x40, 0x3e, 0x3c));

            Label space = new Label();
            space.Width = 10;
            space.Height = textboxHeight;

            Button removeButton = new Button();
            removeButton.Content = "-";
            removeButton.Width = removeButtonWidth;
            removeButton.Height = removeButtonHeight;
            removeButton.Background = Brushes.White;
            removeButton.BorderBrush = new SolidColorBrush(Color.FromArgb(0xff, 0xff, 0xcb, 0x8b));
            removeButton.Foreground = new SolidColorBrush(Color.FromArgb(0xff, 0xff, 0x52, 0x00));

            labelPanel.Children.Add(removeButton);
            labelPanel.Children.Add(space);
            labelPanel.Children.Add(instrumentBox);
            label.Content = labelPanel;

            label.Tag = m_noOfInstruments;
            labelPanel.Tag = m_noOfInstruments;
            instrumentBox.Tag = m_noOfInstruments;
            instrumentDescLabel.Tag = m_noOfInstruments;
            removeButton.Tag = m_noOfInstruments;
            removeButton.PreviewMouseDown += new MouseButtonEventHandler(removeButton_Instruments_MouseDownEvent);

            instrumentLabel.Add(label);
            instrumentWrapPanel.Add(labelPanel);
            instrumentTextBox.Add(instrumentBox);
            instrumentDescriptionLabel.Add(instrumentDescLabel);
            instrumentRemoveButton.Add(removeButton);

            if (a_instrument.Length > 0)
            {
                instrumentBox.Text = a_instrument;
                instrumentBox.IsEnabled = false;
                String description = DatabaseReader.FindInstrumentDescription(a_instrument);
                instrumentDescLabel.Content = description;
                labelPanel.Children.Add(instrumentDescLabel);

                //m_excelMgr.InstrumentList = a_instrument;
            }

            Instrumentslb.Items.Add(label);

            ++m_noOfInstruments;
        }