Beispiel #1
0
 /// <summary>
 /// 验证事件是否为空
 /// </summary>
 protected virtual void onExport_TextReport(ImportEventArgs e)
 {
     if (Export_TextReport != null)
     {
         Export_TextReport(e);
     }
 }
Beispiel #2
0
        private void StaticUpdater_OnImportEvent(object sender, ImportEventArgs e)
        {
            MainWindow window = (MainWindow)MainWindow;

            switch (e.Type)
            {
            case EditType.Appointment:
                //window.ImportAppointment();
                break;

            case EditType.Contact:
                window.ImportContact();
                break;

            case EditType.Task:
                //window.ImportTask();
                break;

            case EditType.Note:
                //window.ImportNote();
                break;

            default:
                break;
            }
        }
Beispiel #3
0
        private void OnImportStatusChanged(object sender, ImportEventArgs e)
        {
            Execute.OnUIThread(() =>
            {
                //if (ApplicationBar == null) return;
                if (ViewModel.CurrentContact.IsSelf)
                {
                    return;
                }

                ViewModel.CurrentContact.NotifyOfPropertyChange(() => ViewModel.CurrentContact.FullName);

                if (e.Imported)
                {
                    AppBarMenuItems.Children.Remove(_addMenuItem);
                    AppBarMenuItems.Children.Insert(0, _deleteMenuItem);
                }
                else
                {
                    AppBarMenuItems.Children.Remove(_deleteMenuItem);
                    if (ViewModel.CurrentContact.HasPhone)
                    {
                        AppBarMenuItems.Children.Insert(0, _addMenuItem);
                    }
                }
            });
        }
        protected virtual void OnImportsSatisfied(ImportEventArgs e)
        {
            EventHandler <ImportEventArgs> handler = ImportsSatisfied;

            if (handler != null)
            {
                handler(this, e);
            }
        }
Beispiel #5
0
 /// <summary>
 /// 导出数据 重载
 /// </summary>
 /// <param name="e">委托类型的参数</param>
 /// <param name="packBatch">包装批号</param>
 /// <param name="reportType">报告类型 3D OR Exfo</param>
 /// <param name="ModelPatch">模板路径</param>
 /// <param name="SavePatch">保存路径</param>
 public void StatExport(ImportEventArgs e, Maticsoft.Model.PackBatch packBatch, Maticsoft.Model.E_ReportType reportType
                        , string ModelPatch, string SavePatch)
 {
     if (reportType == Model.E_ReportType.Exfo) //Exfo数据导出
     {
     }
     else if (reportType == Model.E_ReportType.PhysicalProperty)    //3D数据导出
     {
     }
 }
        internal static ImportEventArgsWrapper GetInstance()
        {
            ImportEventArgs real = default(ImportEventArgs);

            RealInstanceFactory(ref real);
            var instance = (ImportEventArgsWrapper)ImportEventArgsWrapper.GetWrapper(real);

            InstanceFactory(ref instance);
            if (instance == null)
            {
                Assert.Inconclusive("Could not Create Test Instance");
            }
            return(instance);
        }
Beispiel #7
0
        private static void ImportStarted(object sender, ImportEventArgs e)
        {
            var progressBarOptions = new ProgressBarOptions
            {
                ProgressBarOnBottom   = true,
                ProgressCharacter     = '=',
                CollapseWhenFinished  = false,
                DisplayTimeInRealTime = true,
                ForegroundColorDone   = ConsoleColor.Green,
                ForegroundColor       = ConsoleColor.Yellow,
            };

            progressBar = new ProgressBar(e.NumberOfFiles, $"Importing files from {e.SourceDirectory} to {e.DestinationDirectory}", progressBarOptions);
        }
Beispiel #8
0
        private void btnImport_Click(object sender, EventArgs e)
        {
            try
            {
                if (!SelectedItems.Any())
                {
                    MessageBox.Show(strings.ImportNoItemSelected,
                                    strings.ImportFormMessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                int    numofChecked   = SelectedItems.Count();
                string confirmMessage = string.Format(strings.ExportConfirmation,
                                                      numofChecked, numofChecked == 1 ? strings.Item : strings.Items);

                DialogResult answer = MessageBox.Show(
                    confirmMessage,
                    strings.ImportFormMessageCaption,
                    MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (answer == DialogResult.No)
                {
                    return;
                }

                ImportEventArgs args = new ImportEventArgs()
                {
                    ProjectName        = txtActiveProject.Text,
                    Override           = chbOverride.Checked,
                    SelectedComponents = SelectedItems
                };
                if (ImportRequestedRaised != null)
                {
                    ImportRequestedRaised(this, args);
                }
                if (args.Cancel)
                {
                    return;
                }
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, strings.ExportFormMessageCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Beispiel #9
0
        /// <summary>
        /// 导出多芯
        /// </summary>
        private void Export_MultiCode()
        {
            string          tem      = _WTT_E.SavePath;
            int             temCount = 0;
            ImportEventArgs e        = _WTT_E;

            foreach (string _sn in _WTT_List)
            {
                temCount++;
                Maticsoft.BLL.Pack_3D _M_Pack3d = new Pack_3D();
                e.SavePath   = tem + _sn;
                e.ImportData = _M_Pack3d.Get_PackData(_sn, Model.E_InspectMethod.配组_四十八芯);
                _WTT_E       = e;
                Thread Mythread_ExReport = new Thread(new ThreadStart(ExReport));
                Mythread_ExReport.IsBackground = true;
                Mythread_ExReport.Start();
                Mythread_ExReport.Join();
                _WTT_E.StatUpProgressBar(0, temCount, _WTT_List.Count);
            }
            My_MessageBox.My_MessageBox_Message("导出完成!");
        }
Beispiel #10
0
 /// <summary>
 /// 开始导出
 /// </summary>
 public void StatExport(ImportEventArgs e)
 {
     if (e.Template != "")
     {
         if (e.SavePath != "")
         {
             _WTT_E = e;
             Thread Mythread_ExReport = new Thread(new ThreadStart(ExReport));
             Mythread_ExReport.IsBackground = true;
             Mythread_ExReport.Start();
         }
         else
         {
             My_MessageBox.My_MessageBox_Message("保存路径不能为空!\r\n请选择保存路径后重试!");
         }
     }
     else
     {
         My_MessageBox.My_MessageBox_Message("报告模板不能为空!\r\n前选择报告模板后重试!");
     }
 }
Beispiel #11
0
        private void OnImport()
        {
            if (Import != null)
            {
                var args = new ImportEventArgs(_configAndGestures, _gesturesImportOption, _configImportOption);
                Import(this, args);

                if (args.Success)
                {
                    MessageBox.Show("导入成功!", "导入完成", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Close();
                }
                else
                {
                    if (args.ErrorMessage != null)
                    {
                        ShowError(args.ErrorMessage);
                    }
                }
            }
        }
        private void OnImportStatusChanged(object sender, ImportEventArgs e)
        {
            Execute.OnUIThread(() =>
            {
                if (ApplicationBar == null)
                {
                    return;
                }

                if (e.Imported)
                {
                    ApplicationBar.MenuItems.Remove(_addMenuItem);
                    ApplicationBar.MenuItems.Insert(0, _deleteMenuItem);
                }
                else
                {
                    ApplicationBar.MenuItems.Remove(_deleteMenuItem);
                    ApplicationBar.MenuItems.Insert(0, _addMenuItem);
                }
            });
        }
Beispiel #13
0
 /// <summary>
 /// Imports selected components to the active VB project
 /// Calls special method for handling document type components
 /// </summary>
 /// <param name="args">arguments with all necessary information from a view</param>
 /// <returns></returns>
 public bool ImportComponents(ImportEventArgs args)
 {
     try
     {
         VBProject vbProject = _vbe.ActiveVBProject;
         bool      replace   = args.Override;
         foreach (Component item in args.SelectedComponents)
         {
             if (replace)
             {
                 _vbe.RemoveComponent(item.Name);
             }
             IImportType componentType = ComponentFactory.GetTypeClass(item.Type);
             componentType.Import(_vbe, item, replace);
         }
         return(true);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, strings.ImportFormMessageCaption, MessageBoxButton.OK, MessageBoxImage.Error);
         return(false);
     }
 }
 static partial void RealInstanceFactory(ref ImportEventArgs real, [CallerMemberName] string callerName = "");
Beispiel #15
0
 private static void ImportFinished(object sender, ImportEventArgs e)
 {
     progressBar.Dispose();
 }
Beispiel #16
0
        private void OnImport()
        {
            if (Import != null)
            {
                var args = new ImportEventArgs(_configAndGestures, _gesturesImportOption, _configImportOption);
                Import(this, args);

                if (args.Success)
                {
                    MessageBox.Show("导入成功!", "导入完成", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    Close();
                }
                else
                {
                    if(args.ErrorMessage != null) ShowError(args.ErrorMessage);
                }

            }
        }
 static partial void RealInstanceFactory(ref ImportEventArgs real, string callerName)
 {
     real = (ImportEventArgs)FormatterServices.GetUninitializedObject(typeof(ImportEventArgs));
 }
 public void Handler(object sender, ImportEventArgs eventArgs)
 {
     ImportEventArgs.Add(eventArgs);
 }