public TimeIQ CreateTimeQuery() { TimeIQ iq = new TimeIQ(XmppGlobal.InternalClient.Document); iq.Type = jabber.protocol.client.IQType.get; return(iq); }
public void LoadEntityTime(jabber.JID jid) { TimeIQ iq = XmppGlobal.Queries.CreateTimeQuery(); iq.To = jid; XmppGlobal.Queries.SendQuery(iq, new QueryCallback(GotTimeQuery), null); JidLabel.Text = jid.ToString(); Spinner.Visible = true; }
public void UTC() { XmlDocument doc = new XmlDocument(); TimeIQ iq = new TimeIQ(doc); Time t = iq.Instruction; t.AddChild(doc.CreateElement("utc", t.NamespaceURI)); Assert.AreEqual(DateTime.MinValue, t.UTC); DateTime start = DateTime.UtcNow; t.SetCurrentTime(); // SetCurrentTime only stores seconds portion, whereas UtcNow has all // kinds of precision. Are we within a second of being correct? TimeSpan ts = t.UTC - start; Assert.IsTrue(Math.Abs(ts.TotalSeconds) < 1.0); }
public TimeIQ CreateTimeQuery() { TimeIQ iq = new TimeIQ (XmppGlobal.InternalClient.Document); iq.Type = jabber.protocol.client.IQType.get; return iq; }