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


C# LookupOptions类代码示例

本文整理汇总了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));
            }
        }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:25,代码来源:PlaceholderLocalBinder.cs

示例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));
                }
            }
        }
开发者ID:afrog33k,项目名称:csnative,代码行数:26,代码来源:WithPrimaryConstructorParametersBinder.cs

示例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);
        }
开发者ID:jerriclynsjohn,项目名称:roslyn,代码行数:8,代码来源:UsingsBinder.cs

示例4: LookupService

        public LookupService(Stream stream, LookupOptions options)
        {
            _dbReader = options == LookupOptions.GEOIP_MEMORY_CACHE
                ? new StreamDbReader(stream)
                : new CachedDbReader(stream);

            Init();
        }
开发者ID:baluubas,项目名称:geoip-api-csharp2,代码行数:8,代码来源:LookupService.cs

示例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);
     }
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:8,代码来源:HostObjectModeBinder.cs

示例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);
             }
         }
     }
 }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:13,代码来源:WithClassTypeParametersBinder.cs

示例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);
             }
         }
     }
 }
开发者ID:afrog33k,项目名称:csnative,代码行数:13,代码来源:WithPrimaryConstructorParametersBinder.cs

示例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];
            }
        }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:14,代码来源:EEMethodBinder.cs

示例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);
		}
开发者ID:nus-ii,项目名称:Yandex-Linguistics.NET,代码行数:14,代码来源:Dictionary.cs

示例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));
            }
        }
开发者ID:SoumikMukherjeeDOTNET,项目名称:roslyn,代码行数:15,代码来源:WithLambdaParametersBinder.cs

示例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));
                }
            }
        }
开发者ID:afrog33k,项目名称:csnative,代码行数:18,代码来源:WithParametersBinder.cs

示例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);
             }
         }
     }
 }
开发者ID:jerriclynsjohn,项目名称:roslyn,代码行数:19,代码来源:UsingsBinder.cs

示例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);
     }
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:19,代码来源:HostObjectModeBinder.cs

示例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();
        }
开发者ID:GeertVL,项目名称:roslyn,代码行数:21,代码来源:UsingsBinder.cs

示例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);
                }
            }
        }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:40,代码来源:PlaceholderLocalBinder.cs


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