当前位置: 首页>>代码示例>>C#>>正文


C# Micro.ActionExecutionContext类代码示例

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


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


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