コード例 #1
0
//        private TextBox Directory;
//        private TextBox PriorityTextBox;

        public AddProgramSource(PluginInitContext context, Settings settings)
        {
            InitializeComponent();
            _context  = context;
            _settings = settings;
            DirectoryTextBox.Focus();
        }
コード例 #2
0
        public Edit(Output output)
        {
            InitializeComponent();

            foreach (string fileNameReplacement in AttributeHelper.GetAttributeReplacements())
            {
                MenuItem item = new MenuItem();
                item.Header = new TextBlock()
                {
                    Text = fileNameReplacement
                };
                item.Tag    = fileNameReplacement;
                item.Click += FileNameReplacementItem_Click;
                FileNameReplacementList.Items.Add(item);
            }


            NameTextBox.Text      = output.Name;
            DirectoryTextBox.Text = output.Directory;
            FileNameTextBox.Text  = output.FileName;

            FileFormatComboBox.ItemsSource   = FileHelper.GetFileFormats();
            FileFormatComboBox.SelectedValue = output.FileFormatID;

            SaveAutomaticallyCheckBox.IsChecked = output.SaveAutomatically;

            NameTextBox.TextChanged             += ValidateData;
            FileFormatComboBox.SelectionChanged += ValidateData;
            ValidateData(null, null);

            DirectoryTextBox.Focus();
        }
コード例 #3
0
 private void ShowDirectoryTextBox()
 {
     ButtonGrid.Visibility           = Visibility.Collapsed;
     DirectoryTextBoxMenu.Visibility = Visibility.Visible;
     DirectoryTextBox.SelectAll();
     DirectoryTextBox.Focus();
     DirectoryTextBoxMenuItem.IsSubmenuOpen = false;
 }
コード例 #4
0
 private void _viewModel_FocusAddressTextBoxRequested(object sender, EventArgs e)
 {
     if (DirectoryTextBoxMenu.Visibility == Visibility.Hidden)
     {
         ShowDirectoryTextBox();
     }
     else
     {
         DirectoryTextBox.Focus();
         string text = DirectoryTextBox.Text;
         if (!string.IsNullOrEmpty(text))
         {
             DirectoryTextBox.SelectionStart = text.Length;
         }
     }
 }