本文整理汇总了C#中agsXMPP.protocol.client.IQ类的典型用法代码示例。如果您正苦于以下问题:C# IQ类的具体用法?C# IQ怎么用?C# IQ使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IQ类属于agsXMPP.protocol.client命名空间,在下文中一共展示了IQ类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: VcardResult
private void VcardResult(object sender, IQ iq, object data)
{
if (InvokeRequired)
{
// Windows Forms are not Thread Safe, we need to invoke this :(
// We're not in the UI thread, so we need to call BeginInvoke
BeginInvoke(new IqCB(VcardResult), new object[] { sender, iq, data });
return;
}
if (iq.Type == IqType.result)
{
Vcard vcard = iq.Vcard;
if (vcard != null)
{
txtFullname.Text = vcard.Fullname;
txtNickname.Text = vcard.Nickname;
txtBirthday.Text = vcard.Birthday.ToString();
txtDescription.Text = vcard.Description;
Photo photo = vcard.Photo;
if (photo != null)
picPhoto.Image = vcard.Photo.Image;
}
}
}
开发者ID:don59,项目名称:agsXmpp,代码行数:25,代码来源:frmVcard.cs
示例2: FileTransfer
public FileTransfer(XmppClientConnection xmppCon, IQ iq, IContact from)
: base(from)
{
_siIq = iq;
_si = iq.SelectSingleElement(typeof (SI)) as SI;
if (_si != null)
{
// get SID for file transfer
_sid = _si.Id;
_file = _si.File;
Contact = from;
if (_file != null)
{
_fileLength = _file.Size;
FileDescription = _file.Description;
FileName = _file.Name;
}
_xmppConnection = xmppCon;
}
}
开发者ID:erpframework,项目名称:xeus-messenger2,代码行数:25,代码来源:FileTransfer.cs
示例3: con_OnIq
private void con_OnIq(object sender, IQ iq)
{
if (iq.Query != null)
{
if (iq.Query is DiscoInfo && iq.Type == IqType.get)
{
/*
<iq type='get'
from='[email protected]/orchard'
to='plays.shakespeare.lit'
id='info1'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
*/
iq.SwitchDirection();
iq.Type = IqType.result;
DiscoInfo di = iq.Query as DiscoInfo;
if (ClientName != null)
di.AddIdentity(new DiscoIdentity(ClientCategory.ToString(), this.ClientName, "client"));
foreach (string feature in ClientFeatures)
{
di.AddFeature(new DiscoFeature(feature));
}
xmppCon.Send(iq);
}
}
}
开发者ID:don59,项目名称:agsXmpp,代码行数:32,代码来源:DiscoHelper.cs
示例4: OnRequestResult
private void OnRequestResult(object sender, IQ iq, object data)
{
if (iq.Error != null)
{
EventError eventError = new EventError("Request for bookmarks on server failed", iq.Error);
Events.Instance.OnEvent(this, eventError);
}
else if (iq.Type == IqType.result)
{
Private privateData = iq.Query as Private;
if (privateData != null && privateData.Storage != null)
{
Conference[] conferences = privateData.Storage.GetConferences();
lock (MucMarks.Instance._syncObject)
{
MucMarks.Instance.Clear();
foreach (Conference conference in conferences)
{
MucMarks.Instance.AddBookmark(conference);
}
}
}
}
}
开发者ID:erpframework,项目名称:xeus-messenger2,代码行数:27,代码来源:MucMarkManager.cs
示例5: GetConfig
/// <summary>
/// Send message to HarmonyHub to request Configuration.
/// Result is parsed by OnIq based on ClientCommandType
/// </summary>
public void GetConfig()
{
EnsureConnection();
var iqToSend = new IQ { Type = IqType.get, Namespace = "", From = "1", To = "guest" };
iqToSend.AddChild(HarmonyDocuments.ConfigDocument());
iqToSend.GenerateId();
var iqGrabber = new IqGrabber(Xmpp);
var iq = iqGrabber.SendIq(iqToSend, 10000);
if (iq != null)
{
var match = IdentityRegex.Match(iq.InnerXml);
if (match.Success)
{
RawConfig = match.Groups[1].ToString();
Config = null;
try
{
Config = new JavaScriptSerializer().Deserialize<HarmonyConfigResult>(RawConfig);
}
catch { }
}
}
}
开发者ID:RossLieberman,项目名称:alexitech,代码行数:30,代码来源:HarmonyClient.cs
示例6: dbcon_oniq
// on Successfull Login
// When someone checks our client details through requesting iq
private void dbcon_oniq(object sender, IQ iq)
{
if (InvokeRequired)
{
BeginInvoke(new IqHandler(dbcon_oniq), new object[] { sender, iq });
return;
}
if (iq.Query != null)
{
if (iq.Query.GetType() == typeof(agsXMPP.protocol.iq.version.Version))
{
agsXMPP.protocol.iq.version.Version vers = (agsXMPP.protocol.iq.version.Version)iq.Query;
if (iq.Type == agsXMPP.protocol.client.IqType.get)
{
iq.SwitchDirection();
iq.Type = agsXMPP.protocol.client.IqType.result;
vers.Name = "Nimbuzz Profile Changer Coded by [email protected]";
vers.Ver = "1.0.1";
vers.Os = "Coded By [email protected]\nFor More Visit: http://dbh4ck.blogspot.in";
((XmppClientConnection)sender).Send(iq);
}
}
}
}
开发者ID:dbh4ck,项目名称:Nimbuzz-Profile-Changer,代码行数:29,代码来源:Form1.cs
示例7: IQEventArgs
public IQEventArgs(IQ iq)
{
if (iq == null) {
throw new ArgumentNullException("iq");
}
IQ = iq;
}
开发者ID:kimseng,项目名称:agsxmpp,代码行数:7,代码来源:Handler.cs
示例8: frmFileTransfer
public frmFileTransfer(XmppClientConnection XmppCon, IQ iq)
{
InitializeComponent();
cmdSend.Enabled = false;
this.Text = "Receive File from " + iq.From.ToString();
siIq = iq;
si = iq.SelectSingleElement(typeof(agsXMPP.protocol.extensions.si.SI)) as agsXMPP.protocol.extensions.si.SI;
// get SID for file transfer
m_Sid = si.Id;
m_From = iq.From;
file = si.File;
if (file != null)
{
m_lFileLength = file.Size;
this.lblDescription.Text = file.Description;
this.lblFileName.Text = file.Name;
this.lblFileSize.Text = HRSize(m_lFileLength);
this.txtDescription.Visible = false;
}
m_XmppCon = XmppCon;
this.progress.Maximum = 100;
//this.Text += iq.From.ToString();
//this.tbFileSize.Text = FileTransferUtils.ConvertToByteString(m_lFileLength);
XmppCon.OnIq += new IqHandler(XmppCon_OnIq);
}
开发者ID:phiree,项目名称:dzdocs,代码行数:33,代码来源:frmFileTransfer.cs
示例9: OnStoreResult
private void OnStoreResult(object sender, IQ iq, object data)
{
if (iq.Error != null)
{
EventError eventError = new EventError("Saving for bookmarks on server failed", iq.Error);
Events.Instance.OnEvent(this, eventError);
}
}
开发者ID:erpframework,项目名称:xeus-messenger2,代码行数:8,代码来源:MucMarkManager.cs
示例10: ConstructConfigurationRequest
public static IQ ConstructConfigurationRequest()
{
Element query = new Element(Constants.XmppQueryActionElement, string.Empty, Constants.LogitechConnectNamespace);
query.Attributes.Add(Constants.XmppMimeAttribute, Constants.ConfigurationRequestPath);
IQ message = new IQ(IqType.get);
message.Id = agsXMPP.Id.GetNextId();
message.Query = query;
return message;
}
开发者ID:Zananok,项目名称:Harmonize,代码行数:11,代码来源:Builder.cs
示例11: ProcessDiscoInfo
private void ProcessDiscoInfo(IQ iq)
{
IQ diiq = new IQ();
diiq.To = iq.From;
diiq.Id = iq.Id;
diiq.Type = IqType.result;
diiq.Query = xmppConnection.DiscoInfo;
xmppConnection.Send(diiq);
}
开发者ID:don59,项目名称:agsXmpp,代码行数:11,代码来源:DiscoManager.cs
示例12: DiscoverItemsDone
private void DiscoverItemsDone(object sender, IQ iq, object data)
{
var discoItems = iq.Query as DiscoItems;
if(discoItems == null)
return;
var items = discoItems.GetDiscoItems();
foreach(var item in items)
search.Enqueue(item.Jid);
Search();
}
开发者ID:ungood,项目名称:BadaBingBot,代码行数:12,代码来源:ServiceDiscoveryManager.cs
示例13: SwapAuthToken
/// <summary>
/// Send message to HarmonyHub with UserAuthToken, wait for SessionToken
/// </summary>
/// <param name="userAuthToken"></param>
/// <returns></returns>
public string SwapAuthToken(string userAuthToken)
{
var iqToSend = new IQ { Type = IqType.get, Namespace = "", From = "1", To = "guest" };
iqToSend.AddChild(HarmonyDocuments.LogitechPairDocument(userAuthToken));
iqToSend.GenerateId();
var iqGrabber = new IqGrabber(Xmpp);
iqGrabber.SendIq(iqToSend, 10);
WaitForData(5);
return _sessionToken;
}
开发者ID:slavikko,项目名称:harmony,代码行数:18,代码来源:HarmonyAuthenticationClient.cs
示例14: ConstructSessionInfoRequest
public static IQ ConstructSessionInfoRequest(string authenticationToken)
{
string token = string.Format(Constants.SessionTokenRequestFormat, authenticationToken, Constants.SessionName, Constants.SessionOs, Constants.SessionDevice);
Element query = new Element(Constants.XmppQueryActionElement, token, Constants.LogitechConnectNamespace);
query.Attributes.Add(Constants.XmppMimeAttribute, Constants.SessionRequestPath);
IQ message = new IQ(IqType.get);
message.Id = agsXMPP.Id.GetNextId();
message.Query = query;
return message;
}
开发者ID:Zananok,项目名称:Harmonize,代码行数:13,代码来源:Builder.cs
示例15: EventInfoFileTransfer
public EventInfoFileTransfer(IQ iq)
: base(string.Empty, EventSeverity.Info)
{
_iq = iq;
agsXMPP.protocol.extensions.si.SI si = iq.SelectSingleElement(typeof(agsXMPP.protocol.extensions.si.SI)) as agsXMPP.protocol.extensions.si.SI;
if (si != null)
{
_file = si.File;
_contact = Roster.Instance.FindContactOrGetNew(iq.From);
}
_message = string.Format("Incoming file '{0}' from {1}", FileName, Contact.DisplayName);
}
开发者ID:erpframework,项目名称:xeus-messenger2,代码行数:16,代码来源:EventInfoFileTransfer.cs
示例16: DiscoverInformationDone
private void DiscoverInformationDone(object sender, IQ iq, object data)
{
var info = iq.Query as DiscoInfo;
if(info == null)
return;
var identity = info.GetIdentities();
var features = info.GetFeatures();
if(features.Any(feature => feature.Var.EndsWith("muc")))
{
callback(iq.From);
return;
}
discoManager.DiscoverItems(iq.From, DiscoverItemsDone);
}
开发者ID:ungood,项目名称:BadaBingBot,代码行数:17,代码来源:ServiceDiscoveryManager.cs
示例17: OnIq
void OnIq(object sender, IQ iq)
{
if (iq.HasTag("oa"))
{
if (iq.InnerXml.Contains("errorcode=\"200\""))
{
const string identityRegEx = "identity=([A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}):status";
var regex = new Regex(identityRegEx, RegexOptions.IgnoreCase | RegexOptions.Singleline);
var match = regex.Match(iq.InnerXml);
if (match.Success)
{
_sessionToken = match.Groups[1].ToString();
}
Wait = false;
}
}
}
开发者ID:slavikko,项目名称:harmony,代码行数:18,代码来源:HarmonyAuthenticationClient.cs
示例18: TransferOpenUI
void TransferOpenUI(IQ iq)
{
FileTransfer fileTransfer = new FileTransfer(Account.Instance.XmppConnection, iq,
Roster.Instance.FindContactOrGetNew(iq.From));
FileTransfer.FileTransfers.Add(fileTransfer);
try
{
FileTransferWindow fileTransferWindow = new FileTransferWindow();
fileTransferWindow.Show();
fileTransferWindow.Activate();
}
catch (WindowExistsException e)
{
e.ActivateControl();
}
}
开发者ID:erpframework,项目名称:xeus-messenger2,代码行数:19,代码来源:FileTransferManager.cs
示例19: SwapAuthToken
/// <summary>
/// Send message to HarmonyHub with UserAuthToken, wait for SessionToken
/// </summary>
/// <param name="userAuthToken"></param>
/// <returns></returns>
public string SwapAuthToken(string userAuthToken)
{
EnsureConnection();
var iqToSend = new IQ { Type = IqType.get, Namespace = "", From = "1", To = "guest" };
iqToSend.AddChild(HarmonyDocuments.LogitechPairDocument(userAuthToken));
iqToSend.GenerateId();
var iqGrabber = new IqGrabber(Xmpp);
var iq = iqGrabber.SendIq(iqToSend, 5000);
if (iq != null)
{
var match = IdentityRegex.Match(iq.InnerXml);
if (match.Success)
{
return match.Groups[1].ToString();
}
}
return null;
}
开发者ID:RossLieberman,项目名称:alexitech,代码行数:27,代码来源:HarmonyAuthenticationClient.cs
示例20: OnIq
private void OnIq(object arg1, IQ arg2)
{
if (arg2.Id != _id || arg2.Type != IqType.result)
{
return;
}
_connection.OnIq -= _onIq.Exec;
var vcard = arg2.Vcard;
if (vcard == null)
{
_task.SetResult(null);
return;
}
var description = vcard.Description;
var birthday = vcard.Birthday;
var fullname = vcard.Fullname;
var url = vcard.Url;
var photoType = vcard
.With(vcard1 => vcard.Photo)
.With(p => p.GetTag("TYPE"));
var photoBin = vcard
.With(vcard1 => vcard.Photo)
.With(p => p.GetTag("BINVAL"))
.With(p => p.Split('\r', '\n'))
.With(p => p.FirstOrDefault())
.With(Convert.FromBase64String);
var conactDetails = new ContactDetails()
{
Fullname = fullname,
Birthday = birthday,
PhotoType = photoType,
PhotoBin = photoBin,
Description = description,
Url = url
};
_task.SetResult(conactDetails);
}
开发者ID:Irdis,项目名称:VSTalk,代码行数:37,代码来源:ContactInfoRequest.cs
注:本文中的agsXMPP.protocol.client.IQ类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论