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


C# Symbol类代码示例

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


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


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