本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例6: LdapAttributes
static LdapAttributes()
{
KnownAttributes = InitializeKnownAttributes();
CommonNameMap = KnownAttributes.ToDictionary(x => x.CommonName, StringComparer.OrdinalIgnoreCase);
DisplayNameMap = KnownAttributes.ToDictionary(x => x.DisplayName, StringComparer.OrdinalIgnoreCase);
}