public static string TypeToStr(XmppIqType type) { switch (type) { case XmppIqType.Get: return("get"); case XmppIqType.Set: return("set"); case XmppIqType.Result: return("result"); case XmppIqType.Error: return("error"); default: return(string.Empty); } }
public string ToStream(XmppJid from, XmppJid to, XmppIqType type, string id, string content) { StringBuilder result = new StringBuilder("<iq "); if (from != null && !string.IsNullOrWhiteSpace(from.Value)) { result.AppendFormat("from=\"{0}\" ", from.Value); } if (to != null && !string.IsNullOrWhiteSpace(to.Value)) { result.AppendFormat("to=\"{0}\" ", to.Value); } result.AppendFormat("id=\"{0}\" ", id); result.AppendFormat("type=\"{0}\">{1}</iq>", XmppIq.TypeToStr(type), content); return(result.ToString()); }
public XmppIqSignalEventArgs(int id, XmppIqType type, XmppIQ xStream) { this.ID = id; this.Type = type; this.xStream = xStream; }
public XmppRosterEventArgs(List <XmppRosterItem> roster, XmppIqType type) { Roster = roster; Type = type; }
private int SendIq(XmppJid from, XmppJid to, XmppIqType type, string content) { sendStream(new XmppIq().ToStream(from, to, type, iqCount.ToString(), content)); return(iqCount++); }