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


C# Presence.ToString方法代码示例

本文整理汇总了C#中Presence.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Presence.ToString方法的具体用法?C# Presence.ToString怎么用?C# Presence.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Presence的用法示例。


在下文中一共展示了Presence.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Test_Create

 public void Test_Create()
 {
     Presence p = new Presence(doc);
     p.Type   = PresenceType.available;
     p.Status = "foo";
     Assert.AreEqual("<presence><status>foo</status></presence>", p.ToString());
 }
开发者ID:eNoise,项目名称:cyclops-chat,代码行数:7,代码来源:PresenceTest.cs

示例2: PresenceSet

        /// <summary>
        /// Sets the user's presence.
        /// </summary>
        /// <param name="presence">The presence to set.</param>
        /// <param name="callback">The callback delegate to invoke on the server response.</param>
        public void PresenceSet(Presence presence, Action<JObject> callback)
        {
            Debug.WriteLine(string.Format(CultureInfo.InvariantCulture, "TurntableBot Public PresenceSet. Thread ID: {0}. Status: {1}.", Thread.CurrentThread.ManagedThreadId, presence.ToString().ToLower()));
            JObject json = new JObject(
                new JProperty("api", "presence.set"),
                new JProperty("status", presence.ToString().ToLower()));

            this.Send(json, callback);
        }
开发者ID:nmalaguti,项目名称:Turntable-API-sharp,代码行数:14,代码来源:TurntableBot.cs

示例3: PutPresence

 public void PutPresence(Presence presence)
 {
     var db = GetDatabase();
     var collection = db.GetCollection("offline_presence");
     collection.Insert(
         new BsonDocument(
             new BsonElement("from", JIDEscaping.Unescape(presence.From.User)),
             new BsonElement("to", JIDEscaping.Unescape(presence.To.User)),
             new BsonElement("type", presence.Type.ToString()),
             new BsonElement("value", presence.ToString())
             ));
 }
开发者ID:yuechuanbingzhi163,项目名称:GJTalk,代码行数:12,代码来源:OfflineMessageManager.cs

示例4: HandlePresence

    /// <summary>Received a presence message, type=unavailable means the user
    /// has gone offline, everything else means the user is online.</summary>
    protected void HandlePresence(object sender, Presence pres)
    {
      ProtocolLog.WriteIf(XmppLog, "Incoming: " + pres.ToString());
      JID jid = pres.From;
      if(jid == null || jid.Resource == null) {
        return;
      }

      string key = jid.ToString();
      if(jid.Resource.StartsWith(RESOURCE_NS)) {
        if(pres.Type == PresenceType.unavailable) {
          lock(_online) {
            _online.Remove(key);
          }
        } else if(!_online.ContainsKey(key)) {
          lock(_online) {
            _online[jid.ToString()] = jid;
          }
        }
      }
    }
开发者ID:hseom,项目名称:brunet,代码行数:23,代码来源:XmppService.cs


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