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


C# ReadOnlyCollection.ToDictionary方法代码示例

本文整理汇总了C#中ReadOnlyCollection.ToDictionary方法的典型用法代码示例。如果您正苦于以下问题:C# ReadOnlyCollection.ToDictionary方法的具体用法?C# ReadOnlyCollection.ToDictionary怎么用?C# ReadOnlyCollection.ToDictionary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ReadOnlyCollection的用法示例。


在下文中一共展示了ReadOnlyCollection.ToDictionary方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ServicePrimitiveTypes

        /// <summary>
        /// Initializes static members of the <see cref="ServicePrimitiveTypes"/> class.
        /// </summary>
        static ServicePrimitiveTypes()
        {
            Int = new ServicePrimitiveType("Int", Guid.Parse("C0C9BB1A-7726-46A7-A7CE-BE11A451D7D2"), typeof(int));
            Double = new ServicePrimitiveType("Double", Guid.Parse("E189E84D-6716-4E93-A513-B42A7E0AB1AA"), typeof(double));
            String = new ServicePrimitiveType("String", Guid.Parse("781B52DE-5374-4052-934E-CFA95CAAA270"), typeof(string));
            Boolean = new ServicePrimitiveType("Boolean", Guid.Parse("12A2152F-278F-4A97-A654-D2CCBA718F2F"), typeof(bool));
            Decimal = new ServicePrimitiveType("Decimal", Guid.Parse("31456CA3-DCC6-4179-AF4B-6E0FA378783E"), typeof(decimal));
            DateTime = new ServicePrimitiveType("DateTime", Guid.Parse("B6B9E490-64C9-4CAA-B486-998A0000917C"), typeof(DateTime));
            Byte = new ServicePrimitiveType("Byte", Guid.Parse("E848A8D5-AC00-4D8D-88D3-CC923D408495"), typeof(byte));

            Types = new ReadOnlyCollection<ServicePrimitiveType>(new[] { Byte, Int, Double, String, Boolean, Decimal, DateTime });
            GuidMap = Types.ToDictionary(x => x.Guid);
        }
开发者ID:mparsin,项目名称:Elements,代码行数:16,代码来源:ServicePrimitiveTypes.cs

示例2: ILRewriter

        public ILRewriter(MethodBase src, MethodBuilder dest,
            Func<IILOp, IILRewriteControl, IILRewriteControl> logic)
        {
            _src = src;
            var body = _src.ParseBody();

            _originalIL = body.RawIL.ToArray();
            body.RawEHC.AssertEmpty();
            _body = body.ToReadOnly();
            _off2op = _body.ToDictionary(op => op.Offset, op => op).ToReadOnly();

            _dest = dest;
            _logic = logic;
        }
开发者ID:xeno-by,项目名称:truesight-lite,代码行数:14,代码来源:ILRewriter.cs

示例3: GameState

        public GameState(Game game, IList<string> playerIds)
        {
            if (game == null)
            {
                throw new ArgumentNullException("game");
            }

            this.game = game;

            this.playerIds = playerIds.ToList().AsReadOnly();

            var deck = ShuffleNewDeck();
            var hands = DealCards(deck, this.playerIds);
            var turn = GetNextPlayer(this.dealer, this.playerIds.Count);

            this.deck = deck.ToList().AsReadOnly();
            this.scores = playerIds.ToDictionary(p => p, p => 0).AsReadOnly();
            this.hands = hands.ToDictionary(h => h.Key, h => h.Value.AsReadOnly()).AsReadOnly();
            this.dealer = turn;
            this.turn = turn;
            this.proof = (from i in Enumerable.Range(0, 4)
                          select new Premise(new List<PlacementCard>())).ToList().AsReadOnly();
            this.isRoundOver = false;
        }
开发者ID:otac0n,项目名称:Therefore,代码行数:24,代码来源:GameState.cs

示例4: Sregs

 static Sregs()
 {
     var libptx = typeof(Sreg).Assembly;
     _sregs = libptx.GetTypes().Where(t => t.BaseType == typeof(Sreg)).OrderBy(t => t.Name).ToReadOnly();
     _sigs = _sregs.ToDictionary(t => t, t => new SregSig(t, t.Attr<SregAttribute>())).ToReadOnly();
 }
开发者ID:xeno-by,项目名称:libptx,代码行数:6,代码来源:Sregs.cs

示例5: Ptxops

 static Ptxops()
 {
     var libptx = typeof(ptxop).Assembly;
     _ptxops = libptx.GetTypes().Where(t => t.BaseType == typeof(ptxop)).OrderBy(t => t.Name).ToReadOnly();
     _sigs = _ptxops.ToDictionary(t => t, t => t.Attrs<PtxopAttribute>().Select(a => new PtxopSig(t, a)).ToReadOnly()).ToReadOnly();
 }
开发者ID:xeno-by,项目名称:libptx,代码行数:6,代码来源:Ptxops.cs

示例6: LdapAttributes

 static LdapAttributes()
 {
     KnownAttributes = InitializeKnownAttributes();
     CommonNameMap = KnownAttributes.ToDictionary(x => x.CommonName, StringComparer.OrdinalIgnoreCase);
     DisplayNameMap = KnownAttributes.ToDictionary(x => x.DisplayName, StringComparer.OrdinalIgnoreCase);
 }
开发者ID:mparsin,项目名称:Elements,代码行数:6,代码来源:LdapAttributes.cs


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