Exemple #1
0
 protected void AddHandler(uint msgCode, MessageHandlerFunc func)
 {
     if (m_dicMessageFunc.ContainsKey(msgCode) == false)
     {
         m_dicMessageFunc.Add(msgCode, func);
     }
 }
 public void SetData(string xml, MessageHandlerFunc callback)
 {
     Message message = new Message(null, MessageType.Iq, MessageSubType.Set);
     MessageNode query = message.Node.AddChild("query", xml);
     query.SetAttribute("xmlns", Namespace.PrivateXmlStorage);
     m_Account.Send(message, callback);
 }
Exemple #3
0
        public ControllerMethodBinding(IDependencyResolver dependencyResolver, BindingInfo bindingInfo)
        {
            this.dependencyResolver = dependencyResolver;
            this.bindingInfo        = bindingInfo;

            messageHandler = WrapMethod(bindingInfo.Method, bindingInfo.ParameterFactories, bindingInfo.ResultHandler);
        }
        public void SetData(string xml, MessageHandlerFunc callback)
        {
            Message     message = new Message(null, MessageType.Iq, MessageSubType.Set);
            MessageNode query   = message.Node.AddChild("query", xml);

            query.SetAttribute("xmlns", Namespace.PrivateXmlStorage);
            m_Account.Send(message, callback);
        }
 public void GetData(string elementName, string elementNamespace, MessageHandlerFunc callback)
 {
     Message message = new Message(null, MessageType.Iq, MessageSubType.Get);
     MessageNode query = message.Node.AddChild("query", null);
     query.SetAttribute("xmlns", Namespace.PrivateXmlStorage);
     MessageNode child = query.AddChild(elementName, null);
     child.SetAttribute("xmlns", elementNamespace);
     m_Account.Send(message, callback);
 }
Exemple #6
0
        public void GetInfo(Jid entity, string node, MessageHandlerFunc callback)
        {
            Message     m         = new Message(entity.ToString(), MessageType.Iq, MessageSubType.Get);
            MessageNode queryNode = m.Node.AddChild("query", null);

            queryNode.SetAttribute("xmlns", Namespace.DiscoInfo);
            queryNode.SetAttribute("node", node);
            m_Account.Send(m, callback);
        }
Exemple #7
0
        public bool OnMessage(IMessage message)
        {
            MessageHandlerFunc func = null;

            if (m_dicMessageFunc.TryGetValue(message.MsgCode, out func))
            {
                return(func(message));
            }

            return(false);
        }
        public void GetData(string elementName, string elementNamespace, MessageHandlerFunc callback)
        {
            Message     message = new Message(null, MessageType.Iq, MessageSubType.Get);
            MessageNode query   = message.Node.AddChild("query", null);

            query.SetAttribute("xmlns", Namespace.PrivateXmlStorage);
            MessageNode child = query.AddChild(elementName, null);

            child.SetAttribute("xmlns", elementNamespace);
            m_Account.Send(message, callback);
        }
Exemple #9
0
 public void GetInfo(Jid entity, string node, MessageHandlerFunc callback)
 {
     Message m = new Message(entity.ToString(), MessageType.Iq, MessageSubType.Get);
     MessageNode queryNode = m.Node.AddChild("query", null);
     queryNode.SetAttribute("xmlns", Namespace.DiscoInfo);
     queryNode.SetAttribute("node", node);
     m_Account.Send(m, callback);
 }