本文整理汇总了C#中IQ.HasAttribute方法的典型用法代码示例。如果您正苦于以下问题:C# IQ.HasAttribute方法的具体用法?C# IQ.HasAttribute怎么用?C# IQ.HasAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IQ
的用法示例。
在下文中一共展示了IQ.HasAttribute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FireOnIQ
private void FireOnIQ(object sender, IQ iq)
{
// We know we're on the GUI thread.
if (OnIQ != null)
OnIQ(this, iq);
if (AutoIQErrors)
{
if (!iq.Handled &&
iq.HasAttribute("from") && // Belt. Suspenders. Don't respond to roster pushes.
((iq.Type == IQType.Get) || (iq.Type == IQType.Set)))
{
Write(iq.GetErrorResponse(Document, Error.FeatureNotImplemented));
}
}
}
示例2: FireOnIQ
private void FireOnIQ(object sender, IQ iq)
{
// We know we're on the GUI thread.
if (OnIQ != null)
OnIQ(this, iq);
if (this.SupportNestedGroups && !iq.Handled &&
iq.Query != null && iq.Type == IQType.result &&
iq.Query.NamespaceURI == URI.PRIVATE &&
iq.GetChildElement<Private>().GetChildElement<RosterDelimiter>() != null)
{
RosterDelimiter rosterDelimiter = iq.GetChildElement<Private>().GetChildElement<RosterDelimiter>();
if (String.IsNullOrEmpty(rosterDelimiter.InnerText))
{
this.NestedGroupDelimiter = this.NestedGroupDefaultDelimiter;
if (this.AutoStoreNestedGroupsDelimiter)
{
PrivateIQ privIq = new PrivateIQ(this.Document);
RosterDelimiter rosterDelim = new RosterDelimiter(privIq.OwnerDocument);
rosterDelim.InnerText = this.NestedGroupDelimiter;
privIq.Instruction.AddChild(rosterDelim);
privIq.Type = IQType.set;
this.Write(privIq);
}
}
else
{
this.NestedGroupDelimiter = rosterDelimiter.InnerText;
}
this.GetRoster();
}
if (AutoIQErrors)
{
if (!iq.Handled && iq.HasAttribute("from") && // Belt. Suspenders. Don't respond to roster pushes.
(iq.Type == IQType.get || iq.Type == IQType.set))
{
Write(iq.GetErrorResponse(this.Document, Error.FEATURE_NOT_IMPLEMENTED));
}
}
}