本文整理汇总了C#中ActivityContext类的典型用法代码示例。如果您正苦于以下问题:C# ActivityContext类的具体用法?C# ActivityContext怎么用?C# ActivityContext使用的例子? 这里精选的类代码示例或许可以为您提供帮助。
示例1: GetLocation
public override Location GetLocation(ActivityContext context)
{
Location location;
if (context == null)
{
throw FxTrace.Exception.ArgumentNull("context");
}
this.ThrowIfNotInTree();
if (!context.AllowChainedEnvironmentAccess)
{
if (this.IsPublic || !object.ReferenceEquals(this.Owner, context.Activity))
{
throw FxTrace.Exception.AsError(new InvalidOperationException(System.Activities.SR.VariableOnlyAccessibleAtScopeOfDeclaration(context.Activity, this.Owner)));
}
if (!context.Environment.TryGetLocation(base.Id, out location))
{
throw FxTrace.Exception.AsError(new InvalidOperationException(System.Activities.SR.VariableDoesNotExist(this.Name)));
}
return location;
}
if (!context.Environment.TryGetLocation(base.Id, this.Owner, out location))
{
throw FxTrace.Exception.AsError(new InvalidOperationException(System.Activities.SR.VariableDoesNotExist(this.Name)));
}
return location;
}
原文链接:
http://www.jxszl.com/biancheng/C/556470.html