Beispiel #1
0
        public virtual void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<RecordSpecification>");
            try
            {
                sb.AppendLine("<recordSets type=\"uint\">" + this._recordSets.Count.ToString(CultureInfo.InvariantCulture) + "</recordSets>");
                for (int idx = 0; idx < this._recordSets.Count; idx++)
                {
                    sb.AppendLine("<recordSets" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"RecordSpecificationElement\">");
                    RecordSpecificationElement aRecordSpecificationElement = (RecordSpecificationElement)this._recordSets[idx];
                    aRecordSpecificationElement.Reflection(sb);
                    sb.AppendLine("</recordSets" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</RecordSpecification>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
Beispiel #2
0
        public virtual void Unmarshal(DataInputStream dis)
        {
            if (dis != null)
            {
                try
                {
                    this._numberOfRecordSets = dis.ReadUnsignedInt();
                    for (int idx = 0; idx < this.NumberOfRecordSets; idx++)
                    {
                        RecordSpecificationElement anX = new RecordSpecificationElement();
                        anX.Unmarshal(dis);
                        this._recordSets.Add(anX);
                    }
                    ;
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
Beispiel #3
0
        public virtual int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize += 4;  // this._numberOfRecordSets
            for (int idx = 0; idx < this._recordSets.Count; idx++)
            {
                RecordSpecificationElement listElement = (RecordSpecificationElement)this._recordSets[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
Beispiel #4
0
        /// <summary>
        /// Compares for reference AND value equality.
        /// </summary>
        /// <param name="obj">The object to compare with this instance.</param>
        /// <returns>
        ///     <c>true</c> if both operands are equal; otherwise, <c>false</c>.
        /// </returns>
        public bool Equals(RecordSpecificationElement obj)
        {
            bool ivarsEqual = true;

            if (obj.GetType() != this.GetType())
            {
                return(false);
            }

            if (this._recordID != obj._recordID)
            {
                ivarsEqual = false;
            }

            if (this._recordSetSerialNumber != obj._recordSetSerialNumber)
            {
                ivarsEqual = false;
            }

            if (this._recordLength != obj._recordLength)
            {
                ivarsEqual = false;
            }

            if (this._recordCount != obj._recordCount)
            {
                ivarsEqual = false;
            }

            if (this._recordValues != obj._recordValues)
            {
                ivarsEqual = false;
            }

            if (this._pad4 != obj._pad4)
            {
                ivarsEqual = false;
            }

            return(ivarsEqual);
        }
Beispiel #5
0
        public virtual void Marshal(DataOutputStream dos)
        {
            if (dos != null)
            {
                try
                {
                    dos.WriteUnsignedInt((uint)this._recordSets.Count);

                    for (int idx = 0; idx < this._recordSets.Count; idx++)
                    {
                        RecordSpecificationElement aRecordSpecificationElement = (RecordSpecificationElement)this._recordSets[idx];
                        aRecordSpecificationElement.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }