本文整理汇总了C#中ICSharpCode.NRefactory.MonoCSharp.ResolveContext.HasAny方法的典型用法代码示例。如果您正苦于以下问题:C# ResolveContext.HasAny方法的具体用法?C# ResolveContext.HasAny怎么用?C# ResolveContext.HasAny使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICSharpCode.NRefactory.MonoCSharp.ResolveContext
的用法示例。
在下文中一共展示了ResolveContext.HasAny方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoResolve
protected override Expression DoResolve (ResolveContext rc)
{
if (rc.HasSet (ResolveContext.Options.ConstantScope)) {
rc.Report.Error (1706, loc, "Anonymous methods and lambda expressions cannot be used in the current context");
return null;
}
//
// Update top-level block generated duting parsing with actual top-level block
//
if (rc.HasAny (ResolveContext.Options.FieldInitializerScope | ResolveContext.Options.BaseInitializer) && rc.CurrentMemberDefinition.Parent.PartialContainer.PrimaryConstructorParameters != null) {
var tb = rc.ConstructorBlock.ParametersBlock.TopBlock;
if (Block.TopBlock != tb) {
Block b = Block;
while (b.Parent != Block.TopBlock && b != Block.TopBlock)
b = b.Parent;
b.Parent = tb;
tb.IncludeBlock (Block, Block.TopBlock);
b.ParametersBlock.TopBlock = tb;
}
}
eclass = ExprClass.Value;
//
// This hack means `The type is not accessible
// anywhere', we depend on special conversion
// rules.
//
type = InternalType.AnonymousMethod;
if (!DoResolveParameters (rc))
return null;
return this;
}