Serenity.Data.Row.CloneInto C# (CSharp) Method

CloneInto() public method

public CloneInto ( Row clone, bool cloneHandlers ) : void
clone Row
cloneHandlers bool
return void
        public void CloneInto(Row clone, 
            bool cloneHandlers)
        {
            clone.ignoreConstraints = ignoreConstraints;

            foreach (var field in GetFields())
                field.Copy(this, clone);

            clone.tracking = tracking;
            if (tracking)
            {
                if (assignedFields != null)
                {
                    clone.assignedFields = new bool[assignedFields.Length];
                    Array.Copy(assignedFields, clone.assignedFields, assignedFields.Length);
                }
            }
            else
                clone.assignedFields = null;

            clone.trackWithChecks = trackWithChecks;

            clone.originalValues = originalValues;

            if (dictionaryData != null)
                clone.dictionaryData = (Hashtable)this.dictionaryData.Clone();
            else
                clone.dictionaryData = null;

            if (indexedData != null)
            {
                clone.indexedData = new object[indexedData.Length];
                for (var i = 0; i < indexedData.Length; i++)
                    clone.indexedData[i] = indexedData[i];
            }
            else
                clone.indexedData = null;

            if (previousValues != null)
                clone.previousValues = previousValues.CloneRow();
            else
                clone.previousValues = null;

            if (cloneHandlers)
            {
                clone.postHandler = this.postHandler;
                clone.propertyChanged = this.propertyChanged;

                if (this.validationErrors != null)
                    clone.validationErrors = new Dictionary<string, string>(this.validationErrors);
                else
                    clone.validationErrors = null;
            }
        }