本文整理汇总了C#中LookupOptions类的典型用法代码示例。如果您正苦于以下问题:C# LookupOptions类的具体用法?C# LookupOptions怎么用?C# LookupOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LookupOptions类属于命名空间,在下文中一共展示了LookupOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LookupSymbolsInSingleBinder
internal sealed override void LookupSymbolsInSingleBinder(
LookupResult result,
string name,
int arity,
ConsList<Symbol> basesBeingResolved,
LookupOptions options,
Binder originalBinder,
bool diagnose,
ref HashSet<DiagnosticInfo> useSiteDiagnostics)
{
if ((options & (LookupOptions.NamespaceAliasesOnly | LookupOptions.NamespacesOrTypesOnly | LookupOptions.LabelsOnly)) != 0)
{
return;
}
var local = this.LookupPlaceholder(name);
if ((object)local == null)
{
base.LookupSymbolsInSingleBinder(result, name, arity, basesBeingResolved, options, originalBinder, diagnose, ref useSiteDiagnostics);
}
else
{
result.MergeEqual(this.CheckViability(local, arity, options, null, diagnose, ref useSiteDiagnostics, basesBeingResolved));
}
}
示例2: LookupSymbolsInSingleBinder
protected override void LookupSymbolsInSingleBinder(
LookupResult result, string name, int arity, ConsList<Symbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref HashSet<DiagnosticInfo> useSiteDiagnostics)
{
if ((options & (LookupOptions.NamespaceAliasesOnly | LookupOptions.MustBeInvocableIfMember)) != 0)
{
return;
}
Debug.Assert(result.IsClear);
var count = parameterMap.GetCountForKey(name);
if (count == 1)
{
ParameterSymbol p;
parameterMap.TryGetSingleValue(name, out p);
result.MergeEqual(originalBinder.CheckViability(p, arity, options, null, diagnose, ref useSiteDiagnostics));
}
else if (count > 1)
{
var parameters = parameterMap[name];
foreach (var sym in parameters)
{
result.MergeEqual(originalBinder.CheckViability(sym, arity, options, null, diagnose, ref useSiteDiagnostics));
}
}
}
示例3: AddLookupSymbolsInfoInSingleBinder
protected override void AddLookupSymbolsInfoInSingleBinder(
LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
{
// Add types within namespaces imported through usings, but don't add nested namespaces.
LookupOptions usingOptions = (options & ~(LookupOptions.NamespaceAliasesOnly | LookupOptions.NamespacesOrTypesOnly)) | LookupOptions.MustNotBeNamespace;
Imports.AddLookupSymbolsInfoInUsings(ConsolidatedUsings, this, result, usingOptions);
}
示例4: LookupService
public LookupService(Stream stream, LookupOptions options)
{
_dbReader = options == LookupOptions.GEOIP_MEMORY_CACHE
? new StreamDbReader(stream)
: new CachedDbReader(stream);
Init();
}
示例5: AddLookupSymbolsInfoInSingleBinder
protected override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
{
var hostObjectType = GetHostObjectType();
if (hostObjectType.Kind != SymbolKind.ErrorType)
{
AddMemberLookupSymbolsInfo(result, hostObjectType, options, originalBinder);
}
}
示例6: AddLookupSymbolsInfoInSingleBinder
protected override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
{
if (CanConsiderTypeParameters(options))
{
foreach (var parameter in _namedType.TypeParameters)
{
if (originalBinder.CanAddLookupSymbolInfo(parameter, options, null))
{
result.AddSymbol(parameter, parameter.Name, 0);
}
}
}
}
示例7: AddLookupSymbolsInfoInSingleBinder
protected override void AddLookupSymbolsInfoInSingleBinder(LookupSymbolsInfo result, LookupOptions options, Binder originalBinder)
{
if (options.CanConsiderLocals())
{
foreach (var parameter in primaryCtor.Parameters)
{
if (originalBinder.CanAddLookupSymbolInfo(parameter, options, null))
{
result.AddSymbol(parameter, parameter.Name, 0);
}
}
}
}
示例8: LookupSymbolsInSingleBinder
internal override void LookupSymbolsInSingleBinder(LookupResult result, string name, int arity, ConsList<Symbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref HashSet<DiagnosticInfo> useSiteDiagnostics)
{
_sourceBinder.LookupSymbolsInSingleBinder(result, name, arity, basesBeingResolved, options, this, diagnose, ref useSiteDiagnostics);
var symbols = result.Symbols;
for (int i = 0; i < symbols.Count; i++)
{
// Type parameters requiring mapping to the target type and
// should be found by WithMethodTypeParametersBinder instead.
var parameter = (ParameterSymbol)symbols[i];
Debug.Assert(parameter.ContainingSymbol == _sourceBinder.ContainingMemberOrLambda);
symbols[i] = _targetParameters[parameter.Ordinal + _parameterOffset];
}
}
示例9: Lookup
public DicResult Lookup(LangPair lang, string text, string ui = null, LookupOptions flags = 0)
{
RestRequest request = new RestRequest("lookup");
request.AddParameter("key", _key);
request.AddParameter("lang", lang.ToString().ToLowerInvariant());
request.AddParameter("text", text);
if (!string.IsNullOrEmpty(ui))
request.AddParameter("ui", ui);
if (flags != 0)
request.AddParameter("flags", (int)flags);
return SendRequest<DicResult>(request);
}
示例10: LookupSymbolsInSingleBinder
internal override void LookupSymbolsInSingleBinder(
LookupResult result, string name, int arity, ConsList<Symbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref HashSet<DiagnosticInfo> useSiteDiagnostics)
{
Debug.Assert(result.IsClear);
if ((options & LookupOptions.NamespaceAliasesOnly) != 0)
{
return;
}
foreach (var parameterSymbol in parameterMap[name])
{
result.MergeEqual(originalBinder.CheckViability(parameterSymbol, arity, options, null, diagnose, ref useSiteDiagnostics));
}
}
示例11: LookupSymbolsInSingleBinder
protected override void LookupSymbolsInSingleBinder(
LookupResult result, string name, int arity, ConsList<Symbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref HashSet<DiagnosticInfo> useSiteDiagnostics)
{
if ((options & (LookupOptions.NamespaceAliasesOnly | LookupOptions.MustBeInvocableIfMember)) != 0)
{
return;
}
Debug.Assert(result.IsClear);
foreach (ParameterSymbol parameter in parameters)
{
if (parameter.Name == name)
{
result.MergeEqual(originalBinder.CheckViability(parameter, arity, options, null, diagnose, ref useSiteDiagnostics));
}
}
}
示例12: GetCandidateExtensionMethods
internal override void GetCandidateExtensionMethods(
bool searchUsingsNotNamespace,
ArrayBuilder<MethodSymbol> methods,
string name,
int arity,
LookupOptions options,
bool isCallerSemanticModel)
{
if (searchUsingsNotNamespace)
{
foreach (var nsOrType in ConsolidatedUsings)
{
if (nsOrType.NamespaceOrType.Kind == SymbolKind.Namespace)
{
((NamespaceSymbol)nsOrType.NamespaceOrType).GetExtensionMethods(methods, name, arity, options);
}
}
}
}
示例13: LookupSymbolsInSingleBinder
internal override void LookupSymbolsInSingleBinder(
LookupResult result, string name, int arity, ConsList<Symbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref HashSet<DiagnosticInfo> useSiteDiagnostics)
{
var hostObjectType = GetHostObjectType();
if (hostObjectType.Kind == SymbolKind.ErrorType)
{
// The name '{0}' does not exist in the current context (are you missing a reference to assembly '{1}'?)
result.SetFrom(new CSDiagnosticInfo(
ErrorCode.ERR_NameNotInContextPossibleMissingReference,
new object[] { name, ((MissingMetadataTypeSymbol)hostObjectType).ContainingAssembly.Identity },
ImmutableArray<Symbol>.Empty,
ImmutableArray<Location>.Empty
));
}
else
{
LookupMembersInternal(result, hostObjectType, name, arity, basesBeingResolved, options, originalBinder, diagnose, ref useSiteDiagnostics);
}
}
示例14: LookupSymbolsInSingleBinder
internal override void LookupSymbolsInSingleBinder(
LookupResult result, string name, int arity, ConsList<Symbol> basesBeingResolved, LookupOptions options, Binder originalBinder, bool diagnose, ref HashSet<DiagnosticInfo> useSiteDiagnostics)
{
if (!ShouldLookInUsings(options))
{
return;
}
LookupResult tmp = LookupResult.GetInstance();
// usings:
Imports.Empty.LookupSymbolInUsings(ConsolidatedUsings, originalBinder, tmp, name, arity, basesBeingResolved, options, diagnose, ref useSiteDiagnostics);
// if we found a viable result in imported namespaces, use it instead of unviable symbols found in source:
if (tmp.IsMultiViable)
{
result.MergeEqual(tmp);
}
tmp.Free();
}
示例15: LookupSymbolsInSingleBinder
internal sealed override void LookupSymbolsInSingleBinder(
LookupResult result,
string name,
int arity,
ConsList<Symbol> basesBeingResolved,
LookupOptions options,
Binder originalBinder,
bool diagnose,
ref HashSet<DiagnosticInfo> useSiteDiagnostics)
{
if ((options & (LookupOptions.NamespaceAliasesOnly | LookupOptions.NamespacesOrTypesOnly | LookupOptions.LabelsOnly)) != 0)
{
return;
}
if (name.StartsWith("0x", StringComparison.OrdinalIgnoreCase))
{
var valueText = name.Substring(2);
ulong address;
if (!ulong.TryParse(valueText, NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture, out address))
{
// Invalid value should have been caught by Lexer.
throw ExceptionUtilities.UnexpectedValue(valueText);
}
var local = new ObjectAddressLocalSymbol(_containingMethod, name, this.Compilation.GetSpecialType(SpecialType.System_Object), address);
result.MergeEqual(this.CheckViability(local, arity, options, null, diagnose, ref useSiteDiagnostics, basesBeingResolved));
}
else
{
LocalSymbol lowercaseReturnValueAlias;
if (_lowercaseReturnValueAliases.TryGetValue(name, out lowercaseReturnValueAlias))
{
result.MergeEqual(this.CheckViability(lowercaseReturnValueAlias, arity, options, null, diagnose, ref useSiteDiagnostics, basesBeingResolved));
}
else
{
base.LookupSymbolsInSingleBinder(result, name, arity, basesBeingResolved, options, originalBinder, diagnose, ref useSiteDiagnostics);
}
}
}