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

C# OperationStatus类代码示例

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

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



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

示例1: AnalyzerResult

            public AnalyzerResult(
                SemanticDocument document,
                IEnumerable<ITypeParameterSymbol> typeParametersInDeclaration,
                IEnumerable<ITypeParameterSymbol> typeParametersInConstraintList,
                IList<VariableInfo> variables,
                VariableInfo variableToUseAsReturnValue,
                ITypeSymbol returnType,
                bool awaitTaskReturn,
                bool instanceMemberIsUsed,
                bool endOfSelectionReachable,
                OperationStatus status)
            {
                var semanticModel = document.SemanticModel;

                this.UseInstanceMember = instanceMemberIsUsed;
                this.EndOfSelectionReachable = endOfSelectionReachable;
                this.AwaitTaskReturn = awaitTaskReturn;
                this.SemanticDocument = document;
                _typeParametersInDeclaration = typeParametersInDeclaration.Select(s => semanticModel.ResolveType(s)).ToList();
                _typeParametersInConstraintList = typeParametersInConstraintList.Select(s => semanticModel.ResolveType(s)).ToList();
                _variables = variables;
                this.ReturnType = semanticModel.ResolveType(returnType);
                _variableToUseAsReturnValue = variableToUseAsReturnValue;
                this.Status = status;
            }
开发者ID:elemk0vv,项目名称:roslyn-1,代码行数:25,代码来源:MethodExtractor.AnalyzerResult.cs


示例2: SimpleExtractMethodResult

 public SimpleExtractMethodResult(
     OperationStatus status,
     Document document,
     SyntaxToken invocationNameToken,
     SyntaxNode methodDefinition)
     : base(status.Flag, status.Reasons, document, invocationNameToken, methodDefinition)
 {
 }
开发者ID:sushihangover,项目名称:monodevelop,代码行数:8,代码来源:SimpleExtractMethodResult.cs


示例3: GettingEventArgs

        internal GettingEventArgs(Workspace workspace, GetOperation operation)
        {
            this.workspace = workspace;
                this.operation = operation;

                if (operation.ChangeType == ChangeType.Delete)
                    status = OperationStatus.Deleting;
                else status = OperationStatus.Getting;
        }
开发者ID:Jeff-Lewis,项目名称:opentf,代码行数:9,代码来源:GettingEventArgs.cs


示例4: OperationReport

 public OperationReport(string name, string description, OperationStatus status, string exceptionDetail, int cycles, double duration)
 {
     Name = name;
     Description = description;
     Status = status;
     ExceptionDetail = exceptionDetail;
     Cycles = cycles;
     TotalDuration = duration;
 }
开发者ID:jaensen,项目名称:BrightstarDB,代码行数:9,代码来源:BenchmarkReport.cs


示例5: cmdBtnAdd_Click

        //新增
        internal void cmdBtnAdd_Click(object sender, EventArgs e)
        {
            ClearMessage();

            if (!Add())
                return;

            CurrentOperationStatus = OperationStatus.New;
            ResetButtonStatus();
        }
开发者ID:LovingYao,项目名称:myProgram,代码行数:11,代码来源:FrmBase.cs


示例6: CreateExtractMethodResult

        private ExtractMethodResult CreateExtractMethodResult(
            OperationStatus status, SemanticDocument semanticDocument,
            SyntaxAnnotation invocationAnnotation, SyntaxAnnotation methodAnnotation)
        {
            var newRoot = semanticDocument.Root;
            var annotatedTokens = newRoot.GetAnnotatedNodesAndTokens(invocationAnnotation);
            var methodDefinition = newRoot.GetAnnotatedNodesAndTokens(methodAnnotation).FirstOrDefault().AsNode();

            return new SimpleExtractMethodResult(status, semanticDocument.Document, GetMethodNameAtInvocation(annotatedTokens), methodDefinition);
        }
开发者ID:GloryChou,项目名称:roslyn,代码行数:10,代码来源:MethodExtractor.cs


示例7: Cancel

        public virtual void Cancel()
        {
            if (this.Status == OperationStatus.Cancelled || this.Status == OperationStatus.Completed)
            {
                // no-op
                return;
            }

            this.Status = OperationStatus.Cancelled;
        }
开发者ID:rgregg,项目名称:PortableLiveConnectSDK,代码行数:10,代码来源:Operation.cs


示例8: StatementResult

 public StatementResult(
     OperationStatus status,
     TextSpan originalSpan,
     TextSpan finalSpan,
     OptionSet options,
     bool selectionInExpression,
     SemanticDocument document,
     SyntaxAnnotation firstTokenAnnotation,
     SyntaxAnnotation lastTokenAnnotation) :
     base(status, originalSpan, finalSpan, options, selectionInExpression, document, firstTokenAnnotation, lastTokenAnnotation)
 {
 }
开发者ID:RoryVL,项目名称:roslyn,代码行数:12,代码来源:CSharpSelectionResult.StatementResult.cs


示例9: GetMessage

 public static string GetMessage(OperationStatus status)
 {
     if (_operationStatus.ContainsKey(status))
     {
         var statusKey = _operationStatus[status];
         if (_defaultLocaleResources.ContainsKey(statusKey))
         {
             return _defaultLocaleResources[_operationStatus[status]];
         }
         return statusKey;
     }
     return status.ToString();
 }
开发者ID:benthcode,项目名称:Annapolis.Net,代码行数:13,代码来源:MessageManager.cs


示例10: Execute

        public void Execute()
        {
            Debug.Assert(this.Status != OperationStatus.Started, "Cannot re-execute a started operation.");
            Debug.Assert(this.Status != OperationStatus.Completed, "Cannot re-execute a completed operation.");

            if (this.IsCancelled)
            {
                // This operation already has been cancelled and its OnCancel method should of already been called.
                return;
            }

            this.Status = OperationStatus.Started;

            this.InternalExecute();
        }
开发者ID:rgregg,项目名称:PortableLiveConnectSDK,代码行数:15,代码来源:Operation.cs


示例11: GeneratedCode

            public GeneratedCode(
                OperationStatus status,
                SemanticDocument document,
                SyntaxAnnotation methodNameAnnotation,
                SyntaxAnnotation callsiteAnnotation,
                SyntaxAnnotation methodDefinitionAnnotation)
            {
                Contract.ThrowIfNull(document);
                Contract.ThrowIfNull(methodNameAnnotation);
                Contract.ThrowIfNull(callsiteAnnotation);
                Contract.ThrowIfNull(methodDefinitionAnnotation);

                this.Status = status;
                this.SemanticDocument = document;
                this.MethodNameAnnotation = methodNameAnnotation;
                this.CallSiteAnnotation = callsiteAnnotation;
                this.MethodDefinitionAnnotation = methodDefinitionAnnotation;
            }
开发者ID:Rickinio,项目名称:roslyn,代码行数:18,代码来源:MethodExtractor.GeneratedCode.cs


示例12: ShowWindow

        public static OperationStatus<Category> ShowWindow(Category obj)
        {
            OperationStatus<Category> status = new OperationStatus<Category>();
            status.Data = obj;
            CategoryDetails window = new CategoryDetails();
            window.DataContext = obj;
            window.uxCategoryComboBox.ItemsSource = BooksManager.BooksManager.GetCategoryList(Constants.ROOT_CATEGORY).Where(c => c.Id != obj.Id);

            var retStatus = window.ShowDialog();

            if (retStatus.HasValue && retStatus.Value)
            {
                status.Result = OperationResult.Passed;
            }
            else
                status.Result = OperationResult.Failed;

            return status;
        }
开发者ID:Erls-Corporation,项目名称:BookHouse,代码行数:19,代码来源:CategoryDetails.xaml.cs


示例13: ConvertToErrorActionType

 /// <summary>
 /// Converts the type of the automatic error action.
 /// </summary>
 /// <param name="status">The status.</param>
 /// <returns></returns>
 internal static ErrorActionType ConvertToErrorActionType(OperationStatus status)
 {
     switch (status)
     {
         case OperationStatus.Failed:
             return ErrorActionType.Fail;
         case OperationStatus.Canceled:
             return ErrorActionType.Cancel;
         case OperationStatus.Retry:
             return ErrorActionType.Retry;
         case OperationStatus.Suspended:
             return ErrorActionType.Suspend;
         case OperationStatus.Succeeded:
             return ErrorActionType.Succeed;
         default:
             AsyncServiceException.Assert(false, "错误的作业状态。");
             return ErrorActionType.Fail;
     }
 }
开发者ID:udbeeq5566,项目名称:ESB,代码行数:24,代码来源:InvalidPluginExecutionExceptionHandler.cs


示例14: ShowWindow

        public static OperationStatus<Book> ShowWindow(Window owner, Book obj)
        {
            OperationStatus<Book> status = new OperationStatus<Book>();
            status.Data = obj;
            BookDetails window = new BookDetails();
            window.Owner = owner;
            window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            window.DataContext = obj;
            window.book = obj;
            window.uxCategoryComboBox.ItemsSource = BooksManager.BooksManager.GetCategoryList(Constants.ROOT_CATEGORY, true);
            var retStatus = window.ShowDialog();

            if (retStatus.HasValue && retStatus.Value)
            {
                status.Result = OperationResult.Passed;
            }
            else
                status.Result = OperationResult.Failed;

            return status;
        }
开发者ID:pawelklimczyk,项目名称:BookHouse,代码行数:21,代码来源:BookDetails.xaml.cs


示例15: CraeteDatabase

        public static OperationStatus<bool> CraeteDatabase(string filename)
        {
            OperationStatus<bool> status = new OperationStatus<bool>
                                               {
                                                   OperationMessage = "Database " + filename + " was created.",
                                                   Result = OperationResult.Passed
                                               };
            try
            {
                SQLiteConnection.CreateFile(filename);

                #region create tables
                SQLiteConnection connection = new SQLiteConnection(String.Format(connectionString, filename));
                connection.Open();
                using (SQLiteTransaction mytransaction = connection.BeginTransaction())
                {
                    using (SQLiteCommand mycommand = new SQLiteCommand(connection))
                    {
                        mycommand.CommandText = createCategoryTable;
                        mycommand.ExecuteNonQuery();

                        mycommand.CommandText = createBooksTable;
                        mycommand.ExecuteNonQuery();
                    }

                    mytransaction.Commit();
                }

                connection.Close();
                #endregion
            }
            catch (Exception exc)
            {
                status.Result = OperationResult.Failed;
                status.OperationMessage = exc.Message;
            }

            return status;
        }
开发者ID:pawelklimczyk,项目名称:BookHouse,代码行数:39,代码来源:BooksManager.cs


示例16: ApplyAsync

            public async Task<OperationStatus<SemanticDocument>> ApplyAsync(GeneratedCode generatedCode, CancellationToken cancellationToken)
            {
                var document = generatedCode.SemanticDocument;
                var root = document.Root;

                var callsiteAnnotation = generatedCode.CallSiteAnnotation;
                var methodDefinitionAnnotation = generatedCode.MethodDefinitionAnnotation;

                var callsite = root.GetAnnotatedNodesAndTokens(callsiteAnnotation).SingleOrDefault().AsNode();
                var method = root.GetAnnotatedNodesAndTokens(methodDefinitionAnnotation).SingleOrDefault().AsNode();

                var annotationResolver = GetAnnotationResolver(callsite, method);
                var triviaResolver = GetTriviaResolver(method);
                if (annotationResolver == null || triviaResolver == null)
                {
                    // bug # 6644
                    // this could happen in malformed code. return as it was.
                    var status = new OperationStatus(OperationStatusFlag.None, FeaturesResources.CantNotConstructFinalTree);
                    return status.With(document);
                }

                return OperationStatus.Succeeded.With(
                    await document.WithSyntaxRootAsync(_result.RestoreTrivia(root, annotationResolver, triviaResolver), cancellationToken).ConfigureAwait(false));
            }
开发者ID:GloryChou,项目名称:roslyn,代码行数:24,代码来源:MethodExtractor.TriviaResult.cs


示例17: CreateComputeOperationResponse

 private OperationStatusResponse CreateComputeOperationResponse(string requestId, OperationStatus status = OperationStatus.Succeeded)
 {
     return new OperationStatusResponse
     {
         Error = null,
         HttpStatusCode = HttpStatusCode.OK,
         Id = "id",
         RequestId = requestId,
         Status = status,
         StatusCode = HttpStatusCode.OK
     };
 }
开发者ID:EmmaZhu,项目名称:azure-sdk-tools,代码行数:12,代码来源:CloudServiceClientTests.cs


示例18: RegisterOperation

		/// <summary>
		/// Registers a specified operation.
		/// </summary>
		/// <param name="operation">The operation.</param>
		public void RegisterOperation(OperationStatus operation, string language)
		{
			if (!string.IsNullOrEmpty(language))
			{
			}
		}
开发者ID:ArthurYiL,项目名称:JustMockLite,代码行数:10,代码来源:TrackingContext.cs


示例19: ExecuteAsync

        /// <summary>
        /// Performs the BackgroundDownloadOperation.
        /// </summary>
        public async Task<LiveOperationResult> ExecuteAsync()
        {
            Debug.Assert(this.status != OperationStatus.Completed, "Cannot execute on a completed operation.");

            var builder = new BackgroundDownloadRequestBuilder
            {
                AccessToken = this.accessToken,
                DownloadLocationOnDevice = this.downloadLocationOnDevice,
                RequestUri = this.requestUri,
                TransferPreferences = this.transferPreferences
            };

            this.request = builder.Build();
            var eventAdapter = new BackgroundDownloadEventAdapter(this.backgroundTransferService, this.tcs);

            Task<LiveOperationResult> task = this.progress == null ?
                                             eventAdapter.ConvertTransferStatusChangedToTask(this.request) :
                                             eventAdapter.ConvertTransferStatusChangedToTask(this.request, this.progress);

            Debug.Assert(this.tcs.Task == task, "EventAdapter returned a different task. This could affect cancel.");

            // if the request has already been cancelled do not add it to the service.
            if (this.status != OperationStatus.Cancelled)
            {
                this.backgroundTransferService.Add(this.request);
                this.status = OperationStatus.Started;
            }

            LiveOperationResult result = await task;
            this.status = OperationStatus.Completed;
            return result;
        }
开发者ID:d20021,项目名称:LiveSDK-for-Windows,代码行数:35,代码来源:BackgroundDownloadOperation.cs


示例20: Cancel

        /// <summary>
        /// Cancels the given operation.
        /// </summary>
        public void Cancel()
        {
            // If we are already cancelled or completed we can just leave.
            if (this.status == OperationStatus.Cancelled || this.status == OperationStatus.Completed)
            {
                return;
            }

            // if we have started we must remove the request from the service to cancel.
            if (this.status == OperationStatus.Started)
            {
                this.backgroundTransferService.Remove(this.request);
            }

            // if we have not started, or started we must switch the state to cancelled and
            // notify the TaskCompletionSource to cancel.
            this.status = OperationStatus.Cancelled;
            this.tcs.TrySetCanceled();
        }
开发者ID:d20021,项目名称:LiveSDK-for-Windows,代码行数:22,代码来源:BackgroundDownloadOperation.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# OperationType类代码示例发布时间:2022-05-24
下一篇:
C# OperationResult类代码示例发布时间: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