Exemple #1
0
        /// <summary>
        /// Creates a deep copy of the passed object.
        /// </summary>
        /// <param name="old">An entity object to create the deep copy from.</param>
        private void CopyMembers(Entity old)
        {
            this.guid = old.guid;
            this.concurrencyVersion = old.concurrencyVersion;
            this.parentReference    = new ParentEntityReference <Entity>(old.parentReference);
            this.EntityType         = old.EntityType; // always use property!
            this.number             = old.number;
            this.name             = old.name;
            this.version          = old.version;
            this.system           = old.system;
            this.hidden           = old.hidden;
            this.readOnly         = old.readOnly;
            this.primary          = old.primary;
            this.deleted          = old.deleted;
            this.lockOwner        = old.lockOwner;
            this.runningState     = old.runningState;
            this.alertState       = old.alertState;
            this.deploymentState  = old.deploymentState;
            this.userGuidOwner    = old.userGuidOwner;
            this.dateCreated      = old.dateCreated;
            this.userGuidCreated  = old.userGuidCreated;
            this.dateModified     = old.dateModified;
            this.userGuidModified = old.userGuidModified;
            this.dateDeleted      = old.dateDeleted;
            this.userGuidDeleted  = old.userGuidDeleted;
            this.settings         = new ParameterCollection(old.settings);
            this.comments         = old.comments;

            CopyEntityReferences(old);
            InitializeChildTypes();
        }
Exemple #2
0
        private void InitializeMembers(StreamingContext context)
        {
            var now = DateTime.Now;

            this.isExisting      = false;
            this.isDeserializing = false;

            this.guid = Guid.Empty;
            this.concurrencyVersion = 0;
            this.parentReference    = new ParentEntityReference <Entity>(this);
            this.entityTypeInternal = EntityType.Unknown;
            this.number             = 0;
            this.name             = string.Empty;
            this.version          = string.Empty;
            this.system           = false;
            this.hidden           = false;
            this.readOnly         = false;
            this.primary          = false;
            this.deleted          = false;
            this.lockOwner        = Guid.Empty;
            this.runningState     = 0;
            this.alertState       = 0;
            this.deploymentState  = DeploymentState.New;
            this.userGuidOwner    = Guid.Empty;
            this.dateCreated      = now;
            this.userGuidCreated  = Guid.Empty;
            this.dateModified     = now;
            this.userGuidModified = Guid.Empty;
            this.dateDeleted      = DateTime.MinValue;
            this.userGuidDeleted  = Guid.Empty;
            this.settings         = new ParameterCollection();
            this.comments         = string.Empty;

            InitializeEntityReferences();
            this.isEntityReferencesLoaded = false;

            InitializeChildTypes();
        }
Exemple #3
0
 /// <summary>
 /// Copies private member variables from another object.
 /// </summary>
 /// <remarks>
 /// Called by the copy constructor.
 /// </remarks>
 /// <param name="old">The original object to copy from.</param>
 private void CopyMembers(ParentEntityReference <T> old)
 {
     this.parentEntity = old.parentEntity;
 }
Exemple #4
0
 /// <summary>
 /// The copy constructor that creates a deep copy of the
 /// <b>ReferencedEntity</b> class passes as parameter.
 /// </summary>
 /// <param name="old">The original object to copy from.</param>
 public ParentEntityReference(ParentEntityReference <T> old)
     : base(old)
 {
     CopyMembers(old);
 }