コード例 #1
0
        private void Button_Del_Click(object sender, RoutedEventArgs e)
        {
            var tag = (sender as Button).DataContext as TbExecutablePathEntity;

            TbExecutablePath.Del(tag);
            refreshData();
            mCallback();
        }
コード例 #2
0
        private void ShowDialogAndUpdate(TbExecutablePathEntity entity, bool isCloseWin)
        {
            var dialog = new Microsoft.Win32.OpenFileDialog();

            dialog.Filter           = "exe file |*.exe";
            dialog.InitialDirectory = entity.path;
            dialog.Title            = entity.name + "  设置路径";
            if (dialog.ShowDialog() == true)
            {
                entity.path = dialog.FileName;
                TbExecutablePath.UpdateOrAdd(entity);
                refreshData();
                mCallback();
                if (isCloseWin)
                {
                    Close();
                }
            }
        }
コード例 #3
0
 private void refreshData()
 {
     dataGrid1.ItemsSource = TbExecutablePath.GetAll();
 }