コード例 #1
0
        public void Setup()
        {
            mocks = new MockRepository();
            stream = mocks.DynamicMock<XmppStream>();
            tracker = mocks.DynamicMock<IIQTracker>();
            doc = new XmlDocument();

            jid = new JID("test.example.com");
        }
コード例 #2
0
        public void setup()
        {
            mocks = new MockRepository();
            stream = mocks.DynamicMock<XmppStream>();
            tracker = mocks.DynamicMock<IIQTracker>();
            cm = null;

            doc = new XmlDocument();
        }
コード例 #3
0
        public void setup()
        {
            mocks = new MockRepository();
            dm = new DiscoManager();

            stream = mocks.DynamicMock<XmppStream>();
            tracker = mocks.DynamicMock<IIQTracker>();
            dm.Stream = stream;

            doc = new XmlDocument();
        }
コード例 #4
0
ファイル: OptionForm.cs プロジェクト: sq5gvm/JabberNet-2010
 private void WriteValues(Control parent, XmppStream stream)
 {
     if (parent.Tag != null)
     {
         stream[(string)parent.Tag] = GetControlValue(parent);
     }
     if (parent.HasChildren)
     {
         foreach (Control child in parent.Controls)
         {
             WriteValues(child, stream);
         }
     }
 }
コード例 #5
0
ファイル: XmppStream.cs プロジェクト: sq5gvm/JabberNet-2010
 public void Check(XmppStream sender, XmlElement elem)
 {
     try
     {
         XmlNode n = elem.SelectSingleNode(m_xpath, sender.m_ns);
         if (n != null)
         {
             if (sender.InvokeRequired)
                 sender.CheckedInvoke(m_cb, new object[] { sender, elem });
             else
                 m_cb(sender, elem);
         }
     }
     catch (Exception e)
     {
         sender.FireOnError(e);
     }
 }
コード例 #6
0
ファイル: IQTracker.cs プロジェクト: sq5gvm/JabberNet-2010
 /// <summary>
 /// Creates a new IQ tracker.
 /// </summary>
 /// <param name="stream">The client to send/receive on</param>
 public IQTracker(XmppStream stream)
 {
     m_cli = stream;
     m_cli.OnProtocol += new ProtocolHandler(OnIQ);
 }
コード例 #7
0
        /// <summary>
        /// Create a Node.  Next, call Create and/or Subscribe.
        /// </summary>
        /// <param name="stream"></param>
        /// <param name="jid"></param>
        /// <param name="node"></param>
        /// <param name="maxItems"></param>
        internal PubSubNode(XmppStream stream, JID jid, string node, int maxItems)
        {
            if (stream == null)
                throw new ArgumentException("must not be null", "stream");
            if (node == null)
                throw new ArgumentException("must not be null", "node");
            if (node == "")
                throw new ArgumentException("must not be empty", "node");

            m_stream = stream;
            m_jid = jid;
            m_node = node;
            m_items = new ItemList(this, maxItems);
        }
コード例 #8
0
 /// <summary>
 /// Creates a new IQ tracker.
 /// </summary>
 /// <param name="stream">The client to send/receive on</param>
 public IQTracker(XmppStream stream)
 {
     m_cli             = stream;
     m_cli.OnProtocol += new ProtocolHandler(OnIQ);
 }
コード例 #9
0
ファイル: OptionForm.cs プロジェクト: sq5gvm/JabberNet-2010
 /// <summary>
 /// Create new form.
 /// </summary>
 /// <param name="xmpp"></param>
 protected OptionForm(XmppStream xmpp)
     : this()
 {
     m_xmpp = xmpp;
 }
コード例 #10
0
ファイル: OptionForm.cs プロジェクト: sq5gvm/JabberNet-2010
 /// <summary>
 /// Write the configuration values to the given XmppStream.
 /// </summary>
 /// <param name="stream">The stream to configure</param>
 public void Configure(XmppStream stream)
 {
     WriteValues(this, stream);
 }