Пример #1
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(IntercomCommunicationsParameters obj)
        {
            bool ivarsEqual = true;

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

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

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

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

            return(ivarsEqual);
        }
Пример #2
0
        public override void Marshal(DataOutputStream dos)
        {
            base.Marshal(dos);
            if (dos != null)
            {
                try
                {
                    dos.WriteUnsignedByte((byte)this._controlType);
                    dos.WriteUnsignedByte((byte)this._communicationsChannelType);
                    this._sourceEntityID.Marshal(dos);
                    dos.WriteUnsignedByte((byte)this._sourceCommunicationsDeviceID);
                    dos.WriteUnsignedByte((byte)this._sourceLineID);
                    dos.WriteUnsignedByte((byte)this._transmitPriority);
                    dos.WriteUnsignedByte((byte)this._transmitLineState);
                    dos.WriteUnsignedByte((byte)this._command);
                    this._masterEntityID.Marshal(dos);
                    dos.WriteUnsignedShort((ushort)this._masterCommunicationsDeviceID);
                    dos.WriteUnsignedInt((uint)this._intercomParameters.Count);

                    for (int idx = 0; idx < this._intercomParameters.Count; idx++)
                    {
                        IntercomCommunicationsParameters aIntercomCommunicationsParameters = (IntercomCommunicationsParameters)this._intercomParameters[idx];
                        aIntercomCommunicationsParameters.Marshal(dos);
                    }
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
Пример #3
0
        public override void Reflection(StringBuilder sb)
        {
            sb.AppendLine("<IntercomControlPdu>");
            base.Reflection(sb);
            try
            {
                sb.AppendLine("<controlType type=\"byte\">" + this._controlType.ToString(CultureInfo.InvariantCulture) + "</controlType>");
                sb.AppendLine("<communicationsChannelType type=\"byte\">" + this._communicationsChannelType.ToString(CultureInfo.InvariantCulture) + "</communicationsChannelType>");
                sb.AppendLine("<sourceEntityID>");
                this._sourceEntityID.Reflection(sb);
                sb.AppendLine("</sourceEntityID>");
                sb.AppendLine("<sourceCommunicationsDeviceID type=\"byte\">" + this._sourceCommunicationsDeviceID.ToString(CultureInfo.InvariantCulture) + "</sourceCommunicationsDeviceID>");
                sb.AppendLine("<sourceLineID type=\"byte\">" + this._sourceLineID.ToString(CultureInfo.InvariantCulture) + "</sourceLineID>");
                sb.AppendLine("<transmitPriority type=\"byte\">" + this._transmitPriority.ToString(CultureInfo.InvariantCulture) + "</transmitPriority>");
                sb.AppendLine("<transmitLineState type=\"byte\">" + this._transmitLineState.ToString(CultureInfo.InvariantCulture) + "</transmitLineState>");
                sb.AppendLine("<command type=\"byte\">" + this._command.ToString(CultureInfo.InvariantCulture) + "</command>");
                sb.AppendLine("<masterEntityID>");
                this._masterEntityID.Reflection(sb);
                sb.AppendLine("</masterEntityID>");
                sb.AppendLine("<masterCommunicationsDeviceID type=\"ushort\">" + this._masterCommunicationsDeviceID.ToString(CultureInfo.InvariantCulture) + "</masterCommunicationsDeviceID>");
                sb.AppendLine("<intercomParameters type=\"uint\">" + this._intercomParameters.Count.ToString(CultureInfo.InvariantCulture) + "</intercomParameters>");
                for (int idx = 0; idx < this._intercomParameters.Count; idx++)
                {
                    sb.AppendLine("<intercomParameters" + idx.ToString(CultureInfo.InvariantCulture) + " type=\"IntercomCommunicationsParameters\">");
                    IntercomCommunicationsParameters aIntercomCommunicationsParameters = (IntercomCommunicationsParameters)this._intercomParameters[idx];
                    aIntercomCommunicationsParameters.Reflection(sb);
                    sb.AppendLine("</intercomParameters" + idx.ToString(CultureInfo.InvariantCulture) + ">");
                }

                sb.AppendLine("</IntercomControlPdu>");
            }
            catch (Exception e)
            {
#if DEBUG
                Trace.WriteLine(e);
                Trace.Flush();
#endif
                this.OnException(e);
            }
        }
Пример #4
0
        public override void Unmarshal(DataInputStream dis)
        {
            base.Unmarshal(dis);

            if (dis != null)
            {
                try
                {
                    this._controlType = dis.ReadUnsignedByte();
                    this._communicationsChannelType = dis.ReadUnsignedByte();
                    this._sourceEntityID.Unmarshal(dis);
                    this._sourceCommunicationsDeviceID = dis.ReadUnsignedByte();
                    this._sourceLineID      = dis.ReadUnsignedByte();
                    this._transmitPriority  = dis.ReadUnsignedByte();
                    this._transmitLineState = dis.ReadUnsignedByte();
                    this._command           = dis.ReadUnsignedByte();
                    this._masterEntityID.Unmarshal(dis);
                    this._masterCommunicationsDeviceID = dis.ReadUnsignedShort();
                    this._intercomParametersLength     = dis.ReadUnsignedInt();
                    for (int idx = 0; idx < this.IntercomParametersLength; idx++)
                    {
                        IntercomCommunicationsParameters anX = new IntercomCommunicationsParameters();
                        anX.Unmarshal(dis);
                        this._intercomParameters.Add(anX);
                    }
                    ;
                }
                catch (Exception e)
                {
#if DEBUG
                    Trace.WriteLine(e);
                    Trace.Flush();
#endif
                    this.OnException(e);
                }
            }
        }
Пример #5
0
        public override int GetMarshalledSize()
        {
            int marshalSize = 0;

            marshalSize  = base.GetMarshalledSize();
            marshalSize += 1;                                        // this._controlType
            marshalSize += 1;                                        // this._communicationsChannelType
            marshalSize += this._sourceEntityID.GetMarshalledSize(); // this._sourceEntityID
            marshalSize += 1;                                        // this._sourceCommunicationsDeviceID
            marshalSize += 1;                                        // this._sourceLineID
            marshalSize += 1;                                        // this._transmitPriority
            marshalSize += 1;                                        // this._transmitLineState
            marshalSize += 1;                                        // this._command
            marshalSize += this._masterEntityID.GetMarshalledSize(); // this._masterEntityID
            marshalSize += 2;                                        // this._masterCommunicationsDeviceID
            marshalSize += 4;                                        // this._intercomParametersLength
            for (int idx = 0; idx < this._intercomParameters.Count; idx++)
            {
                IntercomCommunicationsParameters listElement = (IntercomCommunicationsParameters)this._intercomParameters[idx];
                marshalSize += listElement.GetMarshalledSize();
            }

            return(marshalSize);
        }
        /// <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(IntercomCommunicationsParameters obj)
        {
            bool ivarsEqual = true;

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

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

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

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

            return ivarsEqual;
        }