Esempio n. 1
0
        } // end of unmarshal method

        ///<summary>
        ///This allows for a quick display of PDU data.  The current format is unacceptable and only used for debugging.
        ///This will be modified in the future to provide a better display.  Usage:
        ///pdu.GetType().InvokeMember("reflection", System.Reflection.BindingFlags.InvokeMethod, null, pdu, new object[] { sb });
        ///where pdu is an object representing a single pdu and sb is a StringBuilder.
        ///Note: The supplied Utilities folder contains a method called 'DecodePDU' in the PDUProcessor Class that provides this functionality
        ///</summary>
        new public void reflection(StringBuilder sb)
        {
            sb.Append("<IntercomControlPdu>" + System.Environment.NewLine);
            base.reflection(sb);
            try
            {
                sb.Append("<controlType type=\"byte\">" + _controlType.ToString() + "</controlType> " + System.Environment.NewLine);
                sb.Append("<communicationsChannelType type=\"byte\">" + _communicationsChannelType.ToString() + "</communicationsChannelType> " + System.Environment.NewLine);
                sb.Append("<sourceEntityID>" + System.Environment.NewLine);
                _sourceEntityID.reflection(sb);
                sb.Append("</sourceEntityID>" + System.Environment.NewLine);
                sb.Append("<sourceCommunicationsDeviceID type=\"byte\">" + _sourceCommunicationsDeviceID.ToString() + "</sourceCommunicationsDeviceID> " + System.Environment.NewLine);
                sb.Append("<sourceLineID type=\"byte\">" + _sourceLineID.ToString() + "</sourceLineID> " + System.Environment.NewLine);
                sb.Append("<transmitPriority type=\"byte\">" + _transmitPriority.ToString() + "</transmitPriority> " + System.Environment.NewLine);
                sb.Append("<transmitLineState type=\"byte\">" + _transmitLineState.ToString() + "</transmitLineState> " + System.Environment.NewLine);
                sb.Append("<command type=\"byte\">" + _command.ToString() + "</command> " + System.Environment.NewLine);
                sb.Append("<masterEntityID>" + System.Environment.NewLine);
                _masterEntityID.reflection(sb);
                sb.Append("</masterEntityID>" + System.Environment.NewLine);
                sb.Append("<masterCommunicationsDeviceID type=\"ushort\">" + _masterCommunicationsDeviceID.ToString() + "</masterCommunicationsDeviceID> " + System.Environment.NewLine);
                sb.Append("<intercomParameters type=\"uint\">" + _intercomParameters.Count.ToString() + "</intercomParameters> " + System.Environment.NewLine);

                for (int idx = 0; idx < _intercomParameters.Count; idx++)
                {
                    sb.Append("<intercomParameters" + idx.ToString() + " type=\"IntercomCommunicationsParameters\">" + System.Environment.NewLine);
                    IntercomCommunicationsParameters aIntercomCommunicationsParameters = (IntercomCommunicationsParameters)_intercomParameters[idx];
                    aIntercomCommunicationsParameters.reflection(sb);
                    sb.Append("</intercomParameters" + idx.ToString() + ">" + System.Environment.NewLine);
                } // end of list marshalling

                sb.Append("</IntercomControlPdu>" + System.Environment.NewLine);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of reflection method