예제 #1
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 (PduBase.TraceExceptions)
                {
                    Trace.WriteLine(e);
                    Trace.Flush();
                }

                this.RaiseExceptionOccured(e);

                if (PduBase.ThrowExceptions)
                {
                    throw e;
                }
            }
        }