public override void load(std::istream @is) { m_sync.load(@is); StdInputStream inputStream = new StdInputStream(@is); CryptoNote.BinaryInputStreamSerializer s = new CryptoNote.BinaryInputStreamSerializer(inputStream); uint version = 0; s.functorMethod(version, "version"); if (version > GlobalMembers.TRANSFERS_STORAGE_ARCHIVE_VERSION) { throw new System.Exception("TransfersSyncronizer version mismatch"); } //C++ TO C# CONVERTER TODO TASK: C# does not allow declaring types within methods: // struct ConsumerState // { // PublicKey viewKey; // string state; // ClassicVector<System.Tuple<AccountPublicAddress, string>> subscriptionStates; // }; List <ConsumerState> updatedStates = new List <ConsumerState>(); try { ulong subscriptionCount = 0; s.beginArray(ref subscriptionCount, "consumers"); while (subscriptionCount-- != 0) { s.beginObject(""); PublicKey viewKey = new PublicKey(); s.functorMethod(viewKey, "view_key"); string blob; s.functorMethod(blob, "state"); var subIter = m_consumers.find(viewKey); //C++ TO C# CONVERTER TODO TASK: Iterators are only converted within the context of 'while' and 'for' loops: if (subIter != m_consumers.end()) { //C++ TO C# CONVERTER TODO TASK: Iterators are only converted within the context of 'while' and 'for' loops: var consumerState = m_sync.getConsumerState(subIter.second.get()); Debug.Assert(consumerState); { // store previous state var prevConsumerState = GlobalMembers.getObjectState(*consumerState); // load consumer state GlobalMembers.setObjectState(*consumerState, blob); updatedStates.Add(ConsumerState({ viewKey, std::move(prevConsumerState) })); }