1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using System;
- using System.Windows;
- using AIPlatform.Protocol.Entities;
- namespace aipdev
- {
- /// <summary>
- /// Interaction logic for CreateScriptPackageWindow.xaml
- /// </summary>
- public partial class CreateScriptPackageWindow : Window
- {
- /// <summary>
- /// Gets the new package name.
- /// </summary>
- public string NewPackageName { get; private set; }
- /// <summary>
- /// Gets the new package framework.
- /// </summary>
- public TrainScriptPackageFramework NewPackageFramework { get; private set; }
- public CreateScriptPackageWindow()
- {
- InitializeComponent();
- PackageName.Focus();
- foreach (TrainScriptPackageFramework type in Enum.GetValues(typeof(TrainScriptPackageFramework)))
- {
- PackageFramework.Items.Add(type);
- }
- PackageFramework.SelectedIndex = 1;
- }
- private void OnOkClick(object sender, RoutedEventArgs e)
- {
- if (string.IsNullOrWhiteSpace(PackageName.Text) || string.IsNullOrEmpty(PackageName.Text))
- {
- MessageBox.Show(Application.Current.MainWindow, "请输入脚本包名", "错误", MessageBoxButton.OK, MessageBoxImage.Error);
- return;
- }
- NewPackageName = PackageName.Text.Trim();
- NewPackageFramework = (TrainScriptPackageFramework)PackageFramework.SelectedItem;
- Close();
- }
- private void OnCloseClick(object sender, RoutedEventArgs e)
- {
- Close();
- }
- }
- }
|