public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<TransferControlRequestPdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<orginatingEntityID>");
                this._orginatingEntityID.Reflection(sb);
                sb.AppendLine("</orginatingEntityID>");
                sb.AppendLine("<recevingEntityID>");
                this._recevingEntityID.Reflection(sb);
                sb.AppendLine("</recevingEntityID>");
                sb.AppendLine("<requestID type=\"uint\">" + this._requestID.ToString(CultureInfo.InvariantCulture) + "</requestID>");
                sb.AppendLine("<requiredReliabilityService type=\"byte\">" + this._requiredReliabilityService.ToString(CultureInfo.InvariantCulture) + "</requiredReliabilityService>");
                sb.AppendLine("<tranferType type=\"byte\">" + this._tranferType.ToString(CultureInfo.InvariantCulture) + "</tranferType>");
                sb.AppendLine("<transferEntityID>");
                this._transferEntityID.Reflection(sb);
                sb.AppendLine("</transferEntityID>");
                sb.AppendLine("<recordSets type=\"byte\">" + this._recordSets.Count.ToString(CultureInfo.InvariantCulture) + "</recordSets>");
                for (int idx = 0; idx < this._recordSets.Count; idx++)
                {
                    sb.AppendLine("<recordSets" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"RecordSet\">");
                    RecordSet aRecordSet = (RecordSet)this._recordSets[idx];
                    aRecordSet.Reflection(sb);
                    sb.AppendLine("</recordSets" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</TransferControlRequestPdu>");
            }
            catch (Exception e)
            {
                if (PduBase.TraceExceptions)
                {
                    Trace.WriteLine(e);
                    Trace.Flush();
                }

                this.RaiseExceptionOccured(e);

                if (PduBase.ThrowExceptions)
                {
                    throw e;
                }
            }
        }
        public override int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize  = base.GetMarshalledSize();
            marshalSize += 4;  // this._requestID
            marshalSize += 1;  // this._requiredReliabilityService
            marshalSize += 2;  // this._pad1
            marshalSize += 1;  // this._pad2
            marshalSize += 4;  // this._numberOfRecordSets
            for (int idx = 0; idx < this._recordSets.Count; idx++)
            {
                RecordSet listElement = (RecordSet)this._recordSets[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
        public override int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize  = base.GetMarshalledSize();
            marshalSize += this._orginatingEntityID.GetMarshalledSize(); // this._orginatingEntityID
            marshalSize += this._recevingEntityID.GetMarshalledSize();   // this._recevingEntityID
            marshalSize += 4;                                            // this._requestID
            marshalSize += 1;                                            // this._requiredReliabilityService
            marshalSize += 1;                                            // this._tranferType
            marshalSize += this._transferEntityID.GetMarshalledSize();   // this._transferEntityID
            marshalSize += 1;                                            // this._numberOfRecordSets
            for (int idx = 0; idx < this._recordSets.Count; idx++)
            {
                RecordSet listElement = (RecordSet)this._recordSets[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
Exemplo n.º 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(RecordSet 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);
        }
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._orginatingEntityID.Unmarshal(dis);
                    this._recevingEntityID.Unmarshal(dis);
                    this._requestID = dis.ReadUnsignedInt();
                    this._requiredReliabilityService = dis.ReadUnsignedByte();
                    this._tranferType = dis.ReadUnsignedByte();
                    this._transferEntityID.Unmarshal(dis);
                    this._numberOfRecordSets = dis.ReadUnsignedByte();

                    for (int idx = 0; idx < this.NumberOfRecordSets; idx++)
                    {
                        RecordSet anX = new RecordSet();
                        anX.Unmarshal(dis);
                        this._recordSets.Add(anX);
                    }
                }
                catch (Exception e)
                {
                    if (PduBase.TraceExceptions)
                    {
                        Trace.WriteLine(e);
                        Trace.Flush();
                    }

                    this.RaiseExceptionOccured(e);

                    if (PduBase.ThrowExceptions)
                    {
                        throw e;
                    }
                }
            }
        }
        public override void Marshal(DataOutputStream dos)
        {
            base.Marshal(dos);
            if (dos != null)
            {
                try
                {
                    this._orginatingEntityID.Marshal(dos);
                    this._recevingEntityID.Marshal(dos);
                    dos.WriteUnsignedInt((uint)this._requestID);
                    dos.WriteUnsignedByte((byte)this._requiredReliabilityService);
                    dos.WriteUnsignedByte((byte)this._tranferType);
                    this._transferEntityID.Marshal(dos);
                    dos.WriteUnsignedByte((byte)this._recordSets.Count);

                    for (int idx = 0; idx < this._recordSets.Count; idx++)
                    {
                        RecordSet aRecordSet = (RecordSet)this._recordSets[idx];
                        aRecordSet.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
                    if (PduBase.TraceExceptions)
                    {
                        Trace.WriteLine(e);
                        Trace.Flush();
                    }

                    this.RaiseExceptionOccured(e);

                    if (PduBase.ThrowExceptions)
                    {
                        throw e;
                    }
                }
            }
        }
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<SetRecordReliablePdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<requestID type=\"uint\">" + this._requestID.ToString(CultureInfo.InvariantCulture) + "</requestID>");
                sb.AppendLine("<requiredReliabilityService type=\"byte\">" + this._requiredReliabilityService.ToString(CultureInfo.InvariantCulture) + "</requiredReliabilityService>");
                sb.AppendLine("<pad1 type=\"ushort\">" + this._pad1.ToString(CultureInfo.InvariantCulture) + "</pad1>");
                sb.AppendLine("<pad2 type=\"byte\">" + this._pad2.ToString(CultureInfo.InvariantCulture) + "</pad2>");
                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=\"RecordSet\">");
                    RecordSet aRecordSet = (RecordSet)this._recordSets[idx];
                    aRecordSet.Reflection(sb);
                    sb.AppendLine("</recordSets" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</SetRecordReliablePdu>");
            }
            catch (Exception e)
            {
                if (PduBase.TraceExceptions)
                {
                    Trace.WriteLine(e);
                    Trace.Flush();
                }

                this.RaiseExceptionOccured(e);

                if (PduBase.ThrowExceptions)
                {
                    throw e;
                }
            }
        }
Exemplo n.º 8
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(RecordSet 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;
        }