コード例 #1
0
        public DetailsWindow(ApplicationDetails details)
        {
            InitializeComponent();

            displayNameTextBox.Text = details.Name;
            pathTextBox.Text        = details.Path;
            argumentsTextBox.Text   = details.Arguments;

            ApplicationDetails = details;
        }
コード例 #2
0
        public DetailsWindow(string path)
        {
            InitializeComponent();

            string filename = System.IO.Path.GetFileName(path);

            displayNameTextBox.Text = filename;
            pathTextBox.Text        = path;

            ApplicationDetails = null;
        }
コード例 #3
0
        private void OnButtonClickedEdit(object sender, RoutedEventArgs e)
        {
            MenuItem           sen    = (MenuItem)sender;
            ApplicationDetails detail = (ApplicationDetails)sen.DataContext;

            DetailsWindow detailsDialog = new DetailsWindow(detail);
            bool?         success       = detailsDialog.ShowDialog();

            if (success == true && detailsDialog.ApplicationDetails != null)
            {
                WriteToDisk();
            }
        }
コード例 #4
0
        private void OnButtonClickedDelete(object sender, RoutedEventArgs e)
        {
            MenuItem           sen              = (MenuItem)sender;
            ApplicationDetails detail           = (ApplicationDetails)sen.DataContext;
            MessageBoxResult   messageBoxResult = System.Windows.MessageBox.Show("Are you sure you want to delete the selected item?", "Delete Confirmation", System.Windows.MessageBoxButton.YesNo);

            if (messageBoxResult == MessageBoxResult.Yes)
            {
                Programs.Remove(detail);
                detail.DeleteIcon();

                WriteToDisk();
            }
        }
コード例 #5
0
        private void Save()
        {
            if (ApplicationDetails == null)
            {
                ApplicationDetails = new ApplicationDetails {
                    Name = displayNameTextBox.Text, Path = pathTextBox.Text, Arguments = argumentsTextBox.Text
                };
            }
            else
            {
                ApplicationDetails.Name      = displayNameTextBox.Text;
                ApplicationDetails.Path      = pathTextBox.Text;
                ApplicationDetails.Arguments = argumentsTextBox.Text;
            }

            DialogResult = true;
        }