コード例 #1
0
        /// <summary>Returns a new instance with the Author property set to the specified value.</summary>
        public Message WithAuthor(Contact value)
        {
            if (value == this.Author) {
                return this;
            }

            return this.With(author: Optional.For(value));
        }
コード例 #2
0
 /// <summary>Removes the specified element from the Cc collection.</summary>
 public Message RemoveCc(Contact value)
 {
     return this.With(cc: this.Cc.Remove(value));
 }
コード例 #3
0
 /// <summary>Removes the specified element from the To collection.</summary>
 public Message RemoveTo(Contact value)
 {
     return this.With(to: this.To.Remove(value));
 }
コード例 #4
0
 /// <summary>Adds the specified element from the To collection.</summary>
 public Message AddTo(Contact value)
 {
     return this.With(to: this.To.Add(value));
 }
コード例 #5
0
 /// <summary>Removes the specified element from the Bcc collection.</summary>
 public Message RemoveBcc(Contact value)
 {
     return this.With(bcc: this.Bcc.Remove(value));
 }
コード例 #6
0
 /// <summary>Adds the specified element from the Cc collection.</summary>
 public Message AddCc(Contact value)
 {
     return this.With(cc: this.Cc.Add(value));
 }
コード例 #7
0
 /// <summary>Adds the specified element from the Bcc collection.</summary>
 public Message AddBcc(Contact value)
 {
     return this.With(bcc: this.Bcc.Add(value));
 }
コード例 #8
0
        /// <summary>Initializes a new instance of the Message class.</summary>
        protected Message(
			System.UInt32 identity,
			Contact author,
			System.Collections.Immutable.ImmutableList<Contact> to,
			System.Collections.Immutable.ImmutableList<Contact> cc,
			System.Collections.Immutable.ImmutableList<Contact> bcc,
			System.String subject,
			System.String body,
			ImmutableObjectGraph.Optional<bool> skipValidation = default(ImmutableObjectGraph.Optional<bool>))
        {
            this.identity = identity;
            this.author = author;
            this.to = to;
            this.cc = cc;
            this.bcc = bcc;
            this.subject = subject;
            this.body = body;
            if (!skipValidation.Value) {
                this.Validate();
            }
        }
コード例 #9
0
 public Contact ToImmutable()
 {
     return this.immutable = this.immutable.With(
         ImmutableObjectGraph.Optional.For(this.Name),
         ImmutableObjectGraph.Optional.For(this.Email));
 }
コード例 #10
0
            internal Builder(Contact immutable)
            {
                this.immutable = immutable;

                this.name = immutable.Name;
                this.email = immutable.Email;
            }