Пример #1
0
 // The protected OnSensorClientEvent method raises the event by invoking
 // the delegates. The sender is always this, the current instance of the class.
 protected virtual void OnSensorCreateEvent(SensorCreateEventArgs e)
 {
     if (m_bReady == true)
     {
         SensorCreateEvent(this, e);
     }
 }
Пример #2
0
        private void OnPubSubCreateNode(object sender, IqEventArgs e)
        {
            m_bReady = false;
            var error = e.Iq.Element <Error>();

            if (e.Iq.Type == Matrix.Xmpp.IqType.result)
            {
                Debug.WriteLine("Node [" + m_node + "] is created!");
                m_bReady = true;
            }
            else if (e.Iq.Type == Matrix.Xmpp.IqType.error)
            {
                if (error != null)
                {
                    if (error.Condition == Matrix.Xmpp.Base.ErrorCondition.Conflict)
                    {
                        Debug.WriteLine("Node [" + m_node + "] is already exist!");
                        m_bReady = true;
                    }
                    else
                    {
                        Debug.WriteLine("creation of node [{0}] failed!\r\nError Condition: {1}\r\nError Type: {2}", m_node, error.Condition, error.Type);
                    }
                }
            }

            if ((m_bReady) && (m_node != null))
            {
                SensorCreateEventArgs sce = new SensorCreateEventArgs(m_bReady);
                OnSensorCreateEvent(sce);
            }
        }
Пример #3
0
        private void OnPubSubCreateNode(object sender, IqEventArgs e)
        {
            m_bReady = false;
            var error = e.Iq.Element<Error>();

            if (e.Iq.Type == Matrix.Xmpp.IqType.result)
            {
                Debug.WriteLine("Node [" + m_node + "] is created!");
                m_bReady = true;
            }
            else if (e.Iq.Type == Matrix.Xmpp.IqType.error)
            {
                if (error != null)
                {
                    if (error.Condition == Matrix.Xmpp.Base.ErrorCondition.Conflict)
                    {
                        Debug.WriteLine("Node [" + m_node + "] is already exist!");
                        m_bReady = true;
                    }
                    else
                    {
                        Debug.WriteLine("creation of node [{0}] failed!\r\nError Condition: {1}\r\nError Type: {2}", m_node, error.Condition, error.Type);
                    }
                }
            }

            if ((m_bReady) && (m_node != null))
            {
                SensorCreateEventArgs sce = new SensorCreateEventArgs(m_bReady);
                OnSensorCreateEvent(sce);
            }
        }
Пример #4
0
 // The protected OnSensorClientEvent method raises the event by invoking
 // the delegates. The sender is always this, the current instance of the class.
 protected virtual void OnSensorCreateEvent(SensorCreateEventArgs e)
 {
     if (m_bReady == true)
     {
         SensorCreateEvent(this, e);
     }
 }
Пример #5
0
 public void OnSensorCreateEvent(object sender, SensorCreateEventArgs e)
 {
     Debug.WriteLine("Sensor Created in Chat Manager.");
 }
Пример #6
0
 public static void OnSensorCreated(object sender, SensorCreateEventArgs e)
 {
     m_bReady = true;
     Debug.WriteLine("Sensor is created successfully!");
 }
Пример #7
0
 protected void OnSensorCreateEvent(object sender, SensorCreateEventArgs e)
 {
     if (e.Ready == true)
     {
         Debug.WriteLine("Sensor Created in ChatManager");
     }
 }