本文整理汇总了C#中ImmutableDictionary.ToImmutable方法的典型用法代码示例。如果您正苦于以下问题:C# ImmutableDictionary.ToImmutable方法的具体用法?C# ImmutableDictionary.ToImmutable怎么用?C# ImmutableDictionary.ToImmutable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImmutableDictionary
的用法示例。
在下文中一共展示了ImmutableDictionary.ToImmutable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CommitTransaction
public void CommitTransaction(ChainedHeader chainTip, int? unspentTxCount, int? unspentOutputCount, int? totalTxCount, int? totalInputCount, int? totalOutputCount, ImmutableSortedDictionary<UInt256, ChainedHeader>.Builder headers, ImmutableSortedDictionary<UInt256, UnspentTx>.Builder unspentTransactions, ImmutableDictionary<int, BlockSpentTxes>.Builder blockSpentTxes, ImmutableDictionary<UInt256, IImmutableList<UnmintedTx>>.Builder blockUnmintedTxes, long chainVersion, long unspentTxCountVersion, long unspentOutputCountVersion, long totalTxCountVersion, long totalInputCountVersion, long totalOutputCountVersion, long headersVersion, long unspentTxesVersion, long blockSpentTxesVersion, long blockUnmintedTxesVersion)
{
lock (this.lockObject)
{
if (chainTip != null && this.chainTipVersion != chainVersion
|| unspentTxCount != null && unspentTxCountVersion != this.unspentTxCountVersion
|| unspentOutputCount != null && unspentOutputCountVersion != this.unspentOutputCountVersion
|| totalTxCount != null && totalTxCountVersion != this.totalTxCountVersion
|| totalInputCount != null && totalInputCountVersion != this.totalInputCountVersion
|| totalOutputCount != null && totalOutputCountVersion != this.totalOutputCountVersion
|| headers != null && headersVersion != this.headersVersion
|| unspentTransactions != null && unspentTxesVersion != this.unspentTxesVersion
|| blockSpentTxes != null && blockSpentTxesVersion != this.blockSpentTxesVersion
|| blockUnmintedTxes != null && blockUnmintedTxesVersion != this.blockUnmintedTxesVersion)
throw new InvalidOperationException();
if (chainTip != null)
{
this.chainTip = chainTip;
this.chainTipVersion++;
}
if (unspentTxCount != null)
{
this.unspentTxCount = unspentTxCount.Value;
this.unspentTxCountVersion++;
}
if (unspentOutputCount != null)
{
this.unspentOutputCount = unspentOutputCount.Value;
this.unspentOutputCountVersion++;
}
if (totalTxCount != null)
{
this.totalTxCount = totalTxCount.Value;
this.totalTxCountVersion++;
}
if (totalInputCount != null)
{
this.totalInputCount = totalInputCount.Value;
this.totalInputCountVersion++;
}
if (totalOutputCount != null)
{
this.totalOutputCount = totalOutputCount.Value;
this.totalOutputCountVersion++;
}
if (headers != null)
{
this.headers = headers.ToImmutable().ToBuilder();
this.headersVersion++;
}
if (unspentTransactions != null)
{
this.unspentTransactions = unspentTransactions.ToImmutable().ToBuilder();
this.unspentTxesVersion++;
}
if (blockSpentTxes != null)
{
this.blockSpentTxes = blockSpentTxes.ToImmutable().ToBuilder();
this.blockSpentTxesVersion++;
}
if (blockUnmintedTxes != null)
{
this.blockUnmintedTxes = blockUnmintedTxes.ToImmutable().ToBuilder();
this.blockUnmintedTxesVersion++;
}
}
}