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

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