本文整理汇总了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;
}
示例2: SimpleExtractMethodResult
public SimpleExtractMethodResult(
OperationStatus status,
Document document,
SyntaxToken invocationNameToken,
SyntaxNode methodDefinition)
: base(status.Flag, status.Reasons, document, invocationNameToken, methodDefinition)
{
}
示例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;
}
示例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;
}
示例5: cmdBtnAdd_Click
//新增
internal void cmdBtnAdd_Click(object sender, EventArgs e)
{
ClearMessage();
if (!Add())
return;
CurrentOperationStatus = OperationStatus.New;
ResetButtonStatus();
}
示例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);
}
示例7: Cancel
public virtual void Cancel()
{
if (this.Status == OperationStatus.Cancelled || this.Status == OperationStatus.Completed)
{
// no-op
return;
}
this.Status = OperationStatus.Cancelled;
}
示例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)
{
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}