Пример #1
0
 public ImmutableMessage(Type mappedType, object content, ImmutableAttribute[] attributes, int index)
 {
     MappedType = mappedType;
     Index = index;
     Content = content;
     _attributes = attributes;
 }
Пример #2
0
        public static ImmutableAttribute[] EnvelopeAttributesFromContract(
            ICollection <EnvelopeAttributeContract> attributes)
        {
            var list = new ImmutableAttribute[attributes.Count];

            var idx = 0;

            foreach (var attribute in attributes)
            {
                switch (attribute.Type)
                {
                case EnvelopeAttributeTypeContract.Sender:
                    list[idx] = new ImmutableAttribute(MessageAttributes.EnvelopeSender, attribute.Value);
                    break;

                case EnvelopeAttributeTypeContract.CustomString:
                    list[idx] = new ImmutableAttribute(attribute.Name, attribute.Value);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
                idx += 1;
            }
            return(list);
        }
Пример #3
0
 public ImmutableEnvelope(string envelopeId, ImmutableAttribute[] attributes, ImmutableMessage[] items,
     DateTime deliverOnUtc, DateTime createdOnUtc)
 {
     EnvelopeId = envelopeId;
     DeliverOnUtc = deliverOnUtc;
     _attributes = attributes;
     Items = items;
     CreatedOnUtc = createdOnUtc;
 }
Пример #4
0
        public static ImmutableAttribute[] EnvelopeAttributesFromContract(
            ICollection<EnvelopeAttributeContract> attributes)
        {
            var list = new ImmutableAttribute[attributes.Count];

            var idx = 0;
            foreach (var attribute in attributes)
            {
                switch (attribute.Type)
                {
                    case EnvelopeAttributeTypeContract.Sender:
                        list[idx] = new ImmutableAttribute(MessageAttributes.EnvelopeSender, attribute.Value);
                        break;
                    case EnvelopeAttributeTypeContract.CustomString:
                        list[idx] = new ImmutableAttribute(attribute.Name, attribute.Value);
                        break;
                    default:
                        throw new ArgumentOutOfRangeException();
                }
                idx += 1;
            }
            return list;
        }