123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.ComponentModel;
- using System.IO;
- using System.Linq;
- using System.Windows;
- using Microsoft.Win32;
- using SAGA.DotNetUtils;
- using SAGA.DotNetUtils.Extend;
- using System.Windows.Forms;
- using System.Windows.Threading;
- namespace Saga.PlugIn.ModelCheck
- {
- /// <summary>
- /// WinModeCheckSetting.xaml 的交互逻辑
- /// </summary>
- public partial class WinModeCheck
- {
- public WinModeCheck(VMModelCheck viewmodel)
- {
- InitializeComponent();
- this.DataContext = viewmodel;
- }
- #region BindingProperty
- #endregion
- #region Action
- private void ButtonNext_OnClick(object sender, RoutedEventArgs e)
- {
- this.DialogResult = true;
- }
- #endregion
- private void SelectFile_OnClick(object sender, RoutedEventArgs e)
- {
- FolderBrowserDialog dialog = new FolderBrowserDialog();
- dialog.Description = "请选择文件路径";
- if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- txtPath.Text = dialog.SelectedPath;
- }
- }
- public void DoEvents()
- {
- var frame = new DispatcherFrame();
- Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Background,
- new DispatcherOperationCallback(ExitFrames), frame);
- try
- {
- Dispatcher.PushFrame(frame);
- }
- catch (InvalidOperationException)
- {
- }
- }
- private object ExitFrames(object frame)
- {
- ((DispatcherFrame) frame).Continue = false;
- return null;
- }
- }
- }
|