Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="OscMessage"/> class.
        /// </summary>
        /// <param name="sourceEndPoint">The packet origin.</param>
        /// <param name="address">The Osc address pattern.</param>
        /// <param name="client">The destination of sent packets when using TransportType.Tcp.</param>
        public OscMessage(IPEndPoint sourceEndPoint, string address, OscClient client = null)
            : base(sourceEndPoint, address, client)
        {
            Assert.IsTrue(address.StartsWith(AddressPrefix));

            mTypeTag = DefaultTag.ToString();
        }
Esempio n. 2
0
        public void Write(TextWriter output)
        {
            Emitter emitter = new Emitter(output);

            bool isWriteSeparator = false;

            if (IsWriteVersion)
            {
                emitter.WriteMeta(MetaType.YAML, Version.ToString());
                isWriteSeparator = true;
            }

            if (IsWriteDefaultTag)
            {
                emitter.WriteMeta(MetaType.TAG, DefaultTag.ToHeaderString());
                isWriteSeparator = true;
            }
            foreach (YAMLTag tag in m_tags)
            {
                emitter.WriteMeta(MetaType.TAG, tag.ToHeaderString());
                isWriteSeparator = true;
            }

            foreach (YAMLDocument doc in m_documents)
            {
                doc.Emit(emitter, isWriteSeparator);
                isWriteSeparator = true;
            }
            output.Write('\n');
        }
Esempio n. 3
0
        public void WriteHead(TextWriter output)
        {
            m_emitter          = new Emitter(output);
            m_isWriteSeparator = false;

            if (IsWriteVersion)
            {
                m_emitter.WriteMeta(MetaType.YAML, Version.ToString());
                m_isWriteSeparator = true;
            }

            if (IsWriteDefaultTag)
            {
                m_emitter.WriteMeta(MetaType.TAG, DefaultTag.ToHeaderString());
                m_isWriteSeparator = true;
            }
            foreach (YAMLTag tag in m_tags)
            {
                m_emitter.WriteMeta(MetaType.TAG, tag.ToHeaderString());
                m_isWriteSeparator = true;
            }
        }
Esempio n. 4
0
 /// <summary>
 /// Remove all data from the message.
 /// </summary>
 public void ClearData()
 {
     mTypeTag = DefaultTag.ToString();
     mData.Clear();
 }