本文整理汇总了C#中ImmutableDictionary.?.ToBuilder方法的典型用法代码示例。如果您正苦于以下问题:C# ImmutableDictionary.?.ToBuilder方法的具体用法?C# ImmutableDictionary.?.ToBuilder怎么用?C# ImmutableDictionary.?.ToBuilder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImmutableDictionary
的用法示例。
在下文中一共展示了ImmutableDictionary.?.ToBuilder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MemoryChainStateStorage
public MemoryChainStateStorage(ChainedHeader chainTip = null, int? unspentTxCount = null, int? totalTxCount = null, int? totalInputCount = null, int? totalOutputCount = null, int? unspentOutputCount = null, ImmutableSortedDictionary<UInt256, ChainedHeader> headers = null, ImmutableSortedDictionary<UInt256, UnspentTx> unspentTransactions = null, ImmutableDictionary<int, BlockSpentTxes> blockSpentTxes = null, ImmutableDictionary<UInt256, IImmutableList<UnmintedTx>> blockUnmintedTxes = null)
{
this.chainTip = chainTip;
this.unspentTxCount = unspentTxCount ?? 0;
this.unspentOutputCount = unspentOutputCount ?? 0;
this.totalTxCount = totalTxCount ?? 0;
this.totalInputCount = totalInputCount ?? 0;
this.totalOutputCount = totalOutputCount ?? 0;
this.headers = headers?.ToBuilder() ?? ImmutableSortedDictionary.CreateBuilder<UInt256, ChainedHeader>();
this.unspentTransactions = unspentTransactions?.ToBuilder() ?? ImmutableSortedDictionary.CreateBuilder<UInt256, UnspentTx>();
this.blockSpentTxes = blockSpentTxes?.ToBuilder() ?? ImmutableDictionary.CreateBuilder<int, BlockSpentTxes>();
this.blockUnmintedTxes = blockUnmintedTxes?.ToBuilder() ?? ImmutableDictionary.CreateBuilder<UInt256, IImmutableList<UnmintedTx>>();
}
示例2: MemoryChainStateStorage
public MemoryChainStateStorage(ChainedHeader chainTip = null, int? unspentTxCount = null, int? totalTxCount = null, int? totalInputCount = null, int? totalOutputCount = null, int? unspentOutputCount = null, ImmutableSortedDictionary<UInt256, ChainedHeader> headers = null, ImmutableSortedDictionary<UInt256, UnspentTx> unspentTransactions = null, ImmutableDictionary<int, BlockSpentTxes> blockSpentTxes = null, ImmutableDictionary<UInt256, IImmutableList<UnmintedTx>> blockUnmintedTxes = null)
{
this.chainTip = CommittedRecord<ChainedHeader>.Initial(chainTip);
this.unspentTxCount = CommittedRecord<int>.Initial(unspentTxCount ?? 0);
this.unspentOutputCount = CommittedRecord<int>.Initial(unspentOutputCount ?? 0);
this.totalTxCount = CommittedRecord<int>.Initial(totalTxCount ?? 0);
this.totalInputCount = CommittedRecord<int>.Initial(totalInputCount ?? 0);
this.totalOutputCount = CommittedRecord<int>.Initial(totalOutputCount ?? 0);
this.headers = CommittedRecord<ImmutableSortedDictionary<UInt256, ChainedHeader>.Builder>.Initial(
headers?.ToBuilder() ?? ImmutableSortedDictionary.CreateBuilder<UInt256, ChainedHeader>());
this.unspentTransactions = CommittedRecord<ImmutableSortedDictionary<UInt256, UnspentTx>.Builder>.Initial(
unspentTransactions?.ToBuilder() ?? ImmutableSortedDictionary.CreateBuilder<UInt256, UnspentTx>());
this.unspentTxOutputs = CommittedRecord<ImmutableSortedDictionary<TxOutputKey, TxOutput>.Builder>.Initial(
ImmutableSortedDictionary.CreateBuilder<TxOutputKey, TxOutput>());
this.blockSpentTxes = CommittedRecord<ImmutableDictionary<int, BlockSpentTxes>.Builder>.Initial(
blockSpentTxes?.ToBuilder() ?? ImmutableDictionary.CreateBuilder<int, BlockSpentTxes>());
this.blockUnmintedTxes = CommittedRecord<ImmutableDictionary<UInt256, IImmutableList<UnmintedTx>>.Builder>.Initial(
blockUnmintedTxes?.ToBuilder() ?? ImmutableDictionary.CreateBuilder<UInt256, IImmutableList<UnmintedTx>>());
}