Esempio n. 1
0
        private void CanUploadFillRule(object sender, System.Windows.Input.CanExecuteRoutedEventArgs e)
        {
            Windows.DependencyObject d       = sender as Windows.DependencyObject;
            RuleFileManager          manager = (d == null ? null : d.GetValue(Windows.FrameworkElement.DataContextProperty) as RuleFileManager);

            e.CanExecute = manager != null && manager.IsUploading == false;
        }
Esempio n. 2
0
        private void OnUploadFillRule(object sender, System.Windows.Input.ExecutedRoutedEventArgs e)
        {
            Windows.DependencyObject d       = sender as Windows.DependencyObject;
            RuleFileManager          manager = (d == null ? null : d.GetValue(Windows.FrameworkElement.DataContextProperty) as RuleFileManager);

            System.Threading.ThreadPool.QueueUserWorkItem(RuleFileUploadWorker, manager);
        }
Esempio n. 3
0
 private static void RuleFileUploadWorker(object state)
 {
     try
     {
         RuleFileManager manager = state as RuleFileManager;
         System.Threading.ThreadPool.QueueUserWorkItem((param) =>
         {
             manager.Upload();
         }, null);
     }
     catch (Exception ex)
     {
         WebBrowserUtils.HtmlUtils.Fillers.WebFillManager.ShowMessageBox(ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }