示例#1
0
        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();
        }
示例#2
0
 private void WriteAssemblyQualifiedNameIfNeeded <T>(IReadOnlyExactValueDescriptor <T> descriptor)
 {
     WriteAssemblyQualifiedNameIfNeeded
         (descriptor.StateMember as BinaryStateMember,
         typeof(T));
 }
示例#3
0
 public void ProcessObjectOnly(IReadOnlyExactValueDescriptor <object> descriptor)
 {
     // Does nothing.
     WriteAssemblyQualifiedNameIfNeeded(descriptor);
 }
示例#4
0
 public void ProcessForReadOnly(IReadOnlyExactValueDescriptor <DateTime> descriptor)
 {
     WriteAssemblyQualifiedNameIfNeeded(descriptor);
     _writer.Write(descriptor.Get().Ticks);
 }
示例#5
0
        public void ProcessForReadOnly(IReadOnlyExactValueDescriptor <string> descriptor)
        {
            WriteAssemblyQualifiedNameIfNeeded(descriptor);

            _writer.Write(descriptor.Get());
        }