protected virtual void WriteTo(ObjectWriter writer) { writer.WriteValue(_messageProvider); writer.WriteUInt32((uint)_errorCode); writer.WriteInt32((int)_effectiveSeverity); writer.WriteInt32((int)_defaultSeverity); int count = _arguments.Length; writer.WriteUInt32((uint)count); if (count > 0) { foreach (var arg in _arguments) { writer.WriteString(arg.ToString()); } } }
public static Checksum Create <T>(WellKnownSynchronizationKind kind, T value, ISerializerService serializer) { using (var stream = SerializableBytes.CreateWritableStream()) using (var objectWriter = new ObjectWriter(stream)) { objectWriter.WriteInt32((int)kind); serializer.Serialize(value, objectWriter, CancellationToken.None); return(Create(stream)); } }
public void WriteTo(ObjectWriter writer) { Id.WriteTo(writer); writer.WriteString(Name); writer.WriteValue(Folders.ToArray()); writer.WriteInt32((int)SourceCodeKind); writer.WriteString(FilePath); writer.WriteBoolean(IsGenerated); }
public static Checksum Create(WellKnownSynchronizationKind kind, IObjectWritable @object) { using (var stream = SerializableBytes.CreateWritableStream()) using (var objectWriter = new ObjectWriter(stream)) { objectWriter.WriteInt32((int)kind); @object.WriteTo(objectWriter); return(Create(stream)); } }
void IObjectWritable.WriteTo(ObjectWriter writer) { writer.WriteType(_resourceSource); writer.WriteString(_nameOfLocalizableResource); var length = _formatArguments.Length; writer.WriteInt32(length); for (int i = 0; i < length; i++) { writer.WriteString(_formatArguments[i]); } }
// TODO: WriteAsync? internal void WriteTo(ObjectWriter writer) { writer.WriteString(SerializationFormat); this.Version.WriteTo(writer); writer.WriteInt32(this.projectToProjectsItReferencesMap.Count); foreach (var id in this.projectToProjectsItReferencesMap.Keys.OrderBy(p => p.Id)) { var project = this.Solution.GetProject(id); if (project != null && !string.IsNullOrEmpty(project.FilePath)) { ImmutableHashSet <ProjectId> projRefs; if (this.projectToProjectsItReferencesMap.TryGetValue(id, out projRefs)) { var referencedProjects = projRefs.OrderBy(r => r.Id) .Select(r => this.Solution.GetProject(r)) .Where(p => p != null && !string.IsNullOrEmpty(p.FilePath)) .ToList(); writer.WriteInt32(referencedProjects.Count); writer.WriteString(project.FilePath); if (referencedProjects.Count > 0) { // project references foreach (var referencedProject in referencedProjects) { writer.WriteString(referencedProject.FilePath); } } continue; } } // invalid project writer.WriteInt32(-1); } }
public static Checksum Create(WellKnownSynchronizationKind kind, IEnumerable <Checksum> checksums) { using var stream = SerializableBytes.CreateWritableStream(); using var writer = new ObjectWriter(stream); writer.WriteInt32((int)kind); foreach (var checksum in checksums) { checksum.WriteTo(writer); } return(Create(stream)); }
public static Checksum Create(WellKnownSynchronizationKind kind, ImmutableArray <byte> bytes) { using var stream = SerializableBytes.CreateWritableStream(); using var writer = new ObjectWriter(stream); writer.WriteInt32((int)kind); for (var i = 0; i < bytes.Length; i++) { writer.WriteByte(bytes[i]); } return(Create(stream)); }
internal void WriteTo(ObjectWriter writer) { writer.WriteInt64(_utcLastModified.ToBinary()); writer.WriteInt32(_localIncrement); writer.WriteInt32(_globalIncrement); }
public void WriteTo(ObjectWriter writer) { writer.WriteInt64(Data1); writer.WriteInt64(Data2); writer.WriteInt32(Data3); }