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


C# Element.GetTag方法代码示例

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


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

示例1: XmppOnOnStreamError

 private static void XmppOnOnStreamError(object sender , Element element)
 {
     var textTag = element.GetTag("text");
     if (!String.IsNullOrWhiteSpace(textTag) && textTag.Trim().ToLower() == "replaced by new connection")
         Trace.WriteLine("[Bot]Someone Logged In As GameBot");
 }
开发者ID:Gondulf,项目名称:OCTGN,代码行数:6,代码来源:GameBot.cs

示例2: XmppOnOnStreamError

 private void XmppOnOnStreamError(object sender, Element element)
 {
     var textTag = element.GetTag("text");
     if (!String.IsNullOrWhiteSpace(textTag) && textTag.Trim().ToLower() == "replaced by new connection") DisconnectedBecauseConnectionReplaced = true;
     Trace.WriteLine("[Xmpp]StreamError: " + element);
 }
开发者ID:Himorask,项目名称:OCTGN,代码行数:6,代码来源:Client.cs

示例3: XmppOnOnStreamError

        /// <summary>
        /// The xmpp on on stream error.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="element">
        /// The element.
        /// </param>
        private void XmppOnOnStreamError(object sender, Element element)
        {
            Log.Warn(element);
            var st = element as Error;
            if (st != null && st.Condition == StreamErrorCondition.Conflict)
            {
                this.DisconnectedBecauseConnectionReplaced = true;
                this.IsConnected = false;
            }

            string textTag = element.GetTag("text");
            if (!string.IsNullOrWhiteSpace(textTag) && textTag.Trim().ToLower() == "replaced by new connection")
            {
                this.DisconnectedBecauseConnectionReplaced = true;
            }

            Trace.WriteLine("[Xmpp]StreamError: " + element);
        }
开发者ID:haslo,项目名称:OCTGN,代码行数:27,代码来源:Client.cs

示例4: XmppOnOnStreamError

 private void XmppOnOnStreamError(object sender, Element element)
 {
     try
     {
         var textTag = element.GetTag("text");
         if ("replaced by new connection".Equals(textTag?.Trim(), StringComparison.InvariantCultureIgnoreCase))
             Log.Error("Someone Logged In As GameBot");
     } catch (Exception e)
     {
         Log.Error("XmppOnOnStreamError", e);
     }
 }
开发者ID:octgn,项目名称:OCTGN,代码行数:12,代码来源:GameBot.cs

示例5: XmppOnOnStreamError

 private void XmppOnOnStreamError(object sender, Element element)
 {
     var textTag = element.GetTag("text");
     if (!String.IsNullOrWhiteSpace(textTag) && textTag.Trim().ToLower() == "replaced by new connection")
         Log.Error("Someone replaced this connection");
 }
开发者ID:octgn,项目名称:OCTGN,代码行数:6,代码来源:XmppClient.cs

示例6: XmppOnOnStreamError

 private void XmppOnOnStreamError(object sender, Element element)
 {
     var st = element as agsXMPP.protocol.Error;
     if(st != null && st.Condition == StreamErrorCondition.Conflict)
         DisconnectedBecauseConnectionReplaced = true;
     
     var textTag = element.GetTag("text");
     if (!String.IsNullOrWhiteSpace(textTag) && textTag.Trim().ToLower() == "replaced by new connection") DisconnectedBecauseConnectionReplaced = true;
     Trace.WriteLine("[Xmpp]StreamError: " + element);
 }
开发者ID:Entropy42,项目名称:OCTGN,代码行数:10,代码来源:Client.cs

示例7: stanza

 public void stanza(string target, Element stanza)
 {
     var message = new agsXMPP.protocol.client.Message();
     string modifiedTarget =
         stanza.GetTag(MeTLStanzas.privacyTag) == "private" ?
         string.Format("{0}{1}", target, stanza.GetTag("author")) : target;
     message.To = new Jid(string.Format("{0}@{1}", modifiedTarget, Constants.JabberWire.MUC));
     message.From = jid;
     message.Type = MessageType.groupchat;
     message.AddChild(stanza);
     send(message);
 }
开发者ID:StackableRegiments,项目名称:metl2011,代码行数:12,代码来源:Wire.cs


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