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

                if (
                    o.IsNew == IsNew &&
                    o.IsDeleted == IsDeleted &&
                    o.PageID == PageID &&
                    o.Sequence == Sequence &&
                    GetComparisonString(o.PagePrefix) == GetComparisonString(PagePrefix) &&
                    GetComparisonString(o.PageNumber) == GetComparisonString(PageNumber) &&
                    o.Implied == Implied &&
                    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 __IndicatedPage");
            }
        }
예제 #2
0
        /// <summary>
        /// Deserializes the byte array and returns an instance of <see cref="__IndicatedPage"/>.
        /// </summary>
        /// <returns>If the byte array can be deserialized and cast to an instance of <see cref="__IndicatedPage"/>,
        /// returns an instance of <see cref="__IndicatedPage"/>; otherwise returns null.</returns>
        public static new __IndicatedPage FromArray(byte[] byteArray)
        {
            __IndicatedPage o = null;

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

            return(o);
        }