public virtual void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<StandardVariableSpecification>");
            try
            {
                sb.AppendLine("<standardVariables type=\"ushort\">" + this._standardVariables.Count.ToString(CultureInfo.InvariantCulture) + "</standardVariables>");
                for (int idx = 0; idx < this._standardVariables.Count; idx++)
                {
                    sb.AppendLine("<standardVariables" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"SimulationManagementPduHeader\">");
                    SimulationManagementPduHeader aSimulationManagementPduHeader = (SimulationManagementPduHeader)this._standardVariables[idx];
                    aSimulationManagementPduHeader.Reflection(sb);
                    sb.AppendLine("</standardVariables" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</StandardVariableSpecification>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
        /// <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(SimulationManagementPduHeader obj)
        {
            bool ivarsEqual = true;

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

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

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

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

            return(ivarsEqual);
        }
        public virtual void Unmarshal(DataInputStream dis)
        {
            if (dis != null)
            {
                try
                {
                    this._numberOfStandardVariableRecords = dis.ReadUnsignedShort();
                    for (int idx = 0; idx < this.NumberOfStandardVariableRecords; idx++)
                    {
                        SimulationManagementPduHeader anX = new SimulationManagementPduHeader();
                        anX.Unmarshal(dis);
                        this._standardVariables.Add(anX);
                    }
                    ;
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
        public virtual int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize += 2;  // this._numberOfStandardVariableRecords
            for (int idx = 0; idx < this._standardVariables.Count; idx++)
            {
                SimulationManagementPduHeader listElement = (SimulationManagementPduHeader)this._standardVariables[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
        public virtual void Marshal(DataOutputStream dos)
        {
            if (dos != null)
            {
                try
                {
                    dos.WriteUnsignedShort((ushort)this._standardVariables.Count);

                    for (int idx = 0; idx < this._standardVariables.Count; idx++)
                    {
                        SimulationManagementPduHeader aSimulationManagementPduHeader = (SimulationManagementPduHeader)this._standardVariables[idx];
                        aSimulationManagementPduHeader.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
        public virtual void Unmarshal(DataInputStream dis)
        {
            if (dis != null)
            {
                try
                {
                    this._numberOfStandardVariableRecords = dis.ReadUnsignedShort();
                    for (int idx = 0; idx < this.NumberOfStandardVariableRecords; idx++)
                    {
                        SimulationManagementPduHeader anX = new SimulationManagementPduHeader();
                        anX.Unmarshal(dis);
                        this._standardVariables.Add(anX);
                    };

                }
                catch (Exception e)
                {
            #if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
            #endif
                    this.OnException(e);
                }
            }
        }
        /// <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(SimulationManagementPduHeader obj)
        {
            bool ivarsEqual = true;

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

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

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

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

            return ivarsEqual;
        }