當前位置: 首頁>>代碼示例>>C#>>正文


C# Message.HasTag方法代碼示例

本文整理匯總了C#中agsXMPP.protocol.client.Message.HasTag方法的典型用法代碼示例。如果您正苦於以下問題:C# Message.HasTag方法的具體用法?C# Message.HasTag怎麽用?C# Message.HasTag使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在agsXMPP.protocol.client.Message的用法示例。


在下文中一共展示了Message.HasTag方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: IsContentMessage

 public static bool IsContentMessage(Message msg)
 {
     //A "content message" -- that is, a message stanza whose primary meaning is contained in
     //standard messaging content such as the XMPP <body/> or any other properly-namespaced child
     //element(s) other than those defined for chat state notifications in this specification.
     return !string.IsNullOrEmpty(msg.Body) || msg.HasTag(XamlBody.TAG);
 }
開發者ID:Irdis,項目名稱:VSTalk,代碼行數:7,代碼來源:MessageUtil.cs

示例2: OnMessage

 /// <summary>
 ///     Handle incomming messages
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="message"></param>
 private void OnMessage(object sender, Message message)
 {
     if (!message.HasTag("event"))
     {
         return;
     }
     // Check for the activity changed data, see here: https://github.com/swissmanu/harmonyhubjs-client/blob/master/docs/protocol/startActivityFinished.md
     var eventElement = message.SelectSingleElement("event");
     var eventData = eventElement.GetData();
     if (eventData == null)
     {
         return;
     }
     foreach (var pair in eventData.Split(':'))
     {
         if (!pair.StartsWith("activityId"))
         {
             continue;
         }
         var activityId = pair.Split('=')[1];
         OnActivityChanged?.Invoke(this, activityId);
     }
 }
開發者ID:Lakritzator,項目名稱:harmony,代碼行數:28,代碼來源:HarmonyClient.cs

示例3: receivedMessageDispatcher

        /// <summary>
        /// This method will parse incoming messages and call specific handlers.
        /// </summary>
        /// <param name="sender">The sender of the message</param>
        /// <param name="message">The messsage that was received</param>
        private void receivedMessageDispatcher(Object sender, Message message)
        {
            //check whether the message is an invitation to join a chatroom and invoke the strategy
            if (message.HasTag("invite", true))
            {
                chatroom = message.From;
                MucManager manager = new MucManager(connection);
                //Wait for 3 seconds
                System.Threading.Thread.Sleep(3000);
                manager.JoinRoom(chatroom, nickname, false);
                decisionStrategy.OnJoiningGame(chatroom.ToString());
            }

            else
            {

                if (message.Body != null)
                {
                    decisionStrategy.OnMessageReceived(message);
                }

            }
        }
開發者ID:softwarewolves,項目名稱:softwarewolves-dotnet-player,代碼行數:28,代碼來源:DotNetBotBody.cs


注:本文中的agsXMPP.protocol.client.Message.HasTag方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。