• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Symbol类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Symbol的典型用法代码示例。如果您正苦于以下问题:C# Symbol类的具体用法?C# Symbol怎么用?C# Symbol使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Symbol类属于命名空间,在下文中一共展示了Symbol类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: IntegerType

        /// <summary>
        /// Creates an <see cref="IntegerType"/> instance.
        /// </summary>
        /// <param name="module"></param>
        /// <param name="name"></param>
        /// <param name="enumerator"></param>
        public IntegerType(IModule module, string name, Symbol type, ISymbolEnumerator symbols)
            : base (module, name)
        {
            Types? t = GetExactType(type);
            type.Assert(t.HasValue, "Unknown symbol for unsigned type!");
            _type = t.Value;

            _isEnumeration = false;

            Symbol current = symbols.NextNonEOLSymbol();
            if (current == Symbol.OpenBracket)
            {
                _isEnumeration = true;
                symbols.PutBack(current);
                _map = Lexer.DecodeEnumerations(symbols);
            }
            else if (current == Symbol.OpenParentheses)
            {
                symbols.PutBack(current);
                _ranges = Lexer.DecodeRanges(symbols);
                current.Assert(!_ranges.IsSizeDeclaration, "SIZE keyword is not allowed for ranges of integer types!");
            }
            else
            {
                symbols.PutBack(current);
            }
        }
开发者ID:plocklsh,项目名称:lwip,代码行数:33,代码来源:IntegerType.cs


示例2: GetObsoleteContextState

        /// <summary>
        /// This method checks to see if the given symbol is Obsolete or if any symbol in the parent hierarchy is Obsolete.
        /// </summary>
        /// <returns>
        /// True if some symbol in the parent hierarchy is known to be Obsolete. Unknown if any
        /// symbol's Obsoleteness is Unknown. False, if we are certain that no symbol in the parent
        /// hierarchy is Obsolete.
        /// </returns>
        internal static ThreeState GetObsoleteContextState(Symbol symbol, bool forceComplete = false)
        {
            if ((object)symbol == null)
                return ThreeState.False;

            // For Property or Event accessors, check the associated property or event instead.
            if (symbol.IsAccessor())
            {
                symbol = ((MethodSymbol)symbol).AssociatedSymbol;
            }
            // If this is the backing field of an event, look at the event instead.
            else if (symbol.Kind == SymbolKind.Field && (object)((FieldSymbol)symbol).AssociatedSymbol != null)
            {
                symbol = ((FieldSymbol)symbol).AssociatedSymbol;
            }

            if (forceComplete)
            {
                symbol.ForceCompleteObsoleteAttribute();
            }

            if (symbol.ObsoleteState != ThreeState.False)
            {
                return symbol.ObsoleteState;
            }

            return GetObsoleteContextState(symbol.ContainingSymbol, forceComplete);
        }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:36,代码来源:ObsoleteAttributeHelpers.cs


示例3: WithAlphaRename

        private TypeMap WithAlphaRename(ImmutableArray<TypeParameterSymbol> oldTypeParameters, Symbol newOwner, out ImmutableArray<TypeParameterSymbol> newTypeParameters)
        {
            if (oldTypeParameters.Length == 0)
            {
                newTypeParameters = ImmutableArray<TypeParameterSymbol>.Empty;
                return this;
            }

            // Note: the below assertion doesn't hold while rewriting async lambdas defined inside generic methods.
            // The async rewriter adds a synthesized struct inside the lambda frame and construct a typemap from
            // the lambda frame's substituted type parameters.
            // Debug.Assert(!oldTypeParameters.Any(tp => tp is SubstitutedTypeParameterSymbol));

            // warning: we expose result to the SubstitutedTypeParameterSymbol constructor, below, even before it's all filled in.
            TypeMap result = new TypeMap(this.Mapping);
            ArrayBuilder<TypeParameterSymbol> newTypeParametersBuilder = ArrayBuilder<TypeParameterSymbol>.GetInstance();

            // The case where it is "synthesized" is when we're creating type parameters for a synthesized (generic)
            // class or method for a lambda appearing in a generic method.
            bool synthesized = !ReferenceEquals(oldTypeParameters[0].ContainingSymbol.OriginalDefinition, newOwner.OriginalDefinition);

            foreach (var tp in oldTypeParameters)
            {
                var newTp = synthesized ?
                    new SynthesizedSubstitutedTypeParameterSymbol(newOwner, result, tp) :
                    new SubstitutedTypeParameterSymbol(newOwner, result, tp);
                result.Mapping.Add(tp, new TypeWithModifiers(newTp));
                newTypeParametersBuilder.Add(newTp);
            }

            newTypeParameters = newTypeParametersBuilder.ToImmutableAndFree();
            return result;
        }
开发者ID:iolevel,项目名称:peachpie,代码行数:33,代码来源:TypeMap.cs


示例4: FieldExpressionList

 public FieldExpressionList(Position pos, Symbol name, Expression init, FieldExpressionList tail)
 {
     Pos = pos;
     Name = name;
     Init = init;
     Tail = tail;
 }
开发者ID:Nxun,项目名称:Naive-Tiger,代码行数:7,代码来源:AbstractSyntax.cs


示例5: Rule

		protected static Rule Rule(string name, Pred contents, Symbol mode = null, int k = 0)
		{
			var rule = Pred.Rule(name, contents, (mode ?? Start) == Start, mode == Token, k);
			if (mode == Private)
				rule.IsPrivate = true;
			return rule;
		}
开发者ID:Shaykh,项目名称:Loyc,代码行数:7,代码来源:LlpgCoreTests.cs


示例6: ArrayExpression

 public ArrayExpression(Position pos, Symbol type, Expression size, Expression init)
 {
     Pos = pos;
     Type = type;
     Size = size;
     Init = init;
 }
开发者ID:Nxun,项目名称:Naive-Tiger,代码行数:7,代码来源:AbstractSyntax.Expression.cs


示例7: CalculateLastTradePandL

 public decimal CalculateLastTradePandL(Symbol symbol)
 {
     var matchedTrade = Trades.LastOrDefault(p => p.Symbol == symbol);
     if (matchedTrade != null)
         return matchedTrade.GainOrLoss;
     return 0;
 }
开发者ID:bizcad,项目名称:LeanITrend,代码行数:7,代码来源:OrderTransactionProcessor.cs


示例8: AskName

        // saves chosenSymbol into session state and returns partial view with asking for name form
        public ActionResult AskName(int gameId, Symbol chosenSymbol)
        {
            Session["ChosenSymbol"] = chosenSymbol;
            ViewBag.GameId = gameId;

            return PartialView("~/Views/NewLayout/AskName.cshtml", chosenSymbol);
        }
开发者ID:ninjah187,项目名称:rock-paper-scissors-asp,代码行数:8,代码来源:GameController.cs


示例9: MissingNamespaceSymbol

        public MissingNamespaceSymbol(MissingModuleSymbol containingModule)
        {
            Debug.Assert((object)containingModule != null);

            _containingSymbol = containingModule;
            _name = string.Empty;
        }
开发者ID:CAPCHIK,项目名称:roslyn,代码行数:7,代码来源:MissingNamespaceSymbol.cs


示例10: Select

        /// <summary>
        /// The static Select method is the recommended way to create the SelectDevice
        /// dialog.
        /// </summary>
        /// <remarks>
        /// This method will display the SelectDevice dialog and block until a 
        /// selection has been made.
        /// </remarks>
        /// <param name="Title">A string that will be displayed as the title to the
        /// SelectDevice dialog.</param>
        /// <param name="AvailableDevices">An array of available Symbol.Device objects.
        /// </param>
        /// <returns>The selected device object.</returns>
        public static Symbol.Barcode2.Device Select(
            string Title, Symbol.Barcode2.Device[] AvailableDevices)
        {
            OurAvailableDevices = AvailableDevices;

            if ( OurAvailableDevices.Length == 0 )
            {
                return null;
            }

            if ( OurAvailableDevices.Length == 1 )
            {
                return OurAvailableDevices[0];
            }

            OurTitle = Title;
            DefaultIndex = 0;

            int nSelection = new SelectDevice().Selection;

            if ( nSelection < 0 )
            {
                return null;
            }

            return OurAvailableDevices[nSelection];
        }
开发者ID:Systrics,项目名称:SystricsProjects,代码行数:40,代码来源:SelectDevice.cs


示例11: MakeNew

 public static Answer MakeNew(string text, Symbol sym)
 {
     Answer a = new Answer();
     a.Text = text;
     a.Sym = sym;
     return a;
 }
开发者ID:jocundmo,项目名称:SRCBQS,代码行数:7,代码来源:Answer.cs


示例12: LRStateAction

 /// <summary>
 /// Creats a new instance of the <c>LRStateAction</c> class.
 /// </summary>
 /// <param name="index">Index of the LR state action.</param>
 /// <param name="symbol">Symbol associated with the action.</param>
 /// <param name="action">Action type.</param>
 /// <param name="value">Action value.</param>
 public LRStateAction(int index, Symbol symbol, LRAction action, int value)
 {
     m_index = index;
     m_symbol = symbol;
     m_action = action;
     m_value = value;
 }
开发者ID:Saleslogix,项目名称:SLXMigration,代码行数:14,代码来源:LRStateAction.cs


示例13: GetNext

        public Symbol GetNext()
        {
            var currentSymbol = String.Empty;

            while(_CurrentIndex <= _EndIndex)
            {
                var currentChar = _Tweet.text[_CurrentIndex];

                if(currentChar == ' ')
                {
                    _CurrentIndex++;

                    if(_IsSymbol(currentSymbol))
                    {
                        break;
                    }

                    currentSymbol = String.Empty;
                    continue;
                }
                currentSymbol += currentChar;

                _CurrentIndex++;
            }

            CurrentSymbol = _GetSymbol(currentSymbol);

            return CurrentSymbol;
        }
开发者ID:jcbozonier,项目名称:twitduel,代码行数:29,代码来源:TweetLexer.cs


示例14: NameNormalizer

        internal static NormalizedName NameNormalizer(EFElement parent, string refName)
        {
            Debug.Assert(parent != null, "parent should not be null");

            if (refName == null)
            {
                return null;
            }

            // cast the parameter to what this really is
            var end = parent as AssociationSetEnd;
            Debug.Assert(end != null, "parent should be an AssociationSetEnd");

            // get the assoc set
            var set = end.Parent as AssociationSet;
            Debug.Assert(set != null, "association set end parent should be an AssociationSet");

            // get the entity container name
            string entityContainerName = null;
            var ec = set.Parent as BaseEntityContainer;
            if (ec != null)
            {
                entityContainerName = ec.EntityContainerName;
            }

            Debug.Assert(ec != null, "AssociationSet parent should be a subclass of BaseEntityContainer");

            // the normalized name for an EnitySet is 'EntityContainerName + # + EntitySetName'
            var symbol = new Symbol(entityContainerName, refName);

            var normalizedName = new NormalizedName(symbol, null, null, refName);
            return normalizedName;
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:33,代码来源:AssociationSetEndEntitySetNormalizer.cs


示例15: DistanceFromGeometry

        /// <summary>Construct Distance From Geometry sample control</summary>
        public DistanceFromGeometry()
        {
            InitializeComponent();

            _lineSymbol = layoutGrid.Resources["LineSymbol"] as Symbol;
            _pointSymbol = layoutGrid.Resources["PointSymbol"] as Symbol;
        }
开发者ID:KrisFoster44,项目名称:arcgis-runtime-samples-dotnet,代码行数:8,代码来源:DistanceFromGeometry.xaml.cs


示例16: Get

        /// <summary>
        /// Gets a <see cref="FactorFile"/> instance for the specified symbol, or null if not found
        /// </summary>
        /// <param name="symbol">The security's symbol whose factor file we seek</param>
        /// <returns>The resolved factor file, or null if not found</returns>
        public FactorFile Get(Symbol symbol)
        {
            FactorFile factorFile;
            if (_cache.TryGetValue(symbol, out factorFile))
            {
                return factorFile;
            }

            var market = symbol.ID.Market;

            // we first need to resolve the map file to get a permtick, that's how the factor files are stored
            var mapFileResolver = _mapFileProvider.Get(market);
            if (mapFileResolver == null)
            {
                return GetFactorFile(symbol, symbol.Value, market);
            }

            var mapFile = mapFileResolver.ResolveMapFile(symbol.ID.Symbol, symbol.ID.Date);
            if (mapFile.IsNullOrEmpty())
            {
                return GetFactorFile(symbol, symbol.Value, market);
            }

            return GetFactorFile(symbol, mapFile.Permtick, market);
        }
开发者ID:skyfyl,项目名称:Lean,代码行数:30,代码来源:LocalDiskFactorFileProvider.cs


示例17: AnonymousTypeParameterSymbol

 public AnonymousTypeParameterSymbol(Symbol container, int ordinal, string name)
 {
     Debug.Assert((object)container != null && !String.IsNullOrEmpty(name));
     this.container = container;
     this.ordinal = ordinal;
     this.name = name;
 }
开发者ID:modulexcite,项目名称:pattern-matching-csharp,代码行数:7,代码来源:AnonymousType.TypeParameterSymbol.cs


示例18: InvokeExpr

        public InvokeExpr(string source, IPersistentMap spanMap, Symbol tag, Expr fexpr, IPersistentVector args)
        {
            _source = source;
            _spanMap = spanMap;
            _fexpr = fexpr;
            _args = args;

            VarExpr varFexpr = fexpr as VarExpr;

            if (varFexpr != null)
            {
                Var fvar = varFexpr.Var;
                Var pvar = (Var)RT.get(fvar.meta(), Compiler.ProtocolKeyword);
                if (pvar != null && Compiler.ProtocolCallsitesVar.isBound)
                {
                    _isProtocol = true;
                    _siteIndex = Compiler.RegisterProtocolCallsite(fvar);
                    Object pon = RT.get(pvar.get(), _onKey);
                    _protocolOn = HostExpr.MaybeType(pon, false);
                    if (_protocolOn != null)
                    {
                        IPersistentMap mmap = (IPersistentMap)RT.get(pvar.get(), _methodMapKey);
                        Keyword mmapVal = (Keyword)mmap.valAt(Keyword.intern(fvar.sym));
                        if (mmapVal == null)
                        {
                            throw new ArgumentException(String.Format("No method of interface: {0} found for function: {1} of protocol: {2} (The protocol method may have been defined before and removed.)",
                                _protocolOn.FullName, fvar.Symbol, pvar.Symbol));
                        }
                        String mname = Compiler.munge(mmapVal.Symbol.ToString());

                        IList<MethodBase> methods = Reflector.GetMethods(_protocolOn, mname, null, args.count() - 1,  false);
                        if (methods.Count != 1)
                            throw new ArgumentException(String.Format("No single method: {0} of interface: {1} found for function: {2} of protocol: {3}",
                                mname, _protocolOn.FullName, fvar.Symbol, pvar.Symbol));
                        _onMethod = (MethodInfo) methods[0];
                    }
                }
            }

            if (tag != null)
                _tag = tag;
            else if (varFexpr != null)
            {
                object arglists = RT.get(RT.meta(varFexpr.Var), Compiler.ArglistsKeyword);
                object sigTag = null;
                for (ISeq s = RT.seq(arglists); s != null; s = s.next())
                {
                    APersistentVector sig = (APersistentVector)s.first();
                    int restOffset = sig.IndexOf(Compiler.AmpersandSym);
                    if (args.count() == sig.count() || (restOffset > -1 && args.count() >= restOffset))
                    {
                        sigTag = Compiler.TagOf(sig);
                        break;
                    }
                }
                _tag = sigTag ?? varFexpr.Tag;
            }
            else
                _tag = null;
        }
开发者ID:EricThorsen,项目名称:clojure-clr,代码行数:60,代码来源:InvokeExpr.cs


示例19: LocalFunctionSymbol

        public LocalFunctionSymbol(
            Binder binder,
            Symbol containingSymbol,
            LocalFunctionStatementSyntax syntax)
        {
            _syntax = syntax;
            _containingSymbol = containingSymbol;

            _declarationModifiers =
                DeclarationModifiers.Private |
                DeclarationModifiers.Static |
                syntax.Modifiers.ToDeclarationModifiers();

            var diagnostics = DiagnosticBag.GetInstance();

            if (_syntax.TypeParameterList != null)
            {
                binder = new WithMethodTypeParametersBinder(this, binder);
                _typeParameters = MakeTypeParameters(diagnostics);
            }
            else
            {
                _typeParameters = ImmutableArray<TypeParameterSymbol>.Empty;
            }

            if (IsExtensionMethod)
            {
                diagnostics.Add(ErrorCode.ERR_BadExtensionAgg, Locations[0]);
            }

            _binder = binder;
            _refKind = (syntax.ReturnType.Kind() == SyntaxKind.RefType) ? RefKind.Ref : RefKind.None;
            _diagnostics = diagnostics.ToReadOnlyAndFree();
        }
开发者ID:jkotas,项目名称:roslyn,代码行数:34,代码来源:LocalFunctionSymbol.cs


示例20: OldTypeArgumentBinderContext

 internal OldTypeArgumentBinderContext(TypeArgumentSyntax declaration, Symbol genericSymbol, WithTypeParametersBaseBinderContext next)
     : base(next.Location(declaration), genericSymbol, next)
 {
     this.declaration = declaration;
     this.genericSymbol = genericSymbol;
     this.enclosing = next;
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:7,代码来源:OldTypeArgumentBinderContext.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SymbolAnalysisContext类代码示例发布时间:2022-05-24
下一篇:
C# SymAddressKind类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap