예제 #1
0
 /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
 public virtual Message With(
     ImmutableObjectGraph.Optional <Contact> author = default(ImmutableObjectGraph.Optional <Contact>),
     ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> > to  = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> >),
     ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> > cc  = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> >),
     ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> > bcc = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> >),
     ImmutableObjectGraph.Optional <System.String> subject = default(ImmutableObjectGraph.Optional <System.String>),
     ImmutableObjectGraph.Optional <System.String> body    = default(ImmutableObjectGraph.Optional <System.String>))
 {
     if (
         (author.IsDefined && author.Value != this.Author) ||
         (to.IsDefined && to.Value != this.To) ||
         (cc.IsDefined && cc.Value != this.Cc) ||
         (bcc.IsDefined && bcc.Value != this.Bcc) ||
         (subject.IsDefined && subject.Value != this.Subject) ||
         (body.IsDefined && body.Value != this.Body))
     {
         return(new Message(
                    author: author.GetValueOrDefault(this.Author),
                    to: to.GetValueOrDefault(this.To),
                    cc: cc.GetValueOrDefault(this.Cc),
                    bcc: bcc.GetValueOrDefault(this.Bcc),
                    subject: subject.GetValueOrDefault(this.Subject),
                    body: body.GetValueOrDefault(this.Body)));
     }
     else
     {
         return(this);
     }
 }
예제 #2
0
        /// <summary>Initializes a new instance of the TreeNode class.</summary>
        protected TreeNode(
            System.UInt32 identity,
            System.String caption,
            System.String filePath,
            System.Boolean visible,
            System.Collections.Immutable.ImmutableHashSet <System.String> attributes,
            System.Collections.Immutable.ImmutableList <TreeNode> children,
            ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableDictionary <System.UInt32, System.Collections.Generic.KeyValuePair <TreeNode, System.UInt32> > > lookupTable = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableDictionary <System.UInt32, System.Collections.Generic.KeyValuePair <TreeNode, System.UInt32> > >),
            ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
        {
            this.identity   = identity;
            this.caption    = caption;
            this.filePath   = filePath;
            this.visible    = visible;
            this.attributes = attributes;
            this.children   = children;
            if (!skipValidation.Value)
            {
                this.Validate();
            }
            var lookupTableInitResult = RecursiveTypeExtensions.LookupTable <TreeNode, TreeNode> .Initialize(this, lookupTable);

            this.lookupTable      = lookupTableInitResult.LookupTable;
            this.inefficiencyLoad = lookupTableInitResult.InefficiencyLoad;
        }
 /// <summary>Initializes a new instance of the AbstractNonEmpty class.</summary>
 protected AbstractNonEmpty(
     System.UInt32 identity,
     System.Boolean oneField,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
 {
     this.identity = identity;
     this.oneField = oneField;
 }
 /// <summary>Initializes a new instance of the Abstract1 class.</summary>
 protected Abstract1(
     System.UInt32 identity,
     System.Int32 abstract1Field1,
     System.Int32 abstract1Field2,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
 {
     this.identity        = identity;
     this.abstract1Field1 = abstract1Field1;
     this.abstract1Field2 = abstract1Field2;
 }
예제 #5
0
 /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
 public Person With(
     ImmutableObjectGraph.Optional <System.String> name = default(ImmutableObjectGraph.Optional <System.String>),
     ImmutableObjectGraph.Optional <System.Int32> age   = default(ImmutableObjectGraph.Optional <System.Int32>),
     ImmutableObjectGraph.Optional <Watch> watch        = default(ImmutableObjectGraph.Optional <Watch>))
 {
     return((Person)this.WithCore(
                name: name,
                age: age,
                watch: watch));
 }
예제 #6
0
 public static Person Create(
     System.String name,
     ImmutableObjectGraph.Optional <System.Int32> age = default(ImmutableObjectGraph.Optional <System.Int32>),
     ImmutableObjectGraph.Optional <Watch> watch      = default(ImmutableObjectGraph.Optional <Watch>))
 {
     return(DefaultInstance.With(
                name: name,
                age: age.GetValueOrDefault(DefaultInstance.Age),
                watch: watch.GetValueOrDefault(DefaultInstance.Watch)));
 }
 /// <summary>Initializes a new instance of the Empty class.</summary>
 protected Empty(
     System.UInt32 identity,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
 {
     this.identity = identity;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
 /// <summary>Initializes a new instance of the EmptyDerived class.</summary>
 protected EmptyDerived(
     System.UInt32 identity,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
     : base(
         identity: identity)
 {
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
 /// <summary>Initializes a new instance of the A class.</summary>
 protected A(
     System.UInt32 identity,
     System.Int32 field1,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
 {
     this.identity = identity;
     this.field1   = field1;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
예제 #10
0
 /// <summary>Initializes a new instance of the Family class.</summary>
 protected Family(
     System.UInt32 identity,
     System.Collections.Immutable.ImmutableSortedSet <Person> members,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
 {
     this.identity = identity;
     this.members  = members;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
 /// <summary>Initializes a new instance of the NonEmptyBase class.</summary>
 protected NonEmptyBase(
     System.UInt32 identity,
     System.Boolean oneField,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
 {
     this.identity = identity;
     this.oneField = oneField;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
예제 #12
0
 /// <summary>Initializes a new instance of the ContainerOfNonRecursiveCollection class.</summary>
 protected ContainerOfNonRecursiveCollection(
     System.UInt32 identity,
     System.Collections.Immutable.ImmutableList <NonRecursiveElement> metadata,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
     : base(
         identity: identity)
 {
     this.metadata = metadata;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
예제 #13
0
        public static Person Create(
            System.String name,
            ImmutableObjectGraph.Optional <System.Int32> age = default(ImmutableObjectGraph.Optional <System.Int32>),
            ImmutableObjectGraph.Optional <Watch> watch      = default(ImmutableObjectGraph.Optional <Watch>))
        {
            var identity = Optional.For(NewIdentity());

            return(DefaultInstance.WithFactory(
                       name: Optional.For(name),
                       age: Optional.For(age.GetValueOrDefault(DefaultInstance.Age)),
                       watch: Optional.For(watch.GetValueOrDefault(DefaultInstance.Watch)),
                       identity: Optional.For(identity.GetValueOrDefault(DefaultInstance.Identity))));
        }
 /// <summary>Initializes a new instance of the NotSoEmptyDerived class.</summary>
 protected NotSoEmptyDerived(
     System.UInt32 identity,
     System.Boolean oneField,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
     : base(
         identity: identity)
 {
     this.oneField = oneField;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
예제 #15
0
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        protected virtual Person WithCore(
            ImmutableObjectGraph.Optional <System.String> name = default(ImmutableObjectGraph.Optional <System.String>),
            ImmutableObjectGraph.Optional <System.Int32> age   = default(ImmutableObjectGraph.Optional <System.Int32>),
            ImmutableObjectGraph.Optional <Watch> watch        = default(ImmutableObjectGraph.Optional <Watch>))
        {
            var identity = default(ImmutableObjectGraph.Optional <System.UInt32>);

            return(this.WithFactory(
                       name: Optional.For(name.GetValueOrDefault(this.Name)),
                       age: Optional.For(age.GetValueOrDefault(this.Age)),
                       watch: Optional.For(watch.GetValueOrDefault(this.Watch)),
                       identity: Optional.For(identity.GetValueOrDefault(this.Identity))));
        }
 /// <summary>Initializes a new instance of the EmptyDerivedFromAbstract class.</summary>
 protected EmptyDerivedFromAbstract(
     System.UInt32 identity,
     System.Boolean oneField,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
     : base(
         identity: identity,
         oneField: oneField)
 {
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
 /// <summary>Initializes a new instance of the ReqAndHierL1 class.</summary>
 protected ReqAndHierL1(
     System.UInt32 identity,
     System.String l1Field1,
     System.String l1Field2,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
 {
     this.identity = identity;
     this.l1Field1 = l1Field1;
     this.l1Field2 = l1Field2;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
예제 #18
0
 /// <summary>Initializes a new instance of the Contact class.</summary>
 protected Contact(
     System.UInt32 identity,
     System.String name,
     System.String email,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
 {
     this.identity = identity;
     this.name     = name;
     this.email    = email;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
예제 #19
0
 /// <summary>Initializes a new instance of the Fruit class.</summary>
 protected Fruit(
     System.UInt32 identity,
     System.String color,
     System.Int32 skinThickness,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
 {
     this.identity      = identity;
     this.color         = color;
     this.skinThickness = skinThickness;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
예제 #20
0
 /// <summary>Initializes a new instance of the Watch class.</summary>
 protected Watch(
     System.UInt32 identity,
     System.String color,
     System.Int32 size,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
 {
     this.identity = identity;
     this.color    = color;
     this.size     = size;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
예제 #21
0
        /// <summary>Initializes a new instance of the RecursiveContainer class.</summary>
        protected RecursiveContainer(
            System.UInt32 identity,
            System.Collections.Immutable.ImmutableList <RootRecursive> children,
            ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableDictionary <System.UInt32, System.Collections.Generic.KeyValuePair <RootRecursive, System.UInt32> > > lookupTable = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableDictionary <System.UInt32, System.Collections.Generic.KeyValuePair <RootRecursive, System.UInt32> > >),
            ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
            : base(
                identity: identity)
        {
            this.children = children;
            var lookupTableInitResult = RecursiveTypeExtensions.LookupTable <RootRecursive, RecursiveContainer> .Initialize(this, lookupTable);

            this.lookupTable      = lookupTableInitResult.LookupTable;
            this.inefficiencyLoad = lookupTableInitResult.InefficiencyLoad;
        }
예제 #22
0
 /// <summary>Initializes a new instance of the NonRecursiveElement class.</summary>
 protected NonRecursiveElement(
     System.UInt32 identity,
     System.String name,
     System.String value,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
     : base(
         identity: identity)
 {
     this.name  = name;
     this.value = value;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
 /// <summary>Initializes a new instance of the B class.</summary>
 protected B(
     System.UInt32 identity,
     System.Int32 field1,
     System.Int32 field2,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
     : base(
         identity: identity,
         field1: field1)
 {
     this.field2 = field2;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
 /// <summary>Initializes a new instance of the Abstract2 class.</summary>
 protected Abstract2(
     System.UInt32 identity,
     System.Int32 abstract1Field1,
     System.Int32 abstract1Field2,
     System.Int32 abstract2Field1,
     System.Int32 abstract2Field2,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
     : base(
         identity: identity,
         abstract1Field1: abstract1Field1,
         abstract1Field2: abstract1Field2)
 {
     this.abstract2Field1 = abstract2Field1;
     this.abstract2Field2 = abstract2Field2;
 }
예제 #25
0
 /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
 public Message With(
     ImmutableObjectGraph.Optional <Contact> author = default(ImmutableObjectGraph.Optional <Contact>),
     ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> > to  = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> >),
     ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> > cc  = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> >),
     ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> > bcc = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> >),
     ImmutableObjectGraph.Optional <System.String> subject = default(ImmutableObjectGraph.Optional <System.String>),
     ImmutableObjectGraph.Optional <System.String> body    = default(ImmutableObjectGraph.Optional <System.String>))
 {
     return((Message)this.WithCore(
                author: author,
                to: to,
                cc: cc,
                bcc: bcc,
                subject: subject,
                body: body));
 }
예제 #26
0
 /// <summary>Initializes a new instance of the Person class.</summary>
 protected Person(
     System.UInt32 identity,
     System.String name,
     System.Int32 age,
     Watch watch,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
 {
     this.identity = identity;
     this.name     = name;
     this.age      = age;
     this.watch    = watch;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }
예제 #27
0
 public static Message Create(
     ImmutableObjectGraph.Optional <Contact> author = default(ImmutableObjectGraph.Optional <Contact>),
     ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> > to  = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> >),
     ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> > cc  = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> >),
     ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> > bcc = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> >),
     ImmutableObjectGraph.Optional <System.String> subject = default(ImmutableObjectGraph.Optional <System.String>),
     ImmutableObjectGraph.Optional <System.String> body    = default(ImmutableObjectGraph.Optional <System.String>))
 {
     return(DefaultInstance.With(
                author: author.GetValueOrDefault(DefaultInstance.Author),
                to: to.GetValueOrDefault(DefaultInstance.To),
                cc: cc.GetValueOrDefault(DefaultInstance.Cc),
                bcc: bcc.GetValueOrDefault(DefaultInstance.Bcc),
                subject: subject.GetValueOrDefault(DefaultInstance.Subject),
                body: body.GetValueOrDefault(DefaultInstance.Body)));
 }
예제 #28
0
        /// <summary>Returns a new instance of this object with any number of properties changed.</summary>
        protected virtual Message WithCore(
            ImmutableObjectGraph.Optional <Contact> author = default(ImmutableObjectGraph.Optional <Contact>),
            ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> > to  = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> >),
            ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> > cc  = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> >),
            ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> > bcc = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> >),
            ImmutableObjectGraph.Optional <System.String> subject = default(ImmutableObjectGraph.Optional <System.String>),
            ImmutableObjectGraph.Optional <System.String> body    = default(ImmutableObjectGraph.Optional <System.String>))
        {
            var identity = default(ImmutableObjectGraph.Optional <System.UInt32>);

            return(this.WithFactory(
                       author: Optional.For(author.GetValueOrDefault(this.Author)),
                       to: Optional.For(to.GetValueOrDefault(this.To)),
                       cc: Optional.For(cc.GetValueOrDefault(this.Cc)),
                       bcc: Optional.For(bcc.GetValueOrDefault(this.Bcc)),
                       subject: Optional.For(subject.GetValueOrDefault(this.Subject)),
                       body: Optional.For(body.GetValueOrDefault(this.Body)),
                       identity: Optional.For(identity.GetValueOrDefault(this.Identity))));
        }
예제 #29
0
        public static Message Create(
            ImmutableObjectGraph.Optional <Contact> author = default(ImmutableObjectGraph.Optional <Contact>),
            ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> > to  = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> >),
            ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> > cc  = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> >),
            ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> > bcc = default(ImmutableObjectGraph.Optional <System.Collections.Immutable.ImmutableList <Contact> >),
            ImmutableObjectGraph.Optional <System.String> subject = default(ImmutableObjectGraph.Optional <System.String>),
            ImmutableObjectGraph.Optional <System.String> body    = default(ImmutableObjectGraph.Optional <System.String>))
        {
            var identity = Optional.For(NewIdentity());

            return(DefaultInstance.WithFactory(
                       author: Optional.For(author.GetValueOrDefault(DefaultInstance.Author)),
                       to: Optional.For(to.GetValueOrDefault(DefaultInstance.To)),
                       cc: Optional.For(cc.GetValueOrDefault(DefaultInstance.Cc)),
                       bcc: Optional.For(bcc.GetValueOrDefault(DefaultInstance.Bcc)),
                       subject: Optional.For(subject.GetValueOrDefault(DefaultInstance.Subject)),
                       body: Optional.For(body.GetValueOrDefault(DefaultInstance.Body)),
                       identity: Optional.For(identity.GetValueOrDefault(DefaultInstance.Identity))));
        }
 /// <summary>Initializes a new instance of the ReqAndHierL2 class.</summary>
 protected ReqAndHierL2(
     System.UInt32 identity,
     System.String l1Field1,
     System.String l1Field2,
     System.String l2Field1,
     System.String l2Field2,
     ImmutableObjectGraph.Optional <bool> skipValidation = default(ImmutableObjectGraph.Optional <bool>))
     : base(
         identity: identity,
         l1Field1: l1Field1,
         l1Field2: l1Field2)
 {
     this.l2Field1 = l2Field1;
     this.l2Field2 = l2Field2;
     if (!skipValidation.Value)
     {
         this.Validate();
     }
 }