当前位置: 首页>>代码示例>>C#>>正文


C# jabber.JID类代码示例

本文整理汇总了C#中jabber.JID的典型用法代码示例。如果您正苦于以下问题:C# JID类的具体用法?C# JID怎么用?C# JID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JID类属于jabber命名空间,在下文中一共展示了JID类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: XmppService

    /// <summary>Initiate a Xmpp client handle.</summary>
    public XmppService(string username, string password, int port)
    {
      _write_lock = new object();
      _jc = new JabberClient();

      JID jid = new JID(username);
      _jc.User = jid.User;
      _jc.Server = jid.Server;
      _jc.Password = password;
      _jc.Port = port;

      _jc.AutoReconnect = 30F;
      _jc.AutoStartTLS = true;
      _jc.KeepAlive = 30F;
      _jc.AutoPresence = false;
      _jc.AutoRoster = false;
      _jc.LocalCertificate = null;
      var rng = new RNGCryptoServiceProvider();
      byte[] id = new byte[4];
      rng.GetBytes(id);
      _jc.Resource = RESOURCE_NS + BitConverter.ToString(id).Replace("-", "");

      _jc.OnInvalidCertificate += HandleInvalidCert;
      _jc.OnAuthenticate += HandleAuthenticate;
      _jc.OnAuthError += HandleAuthError;
      _jc.OnError += HandleError;
      _jc.OnIQ += HandleIQ;
      _jc.OnPresence += HandlePresence;
      _jc.OnMessage += HandleMessage;

      _online = new Dictionary<string, JID>();
      _demux = new Dictionary<Type, QueryCallback>();
    }
开发者ID:hseom,项目名称:brunet,代码行数:34,代码来源:XmppService.cs

示例2: Test_Parse_7

 [Test] public void Test_Parse_7()
 {
     JID j = new JID("[email protected]/bar/baz");
     Assert.AreEqual("boo", j.User);
     Assert.AreEqual("foo", j.Server);
     Assert.AreEqual("bar/baz", j.Resource);
 }
开发者ID:krbysn,项目名称:jabber-net,代码行数:7,代码来源:JIDTest.cs

示例3: Test_Parse_3

 [Test] public void Test_Parse_3()
 {
     JID j = new JID("[email protected]");
     Assert.AreEqual("boo", j.User);
     Assert.AreEqual("foo", j.Server);
     Assert.AreEqual(null, j.Resource);
 }
开发者ID:krbysn,项目名称:jabber-net,代码行数:7,代码来源:JIDTest.cs

示例4: UserLocation

 public UserLocation(JID jid, string locationName, string latitude, string longitude, string source)
 {
     m_Jid          = jid;
     m_LocationName = locationName;
     m_Latitude     = latitude;
     m_Longitude    = longitude;
     m_Source       = source;
 }
开发者ID:jrudolph,项目名称:synapse,代码行数:8,代码来源:GeoService.cs

示例5: ReceivedAvatarMetadata

        private void ReceivedAvatarMetadata(JID from, string node, XmlNode items)
        {
            if (items.ChildNodes.Count == 0)
                return;

            Console.WriteLine("Received Avatar Data");
            Console.WriteLine(items.ToString());
        }
开发者ID:jrudolph,项目名称:synapse,代码行数:8,代码来源:UserAvatars.cs

示例6: Setup

        public void Setup()
        {
            mocks = new MockRepository();
            stream = mocks.DynamicMock<XmppStream>();
            tracker = mocks.DynamicMock<IIQTracker>();
            doc = new XmlDocument();

            jid = new JID("test.example.com");
        }
开发者ID:krbysn,项目名称:jabber-net,代码行数:9,代码来源:PubSubManagerTest.cs

示例7: SendMessage

        public void SendMessage(JID toJid, string body, MessageType type)
        {
            Message m = new Message (XmppGlobal.InternalClient.Document);

            m.To = toJid;
            m.Body = body;
            m.Type = type;

            XmppGlobal.InternalClient.Write (m);
        }
开发者ID:noismaster,项目名称:xmppapplication,代码行数:10,代码来源:Messaging.cs

示例8: ChatContentMessage

        public ChatContentMessage(Account account, JID source, string sourceDisplayName, JID destination, DateTime date, bool isAutoReply)
            : base(account, source, sourceDisplayName, destination, date)
        {
            if (source == null)
                throw new ArgumentNullException("source");

            if (destination == null)
                throw new ArgumentNullException("destination");

            m_IsAutoReply = isAutoReply;
        }
开发者ID:jrudolph,项目名称:synapse,代码行数:11,代码来源:ChatContentMessage.cs

示例9: ChatHandler

        public ChatHandler(Account account, bool isMucUser, JID jid)
            : base(account)
        {
            m_Jid = jid;
            m_IsMucUser = isMucUser;

            base.Account.ConnectionStateChanged += HandleConnectionStateChanged;
            base.Ready = (base.Account.ConnectionState == AccountConnectionState.Connected);

            base.AppendStatus(String.Format("Conversation with {0}.", jid.ToString()));
        }
开发者ID:jrudolph,项目名称:synapse,代码行数:11,代码来源:ChatHandler.cs

示例10: Test_Create

 [Test] public void Test_Create()
 {
     JID j = new JID("foo", "jabber.com", "there");
     Assert.AreEqual("[email protected]/there", j.ToString());
     j = new JID(null, "jabber.com", null);
     Assert.AreEqual("jabber.com", j.ToString());
     j = new JID("foo", "jabber.com", null);
     Assert.AreEqual("[email protected]", j.ToString());
     j = new JID(null, "jabber.com", "there");
     Assert.AreEqual("jabber.com/there", j.ToString());
 }
开发者ID:krbysn,项目名称:jabber-net,代码行数:11,代码来源:JIDTest.cs

示例11: XmppService

        public XmppService(string jid, string password, string host)
        {
            _jc = new JabberClient();
            _jc.Resource = XMPP_RESOURCE;
            _jc.AutoStartTLS = false;
            _jc.SSL = false;

            JID j = new JID(jid);
            _jc.User = j.User;
            _jc.Server = j.Server;
            _jc.Password = password;
            _jc.NetworkHost = host;
        }
开发者ID:jgroszko,项目名称:AuctionSniper,代码行数:13,代码来源:XmppService.cs

示例12: AbstractChatContent

        public AbstractChatContent(Account account, JID source, string sourceDisplayName, JID destination, DateTime date)
        {
            if (account == null)
                throw new ArgumentNullException("account");

            if (date == null)
                throw new ArgumentNullException("date");

            m_Account = account;
            m_Source = source;
            m_SourceDisplayName = sourceDisplayName;
            m_Destination = destination;
            m_Date = date;
        }
开发者ID:jrudolph,项目名称:synapse,代码行数:14,代码来源:AbstractChatContent.cs

示例13: AuctionMessageTranslator

        public AuctionMessageTranslator(JID inSniperJId, IAuctionEventListener inListener)
        {
            mSniperId = inSniperJId;

            mParser.RegisterAction("CLOSE", (ev) => {
                inListener.AuctionClosed();
            });
            mParser.RegisterAction("PRICE", (ev) => {
                inListener.CurrentPrice(
                    ev.IntegerValueOf("CurrentPrice"),
                    ev.IntegerValueOf("Increment"),
                    ev.PriceSourceFrom(mSniperId)
                );
            });
        }
开发者ID:transcript-goos,项目名称:ritalin,代码行数:15,代码来源:AuctionMessageTranslator.cs

示例14: ProfileWindow

        public ProfileWindow(Account account, JID jid)
            : base()
        {
            SetupUi();

            webView.SetHtml("<p>Loading...</p>");

            account.RequestVCard(jid, delegate (object sender, IQ iq, object data) {
                if (iq.Type == IQType.result)
                    Populate((VCard)iq.FirstChild);
                else
                    Populate(null);
            }, null);

            Gui.CenterWidgetOnScreen(this);
        }
开发者ID:jrudolph,项目名称:synapse,代码行数:16,代码来源:ProfileWindow.cs

示例15: Test_AtAt

 public void Test_AtAt()
 {
     try
     {
         JID j = new JID("[email protected]@foo");
         string u = j.User;
         Assert.IsTrue(false);
     }
     catch (JIDFormatException)
     {
         Assert.IsTrue(true);
     }
     catch (Exception)
     {
         Assert.IsTrue(false);
     }
 }
开发者ID:rankida,项目名称:HangoutPhone,代码行数:17,代码来源:JIDTest.cs


注:本文中的jabber.JID类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。