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


C# OperationStatus类代码示例

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


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


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