• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Micro.ActionExecutionContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Caliburn.Micro.ActionExecutionContext的典型用法代码示例。如果您正苦于以下问题:C# ActionExecutionContext类的具体用法?C# ActionExecutionContext怎么用?C# ActionExecutionContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ActionExecutionContext类属于Caliburn.Micro命名空间,在下文中一共展示了ActionExecutionContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Execute

 public void Execute(ActionExecutionContext context)
 {
     // Server Side Error
     var faultException = Error as System.ServiceModel.FaultException<ServiceFault>;
     if (faultException != null) {
         if (faultException.Reason.ToString() == "Unauthorized") {
             Coroutine.BeginExecute(IoC.Get<IShell>().ExecuteSessionTimeout(), null, null);
         } else {
             if (Manual)
                 Caliburn.Micro.Execute.OnUIThread(()=> WindowManager.Value.Alert(faultException.Detail.Type, faultException.Detail.Message));
             else
                 WindowManager.Value.Alert(faultException.Detail.Type, faultException.Detail.Message);
         }
     } else {
         // General Exception
         var communicationError = Error as System.ServiceModel.CommunicationException;
         if (communicationError != null) {
             if (Manual)
                 Caliburn.Micro.Execute.OnUIThread(() => WindowManager.Value.Alert(faultException.Detail.Type, faultException.Detail.Message));
             else
                 WindowManager.Value.Alert("Communication Error", ValidationMessageResources.CommunicationError);
         } else {
             if (faultException != null) {
                 // Catch All other Errors
                 if (Manual)
                     Caliburn.Micro.Execute.OnUIThread(() => WindowManager.Value.Alert(faultException.Detail.Type, faultException.Detail.Message));
                 else
                     WindowManager.Value.Alert("Error", Error.Message);
             }
         }
     }
     // Execute Last
     if (!Manual)
         Caliburn.Micro.Execute.OnUIThread(() => Completed(this, new ResultCompletionEventArgs()));
 }
开发者ID:jserna-arl,项目名称:LIMSv2,代码行数:35,代码来源:HandleExceptionResult.cs


示例2: Execute

        public void Execute(ActionExecutionContext context)
        {
            DeploymentCatalog catalog;

            if (Catalogs.TryGetValue(_uri, out catalog))
                Completed(this, new ResultCompletionEventArgs());
            else
            {
                catalog = new DeploymentCatalog(_uri);
                catalog.DownloadCompleted += (s, e) =>
                                                 {
                                                     if (e.Error == null)
                                                     {
                                                         Catalogs[_uri] = catalog;
                                                         Catalog.Catalogs.Add(catalog);
                                                         catalog.Parts
                                                             .Select(part => ReflectionModelServices.GetPartType(part).Value.Assembly)
                                                             .Where(assembly => !AssemblySource.Instance.Contains(assembly))
                                                             .Apply(x => AssemblySource.Instance.Add(x));
                                                     }
                                                     else Loader.Hide().Execute(context);

                                                     Completed(this, new ResultCompletionEventArgs
                                                                         {
                                                                             Error = e.Error,
                                                                             WasCancelled = false
                                                                         });
                                                 };

                catalog.DownloadAsync();
            }
        }
开发者ID:stiano,项目名称:sl4,代码行数:32,代码来源:LoadCatalog+.cs


示例3: Execute

        public void Execute(ActionExecutionContext context)
        {
            var shell = IoC.Get<IShell>();
            shell.IsBusy = _isBusy;

            Completed(this, new ResultCompletionEventArgs());
        }
开发者ID:henninga,项目名称:AssetTracker,代码行数:7,代码来源:BusyResult.cs


示例4: Execute

        public override void Execute(ActionExecutionContext context)
        {
            var result = MessageBox.Show(this.messageBoxText, this.caption,
                this.showCancel ? MessageBoxButton.OKCancel : MessageBoxButton.OK);

            this.OnCompleted(new ResultCompletionEventArgs());
        }
开发者ID:sheepsteak,项目名称:EchoesJS,代码行数:7,代码来源:ShowMessageBoxResult.cs


示例5: Execute

		public void Execute(ActionExecutionContext context)
		{
			// simulating work
			Task
				.Run(() => Task.Delay(6000))
				.ContinueWith(task => Completed(this, new ResultCompletionEventArgs()));
		}
开发者ID:vcaraulean,项目名称:CaliburnMicro.AsyncDemo,代码行数:7,代码来源:SimpleCoroutine.cs


示例6: Execute

        public void Execute(ActionExecutionContext context)
        {
            var view = context.View as UserControl;
            if (view != null) {

                // add support for controls here
                List<Control> editableControls =
                    view.GetChildrenByType<Control>(c => c is RadComboBox ||
                                                         c is RadMaskedTextBox ||
                                                         c is NotifyButton ||
                                                         c is ModuleButton ||
                                                         c is RadButton);

                var control = editableControls.SingleOrDefault(c =>
                                                                   c.Name == controlToFocus);

                if (control != null)
                    control.Dispatcher.BeginInvoke(() => {
                        control.Focus();
                    });
            }
            // Execute Last
            if (!manual)
                Caliburn.Micro.Execute.OnUIThread(() => Completed(this, new ResultCompletionEventArgs()));
        }
开发者ID:jserna-arl,项目名称:LIMSv2,代码行数:25,代码来源:SetFocusByName.cs


示例7: Execute

        public override void Execute(ActionExecutionContext context)
        {
            if(callback != null)
                callback();

            OnCompleted(this, new ResultCompletionEventArgs{WasCancelled = true});
        }
开发者ID:hazama-yuinyan,项目名称:BVEEditor,代码行数:7,代码来源:CancelResult.cs


示例8: Execute

 public void Execute(ActionExecutionContext context)
 {
     var currentUser = SessionInfo.Instance.CurrentUser;
     service = new ChannelFactory<IUserService>(ServiceConfig.UserServiceEndpoint);
     var channel = service.CreateChannel();
     ThreadPool.QueueUserWorkItem(x => channel.BeginAuthenticate(currentUser.Username, Security.GetSha2Hash(currentPassword.Trim(), currentUser.Username.Trim()), new AsyncCallback(AuthenticateResponse), channel));
 }
开发者ID:jserna-arl,项目名称:LIMSv2,代码行数:7,代码来源:GetValidPasswordRequest.cs


示例9: EvaluateParameter

                /// <summary>
                ///   Evaluates the parameter.
                /// </summary>
                /// <param name = "expression">The expression.</param>
                /// <param name = "context">The context.</param>
                /// <param name = "resultType">Type of the result.</param>
                /// <returns>The evaluated parameter.</returns>
                private static object EvaluateParameter(string expression, ActionExecutionContext context, Type resultType)
                {
                    try
                    {
                        var index = 0;
                        var parameters = new ParameterExpression[MessageBinder.SpecialValues.Count];
                        var values = new object[MessageBinder.SpecialValues.Count];
                        foreach (var pair in MessageBinder.SpecialValues)
                        {
                            var name = "@" + index;
                            expression = expression.Replace(pair.Key, name);
                            var value = pair.Value(context);
                            parameters[index] = Expression.Parameter(GetParameterType(value), name);
                            values[index] = value;
                            index++;
                        }

                        var exp = DynamicExpression.ParseLambda(parameters, resultType, expression);
                        return exp.Compile().DynamicInvoke(values);
                    }
                    catch (Exception exc)
                    {
                        LogManager.GetLog(typeof(MessageBinder)).Error(exc);
                        return null;
                    }
                }
开发者ID:BernardNotarianni,项目名称:DownmarkerWPF,代码行数:33,代码来源:FrameworkExtensions.cs


示例10: Execute

        public void Execute(ActionExecutionContext context = null)
        {
            Result = MessageBox.Show(_message, _caption, _button);

            if (Completed != null)
                Completed(this, new ResultCompletionEventArgs());
        }
开发者ID:stonemonkey,项目名称:VacationManager,代码行数:7,代码来源:MessageBoxResult.cs


示例11: Execute

        public void Execute(ActionExecutionContext context)
        {
            Exception error = null;
            var worker = new BackgroundWorker();

            worker.DoWork += (s, e) =>
            {
                try
                {
                    _work();
                }
                catch (Exception ex)
                {
                    error = ex;
                }
            };

            worker.RunWorkerCompleted += (s, e) =>
            {
                if (error == null && _onSuccess != null)
                    _onSuccess.OnUIThread();

                if (error != null && _onFail != null)
                {
                    Caliburn.Micro.Execute.OnUIThread(() => _onFail(error));
                }

                Completed(this, new ResultCompletionEventArgs { Error = error });
            };
            worker.RunWorkerAsync();
        }
开发者ID:abdulbaruwa,项目名称:ReactiveUI.Samples,代码行数:31,代码来源:BackgroundWork.cs


示例12: Execute

        public void Execute(ActionExecutionContext context)
        {
            IStockTickerContentViewModel contentViewModel = this.contentFactory.CreateContent(this.detailModel.Value);
            this.conductor(contentViewModel);

            this.Completed(this, new ResultCompletionEventArgs());
        }
开发者ID:mmarkovic,项目名称:StockTicker,代码行数:7,代码来源:ConductStockTickerContent.cs


示例13: Execute

        public override void Execute(ActionExecutionContext context)
        {
            Window window = Window.GetWindow(context.View);
            if (window != null) window.Close();

            base.Execute(context);
        }
开发者ID:gfdittmer,项目名称:MiSharp,代码行数:7,代码来源:CloseResult.cs


示例14: Execute

        public override void Execute(ActionExecutionContext context)
        {
            var window = Window.GetWindow(context.View);
            window.Close();

            base.Execute(context);
        }
开发者ID:Cyborg11,项目名称:FreePIE,代码行数:7,代码来源:CloseResult.cs


示例15: Execute

 public void Execute(ActionExecutionContext context)
 {
     service = new ChannelFactory<ISampleService>(ServiceConfig.SampleServiceEndpoint);
     ISampleService channel = service.CreateChannel();
     ThreadPool.QueueUserWorkItem(x => channel.BeginCloneSample(arlNumber, descriptionYN, storageYN, containersYN, containerDescriptionYN,
                                fillVolumeYN, dosageYN, analytesYN, testsYN, chargesYN, notesYN, AppLib.GetIdentification(), new AsyncCallback(GetRequestResponse), channel));
 }
开发者ID:jserna-arl,项目名称:LIMSv2,代码行数:7,代码来源:CloneSampleRequest.cs


示例16: Execute

        public void Execute(ActionExecutionContext context)
        {
            StockDetailModel stockDetail = this.stockService.Get(this.symbol);
            this.detailModel.SetValue(stockDetail);

            this.Completed(this, new ResultCompletionEventArgs());
        }
开发者ID:mmarkovic,项目名称:StockTicker,代码行数:7,代码来源:GetStockDetails.cs


示例17: Coroutine

 public static void Coroutine(IEnumerator<IResult> coroutines, ActionExecutionContext context=null)
 {
     if( context==null )
         Caliburn.Micro.Coroutine.BeginExecute(coroutines);
     else
         Caliburn.Micro.Coroutine.BeginExecute(coroutines, context);
 }
开发者ID:Slesa,项目名称:Playground,代码行数:7,代码来源:Run.cs


示例18: StartRuntime

        /// <summary>
        /// Called by the bootstrapper's constructor at runtime to start the framework.
        /// </summary>
        protected virtual void StartRuntime() {
            Execute.InitializeWithDispatcher();
            EventAggregator.DefaultPublicationThreadMarshaller = Execute.OnUIThread;

            EventAggregator.HandlerResultProcessing = (target, result) => {
                var coroutine = result as IEnumerable<IResult>;
                if (coroutine != null) {
                    var viewAware = target as IViewAware;
                    var view = viewAware != null ? viewAware.GetView() : null;
                    var context = new ActionExecutionContext { Target = target, View = (DependencyObject)view };

                    Coroutine.BeginExecute(coroutine.GetEnumerator(), context);
                }
            };

            AssemblySource.Instance.AddRange(SelectAssemblies());

            if (useApplication) {
                Application = Application.Current;
                PrepareApplication();
            }

            Configure();
            IoC.GetInstance = GetInstance;
            IoC.GetAllInstances = GetAllInstances;
            IoC.BuildUp = BuildUp;
        }
开发者ID:LoungeFlyZ,项目名称:Caliburn-Micro-WinRT-Callisto-Helpers,代码行数:30,代码来源:Bootstrapper.cs


示例19: Execute

 public void Execute(ActionExecutionContext context)
 {
     var currentUser = SessionInfo.Instance.CurrentUser;
     service = new ChannelFactory<IUserService>(ServiceConfig.UserServiceEndpoint);
     var channel = service.CreateChannel();
     ThreadPool.QueueUserWorkItem(x => channel.BeginSaveNewPin(Security.GetSha2Hash(newPin.Trim(), currentUser.Username.Trim()), AppLib.GetIdentification(), new AsyncCallback(SaveNewPinResponse), channel));
 }
开发者ID:jserna-arl,项目名称:LIMSv2,代码行数:7,代码来源:SaveNewPinRequest.cs


示例20: CreateDialog

        void IResult.Execute(ActionExecutionContext context)
        {
            var dialog = CreateDialog();

            if (dialog.ShowDialog() != true)
            {
                this.OnCompleted(new ResultCompletionEventArgs
                {
                    WasCancelled = this._IgnoreUserCancel == false
                });
                return;
            }

            var resultArgs = new ResultCompletionEventArgs();

            this.FileNames = dialog.FileNames;

            if (this._FileAction != null)
            {
                try
                {
                    this._FileAction(FileNames);
                }
                catch (Exception e)
                {
                    resultArgs.Error = e;
                }
            }

            this.OnCompleted(resultArgs);
        }
开发者ID:XxRaPiDK3LLERxX,项目名称:nucleuscoop,代码行数:31,代码来源:MyOpenFileResult.cs



注:本文中的Caliburn.Micro.ActionExecutionContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Classes.FileItem类代码示例发布时间:2022-05-24
下一篇:
C# Cairo.Surface类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap