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

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

            return(o);
        }
Exemple #2
0
        /// <summary>
        /// Compares this instance with a specified object. Throws an ArgumentException if the specified object is not of type <see cref="__PDF"/>.
        /// </summary>
        /// <param name="obj">An <see cref="__PDF"/> 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 __PDF)
            {
                __PDF o = (__PDF)obj;

                if (
                    o.IsNew == IsNew &&
                    o.IsDeleted == IsDeleted &&
                    o.PdfID == PdfID &&
                    o.ItemID == ItemID &&
                    GetComparisonString(o.EmailAddress) == GetComparisonString(EmailAddress) &&
                    GetComparisonString(o.ShareWithEmailAddresses) == GetComparisonString(ShareWithEmailAddresses) &&
                    o.ImagesOnly == ImagesOnly &&
                    GetComparisonString(o.ArticleTitle) == GetComparisonString(ArticleTitle) &&
                    GetComparisonString(o.ArticleCreators) == GetComparisonString(ArticleCreators) &&
                    GetComparisonString(o.ArticleTags) == GetComparisonString(ArticleTags) &&
                    GetComparisonString(o.FileLocation) == GetComparisonString(FileLocation) &&
                    GetComparisonString(o.FileUrl) == GetComparisonString(FileUrl) &&
                    o.FileGenerationDate == FileGenerationDate &&
                    o.FileDeletionDate == FileDeletionDate &&
                    o.PdfStatusID == PdfStatusID &&
                    o.NumberImagesMissing == NumberImagesMissing &&
                    o.NumberOcrMissing == NumberOcrMissing &&
                    GetComparisonString(o.Comment) == GetComparisonString(Comment) &&
                    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 __PDF");
            }
        }