Ejemplo n.º 1
0
        /// <summary>
        /// Compares this instance with a specified object. Throws an ArgumentException if the specified object is not of type <see cref="__Page"/>.
        /// </summary>
        /// <param name="obj">An <see cref="__Page"/> 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 __Page)
            {
                __Page o = (__Page)obj;

                if (
                    o.IsNew == IsNew &&
                    o.IsDeleted == IsDeleted &&
                    o.PageID == PageID &&
                    o.ItemID == ItemID &&
                    GetComparisonString(o.FileNamePrefix) == GetComparisonString(FileNamePrefix) &&
                    o.SequenceOrder == SequenceOrder &&
                    GetComparisonString(o.PageDescription) == GetComparisonString(PageDescription) &&
                    o.Illustration == Illustration &&
                    GetComparisonString(o.Note) == GetComparisonString(Note) &&
                    o.FileSize_Temp == FileSize_Temp &&
                    GetComparisonString(o.FileExtension) == GetComparisonString(FileExtension) &&
                    o.Active == Active &&
                    GetComparisonString(o.Year) == GetComparisonString(Year) &&
                    GetComparisonString(o.Series) == GetComparisonString(Series) &&
                    GetComparisonString(o.Volume) == GetComparisonString(Volume) &&
                    GetComparisonString(o.Issue) == GetComparisonString(Issue) &&
                    GetComparisonString(o.ExternalURL) == GetComparisonString(ExternalURL) &&
                    GetComparisonString(o.AltExternalURL) == GetComparisonString(AltExternalURL) &&
                    GetComparisonString(o.IssuePrefix) == GetComparisonString(IssuePrefix) &&
                    o.LastPageNameLookupDate == LastPageNameLookupDate &&
                    o.PaginationUserID == PaginationUserID &&
                    o.PaginationDate == PaginationDate &&
                    o.CreationDate == CreationDate &&
                    o.LastModifiedDate == LastModifiedDate &&
                    o.CreationUserID == CreationUserID &&
                    o.LastModifiedUserID == LastModifiedUserID
                    )
                {
                    o = null;
                    return(0);                    // true
                }
                else
                {
                    o = null;
                    return(-1);                    // false
                }
            }
            else
            {
                throw new ArgumentException("Argument is not of type __Page");
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Deserializes the byte array and returns an instance of <see cref="__Page"/>.
        /// </summary>
        /// <returns>If the byte array can be deserialized and cast to an instance of <see cref="__Page"/>,
        /// returns an instance of <see cref="__Page"/>; otherwise returns null.</returns>
        public static new __Page FromArray(byte[] byteArray)
        {
            __Page o = null;

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

            return(o);
        }