本文整理汇总了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");
}
示例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);
}
示例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);
}
示例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);
}
}
示例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");
}
示例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);
}
示例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);
}