public SerializationMetadata AcquirePropertyMetadata(Type type, PropertyInfo property, ref uint nextIndex)
        {
            var args = new AcquirePropertyMetadataArgs(type, property);
            OnAcquirePropertyMetadata(args);

            var index = args.Index.HasValue ? args.Index.Value : nextIndex++;
            var metadata = new SerializationMetadata(index, args.Args);
            return metadata;
        }
Exemplo n.º 2
0
        public SerializationMetadata AcquirePropertyMetadata(Type type, PropertyInfo property, ref uint nextIndex)
        {
            var args = new AcquirePropertyMetadataArgs(type, property);

            OnAcquirePropertyMetadata(args);

            var index = args.Index ?? nextIndex;

            nextIndex = index + 1;
            var metadata = new SerializationMetadata(index);

            return(metadata);
        }
Exemplo n.º 3
0
 protected virtual void OnAcquirePropertyMetadata(AcquirePropertyMetadataArgs args)
 {
     args.Index = args.Property.GetCustomAttribute <IndexAttribute>()?.Index;
 }
 protected virtual void OnAcquirePropertyMetadata(AcquirePropertyMetadataArgs args)
 {
 }