Пример #1
0
        private void OnCompleted(NativeActivityContext context, ActivityInstance completedInstance)
        {
            Excel::_Workbook book         = excelApp.ActiveWorkbook;
            string           saveFilePath = SavePathUrl.Get(context);

            if (_Save)
            {
                if ((!isPathAvailable(saveFilePath)) && (_NewDoc))
                {
                    // 此文档为新建文件,请输入正确保存路径!
                    string           messageBoxText = Localize.LocalizedResources.GetString("xRequireCorrectSavePath1");
                    string           caption        = Localize.LocalizedResources.GetString("xPrompt"); // 提示
                    MessageBoxButton button         = MessageBoxButton.OK;
                    MessageBoxImage  icon           = MessageBoxImage.Warning;
                    MessageBox.Show(messageBoxText, caption, button, icon);
                }
                else if (!_NewDoc)
                {
                    book.Save();
                }
                else
                {
                    book.SaveAs(saveFilePath);
                }
            }
            if (_SaveAs)
            {
                if (!isPathAvailable(saveFilePath))
                {
                    // 另存为应输入正确保存路径!
                    string           messageBoxText = Localize.LocalizedResources.GetString("xRequireCorrectSavePath2");
                    string           caption        = Localize.LocalizedResources.GetString("xPrompt"); // 提示
                    MessageBoxButton button         = MessageBoxButton.OK;
                    MessageBoxImage  icon           = MessageBoxImage.Warning;
                    MessageBox.Show(messageBoxText, caption, button, icon);
                }
                else
                {
                    book.SaveAs(saveFilePath);
                }
            }
            if (IsExit)
            {
                new CommonVariable().realaseProcessExit(excelApp);
            }
            else
            {
                new CommonVariable().realaseProcess(excelApp);
            }

            Thread.Sleep(DelayAfter.Get(context));
        }
Пример #2
0
        protected override void Execute(CodeActivityContext context)
        {
            Process ps = null;

            if (!DisableActivity.Get(context))
            {
                FFmpegArgument arguments = new FFmpegArgument();
                arguments.FFmpegFilePath    = FFmpegFilePath.Get(context);
                arguments.OutputFileName    = OutputFileName.Get(context);
                arguments.VideoCodec        = VideoCodec.Get(context);
                arguments.PixelFormat       = PixelFormat.Get(context);
                arguments.ExtraOptionString = ExtraOptionString.Get(context);
                arguments.MaxDuration       = MaxDuration.Get(context);
                arguments.MaxFileSize       = MaxFileSize.Get(context);
                arguments.FrameRate         = FrameRate.Get(context);

                ps = StartRecording.Start(arguments, DelayAfter.Get(context));
            }

            FFmpegProcess.Set(context, ps);
        }
Пример #3
0
        protected override void Execute(NativeActivityContext context)
        {
            if (!IsActivityDisable.Get(context))
            {
                FFmpegArgument arguments = new FFmpegArgument();
                arguments.FFmpegFilePath    = FFmpegFilePath.Get(context);
                arguments.OutputFileName    = OutputFileName.Get(context);
                arguments.VideoCodec        = VideoCodec.Get(context);
                arguments.PixelFormat       = PixelFormat.Get(context);
                arguments.ExtraOptionString = ExtraOptionString.Get(context);
                arguments.MaxDuration       = MaxDuration.Get(context);
                arguments.MaxFileSize       = MaxFileSize.Get(context);
                arguments.FrameRate         = FrameRate.Get(context);


                ps = StartRecording.Start(arguments, DelayAfter.Get(context));
            }

            if (Body != null)
            {
                context.ScheduleAction(Body, OnCompleted, OnFaulted);
            }
        }