當前位置: 首頁>>代碼示例>>C#>>正文


C# client.IQ類代碼示例

本文整理匯總了C#中agsXMPP.protocol.client.IQ的典型用法代碼示例。如果您正苦於以下問題:C# IQ類的具體用法?C# IQ怎麽用?C# IQ使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


IQ類屬於agsXMPP.protocol.client命名空間,在下文中一共展示了IQ類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的agsXMPP.protocol.client.IQ類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。