コード例 #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("<LinearObjectStatePdu>" + System.Environment.NewLine);
            base.reflection(sb);
            try
            {
                sb.Append("<objectID>" + System.Environment.NewLine);
                _objectID.reflection(sb);
                sb.Append("</objectID>" + System.Environment.NewLine);
                sb.Append("<referencedObjectID>" + System.Environment.NewLine);
                _referencedObjectID.reflection(sb);
                sb.Append("</referencedObjectID>" + System.Environment.NewLine);
                sb.Append("<updateNumber type=\"ushort\">" + _updateNumber.ToString() + "</updateNumber> " + System.Environment.NewLine);
                sb.Append("<forceID type=\"byte\">" + _forceID.ToString() + "</forceID> " + System.Environment.NewLine);
                sb.Append("<linearSegmentParameters type=\"byte\">" + _linearSegmentParameters.Count.ToString() + "</linearSegmentParameters> " + System.Environment.NewLine);
                sb.Append("<requesterID>" + System.Environment.NewLine);
                _requesterID.reflection(sb);
                sb.Append("</requesterID>" + System.Environment.NewLine);
                sb.Append("<receivingID>" + System.Environment.NewLine);
                _receivingID.reflection(sb);
                sb.Append("</receivingID>" + System.Environment.NewLine);
                sb.Append("<objectType>" + System.Environment.NewLine);
                _objectType.reflection(sb);
                sb.Append("</objectType>" + System.Environment.NewLine);

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

                sb.Append("</LinearObjectStatePdu>" + System.Environment.NewLine);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of marshal method
コード例 #2
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("<PointObjectStatePdu>" + System.Environment.NewLine);
            base.reflection(sb);
            try
            {
                sb.Append("<objectID>" + System.Environment.NewLine);
                _objectID.reflection(sb);
                sb.Append("</objectID>" + System.Environment.NewLine);
                sb.Append("<referencedObjectID>" + System.Environment.NewLine);
                _referencedObjectID.reflection(sb);
                sb.Append("</referencedObjectID>" + System.Environment.NewLine);
                sb.Append("<updateNumber type=\"ushort\">" + _updateNumber.ToString() + "</updateNumber> " + System.Environment.NewLine);
                sb.Append("<forceID type=\"byte\">" + _forceID.ToString() + "</forceID> " + System.Environment.NewLine);
                sb.Append("<modifications type=\"byte\">" + _modifications.ToString() + "</modifications> " + System.Environment.NewLine);
                sb.Append("<objectType>" + System.Environment.NewLine);
                _objectType.reflection(sb);
                sb.Append("</objectType>" + System.Environment.NewLine);
                sb.Append("<objectLocation>" + System.Environment.NewLine);
                _objectLocation.reflection(sb);
                sb.Append("</objectLocation>" + System.Environment.NewLine);
                sb.Append("<objectOrientation>" + System.Environment.NewLine);
                _objectOrientation.reflection(sb);
                sb.Append("</objectOrientation>" + System.Environment.NewLine);
                sb.Append("<objectAppearance type=\"double\">" + _objectAppearance.ToString() + "</objectAppearance> " + System.Environment.NewLine);
                sb.Append("<requesterID>" + System.Environment.NewLine);
                _requesterID.reflection(sb);
                sb.Append("</requesterID>" + System.Environment.NewLine);
                sb.Append("<receivingID>" + System.Environment.NewLine);
                _receivingID.reflection(sb);
                sb.Append("</receivingID>" + System.Environment.NewLine);
                sb.Append("<pad2 type=\"uint\">" + _pad2.ToString() + "</pad2> " + System.Environment.NewLine);
                sb.Append("</PointObjectStatePdu>" + System.Environment.NewLine);
            } // end try
            catch (Exception e)
            {
                Trace.WriteLine(e);
                Trace.Flush();
            }
        } // end of reflection method