Ejemplo n.º 1
0
        /// <summary>
        /// Deserializes the byte array and returns an instance of <see cref="__Creator"/>.
        /// </summary>
        /// <returns>If the byte array can be deserialized and cast to an instance of <see cref="__Creator"/>,
        /// returns an instance of <see cref="__Creator"/>; otherwise returns null.</returns>
        public static new __Creator FromArray(byte[] byteArray)
        {
            __Creator o = null;

            try
            {
                o = (__Creator)CustomObjectBase.FromArray(byteArray);
            }
            catch (Exception e)
            {
                throw e;
            }

            return(o);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Compares this instance with a specified object. Throws an ArgumentException if the specified object is not of type <see cref="__Creator"/>.
        /// </summary>
        /// <param name="obj">An <see cref="__Creator"/> object to compare with this instance.</param>
        /// <returns>0 if the specified object equals this instance; -1 if the specified object does not equal this instance.</returns>
        public virtual int CompareTo(Object obj)
        {
            if (obj is __Creator)
            {
                __Creator o = (__Creator)obj;

                if (
                    o.IsNew == IsNew &&
                    o.IsDeleted == IsDeleted &&
                    o.CreatorID == CreatorID &&
                    GetComparisonString(o.CreatorName) == GetComparisonString(CreatorName) &&
                    GetComparisonString(o.FirstNameFirst) == GetComparisonString(FirstNameFirst) &&
                    GetComparisonString(o.SimpleName) == GetComparisonString(SimpleName) &&
                    GetComparisonString(o.DOB) == GetComparisonString(DOB) &&
                    GetComparisonString(o.DOD) == GetComparisonString(DOD) &&
                    GetComparisonString(o.Biography) == GetComparisonString(Biography) &&
                    GetComparisonString(o.CreatorNote) == GetComparisonString(CreatorNote) &&
                    GetComparisonString(o.MARCDataFieldTag) == GetComparisonString(MARCDataFieldTag) &&
                    GetComparisonString(o.MARCCreator_a) == GetComparisonString(MARCCreator_a) &&
                    GetComparisonString(o.MARCCreator_b) == GetComparisonString(MARCCreator_b) &&
                    GetComparisonString(o.MARCCreator_c) == GetComparisonString(MARCCreator_c) &&
                    GetComparisonString(o.MARCCreator_d) == GetComparisonString(MARCCreator_d) &&
                    GetComparisonString(o.MARCCreator_Full) == GetComparisonString(MARCCreator_Full) &&
                    o.CreationDate == CreationDate &&
                    o.LastModifiedDate == LastModifiedDate
                    )
                {
                    o = null;
                    return(0);                    // true
                }
                else
                {
                    o = null;
                    return(-1);                    // false
                }
            }
            else
            {
                throw new ArgumentException("Argument is not of type __Creator");
            }
        }