コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
                }
            }
        }
コード例 #3
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(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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
                }
            }
        }