/// <summary> /// Registers the <paramref name="serializer" />. The newly added <paramref name="serializer" /> is the first one to be /// considered for the serialization of an object; the previously added serializers are only considered if the new /// <paramref name="serializer" />'s <see cref="Serializer.CanSerialize" /> method returns <c>false</c> for an object. /// </summary> /// <param name="serializer">The serializer that should be registered.</param> private void RegisterSerializer(Serializer serializer) { Requires.NotNull(serializer, nameof(serializer)); Requires.That(!_serializers.Contains(serializer), nameof(serializer), $"The serializer '{serializer.GetType().FullName}' has already been registered."); _serializers.Add(serializer); }
//TODO: Fill in void IFastSerializable.ToStream(Serializer serializer) { }
void IFastSerializable.ToStream(Serializer serializer) { serializer.Write(kernelToDriveMap.Count); serializer.Log("<WriteColection name=\"driveNames\" count=\"" + kernelToDriveMap.Count + "\">\r\n"); foreach (var keyValue in kernelToDriveMap) { serializer.Write(keyValue.Key); serializer.Write(keyValue.Value); } serializer.Log("</WriteColection>\r\n"); serializer.Write(systemDrive); }
void IFastSerializable.ToStream(Serializer serializer) { serializer.Write(driveMapping); serializer.Write(threadIDtoProcessID.Count); serializer.Log("<WriteColection name=\"ProcessIDForThread\" count=\"" + threadIDtoProcessID.Count + "\">\r\n"); foreach (HistoryDictionary<int>.HistoryValue entry in threadIDtoProcessID.Entries) { serializer.Write((long)entry.Key); serializer.Write(entry.StartTime100ns); serializer.Write(entry.Value); } if (threadIDtoProcessIDRundown == null) serializer.Write(0); else { serializer.Write(threadIDtoProcessIDRundown.Count); serializer.Log("<WriteColection name=\"ProcessIDForThreadRundown\" count=\"" + threadIDtoProcessIDRundown.Count + "\">\r\n"); foreach (HistoryDictionary<int>.HistoryValue entry in threadIDtoProcessIDRundown.Entries) { serializer.Write((long)entry.Key); serializer.Write(entry.StartTime100ns); serializer.Write(entry.Value); } } serializer.Log("</WriteColection>\r\n"); serializer.Log("<WriteColection name=\"fileIDToName\" count=\"" + fileIDToName.Count + "\">\r\n"); serializer.Write(fileIDToName.Count); foreach (HistoryDictionary<string>.HistoryValue entry in fileIDToName.Entries) { serializer.Write((long)entry.Key); serializer.Write(entry.StartTime100ns); serializer.Write(entry.Value); } serializer.Log("</WriteColection>\r\n"); serializer.Log("<WriteCollection name=\"diskEventTimeStamp\" count=\"" + diskEventTimeStamp.Count + "\">\r\n"); serializer.Write(diskEventTimeStamp.Count); foreach (var entry in diskEventTimeStamp.Entries) { serializer.Write((int)entry.Key); serializer.Write(entry.StartTime100ns); serializer.Write(entry.Value); } serializer.Log("</WriteCollection>"); }
void IFastSerializable.ToStream(Serializer serializer) { serializer.Write(majorVersion); serializer.Write(minorVersion); serializer.Write((int)format); int count = 0; if (serializedManifest != null) count = serializedManifest.Length; serializer.Write(count); for (int i = 0; i < count; i++) serializer.Write(serializedManifest[i]); }
void IFastSerializable.ToStream(Serializer serializer) { serializer.Write(providers.Count); foreach (ProviderManifest provider in providers.Values) serializer.Write(provider); }
void IFastSerializable.ToStream(Serializer serializer) { serializer.Write((int)eventID); serializer.Write((int)task); serializer.Write(taskName); serializer.Write(taskGuid); serializer.Write((int)opcode); serializer.Write(opcodeName); serializer.Write(providerGuid); serializer.Write(providerName); serializer.Write(MessageFormat); serializer.Write(lookupAsWPP); serializer.Write(payloadNames.Length); foreach (var payloadName in payloadNames) serializer.Write(payloadName); serializer.Write(payloadFetches.Length); foreach (var payloadFetch in payloadFetches) { serializer.Write((short)payloadFetch.offset); serializer.Write((short)payloadFetch.size); if (payloadFetch.type == null) serializer.Write((string)null); else serializer.Write(payloadFetch.type.FullName); serializer.Write((IFastSerializable)null); // This is for the map (eventually) } }