public void ProcessArray <[IsArray] TArray>(IReadOnlyExactValueDescriptor <TArray> descriptor) { WriteAssemblyQualifiedNameIfNeeded(descriptor); Array array = descriptor.Get() as Array; int rank = array.Rank; int[] lowerIndicies = Enumerable.Range(0, rank) .Select(array.GetLowerBound) .ToArray(); int[] lengths = Enumerable.Range(0, rank) .Select(array.GetLength) .ToArray(); WriteIntArray(lowerIndicies); WriteIntArray(lengths); descriptor.Climb(); }
private void WriteAssemblyQualifiedNameIfNeeded <T>(IReadOnlyExactValueDescriptor <T> descriptor) { WriteAssemblyQualifiedNameIfNeeded (descriptor.StateMember as BinaryStateMember, typeof(T)); }
public void ProcessObjectOnly(IReadOnlyExactValueDescriptor <object> descriptor) { // Does nothing. WriteAssemblyQualifiedNameIfNeeded(descriptor); }
public void ProcessForReadOnly(IReadOnlyExactValueDescriptor <DateTime> descriptor) { WriteAssemblyQualifiedNameIfNeeded(descriptor); _writer.Write(descriptor.Get().Ticks); }
public void ProcessForReadOnly(IReadOnlyExactValueDescriptor <string> descriptor) { WriteAssemblyQualifiedNameIfNeeded(descriptor); _writer.Write(descriptor.Get()); }