• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# IqCB类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IqCB的典型用法代码示例。如果您正苦于以下问题:C# IqCB类的具体用法?C# IqCB怎么用?C# IqCB使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IqCB类属于命名空间,在下文中一共展示了IqCB类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetLists

        /// <summary>
        /// Retrieving all Privacy Lists
        /// </summary>
        /// <param name="cb">Callback for the server result</param>
        /// <param name="cbArg">Callback arguments for the result when needed</param>
        public void GetLists(IqCB cb, object cbArg)
        {
            /*
                Example: Client requests names of privacy lists from server:

                <iq from='[email protected]/orchard' type='get' id='getlist1'>
                  <query xmlns='jabber:iq:privacy'/>
                </iq>

                Example: Server sends names of privacy lists to client, preceded by active list and default list:

                <iq type='result' id='getlist1' to='[email protected]/orchard'>
                  <query xmlns='jabber:iq:privacy'>
                    <active name='private'/>
                    <default name='public'/>
                    <list name='public'/>
                    <list name='private'/>
                    <list name='special'/>
                  </query>
                </iq>

            */

            PrivacyIq pIq = new PrivacyIq();

            pIq.Type = IqType.get;

            SendStanza(pIq, cb, cbArg);
        }
开发者ID:ridhouan,项目名称:teamlab.v6.5,代码行数:34,代码来源:PrivacyManager.cs


示例2: RequestBookmarks

        /// <summary>
        /// Request the bookmarks from the storage on the server
        /// </summary>
        /// <param name="cb"></param>
        /// <param name="cbArgs"></param>
        public void RequestBookmarks(IqCB cb, object cbArgs)
        {
            StorageIq siq = new StorageIq(IqType.get);

            if (cb == null)
                m_connection.Send(siq);
            else
                m_connection.IqGrabber.SendIq(siq, cb, cbArgs);
        }
开发者ID:jptoto,项目名称:argsxmpp,代码行数:14,代码来源:BookmarkManager.cs


示例3: AcceptDefaultConfiguration

        /// <summary>
        /// create an "instant room". This means you accept the default configuration and dont want to configure the room.
        /// </summary>
        /// <param name="room"></param>
        /// <param name="cb"></param>
        /// <param name="cbArgs"></param>
        public void AcceptDefaultConfiguration(Jid room, IqCB cb, object cbArgs)
        {
            OwnerIq oIq = new XMPPProtocol.Protocol.x.muc.iq.owner.OwnerIq(IqType.set, room);
            oIq.Query.AddChild(new Data(XDataFormType.submit));

            if (cb == null)
                m_connection.Send(oIq);
            else
                m_connection.IqGrabber.SendIq(oIq, cb, cbArgs);
        }
开发者ID:lsalamon,项目名称:solution2010,代码行数:16,代码来源:MucManager.cs


示例4: CreateInstantNode

        public void CreateInstantNode(Jid to, Jid from, IqCB cb,object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
                pubsubIq.From = from;

            pubsubIq.PubSub.Create = new Create();

            if (cb == null)
                m_connection.Send(pubsubIq);
            else
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
        }
开发者ID:SiteView,项目名称:ECC8.13,代码行数:14,代码来源:PubSubManager.cs


示例5: CreateCollectionNode

        public void CreateCollectionNode(Jid to, Jid from, string node, bool defaultConfig, IqCB cb, object cbArgs)
        {
            PubSubIq pubsubIq = new PubSubIq(IqType.set, to);

            if (from != null)
                pubsubIq.From = from;

            pubsubIq.PubSub.Create = new Create(node, Type.collection);

            if (defaultConfig)
                pubsubIq.PubSub.Configure = new Configure();

            if (cb == null)
                m_connection.Send(pubsubIq);
            else
                m_connection.IqGrabber.SendIq(pubsubIq, cb, cbArgs);
        }
开发者ID:lsalamon,项目名称:solution2010,代码行数:17,代码来源:PubSubManager.cs


示例6: ChangeActiveList

        /// <summary>
        /// Change the active list
        /// </summary>
        /// <param name="name"></param>
        /// <param name="cb">Callback for the server result</param>
        /// <param name="cbArg">Callback arguments for the result when needed</param>
        public void ChangeActiveList(string name, IqCB cb, object cbArg)
        {
            /*
                Example: Client requests change of active list:

                <iq from='[email protected]/orchard' type='set' id='active1'>
                  <query xmlns='jabber:iq:privacy'>
                    <active name='special'/>
                  </query>
                </iq>

                The server MUST activate and apply the requested list before sending the result back to the client.

                Example: Server acknowledges success of active list change:

                <iq type='result' id='active1' to='[email protected]/orchard'/>

                If the user attempts to set an active list but a list by that name does not exist, the server MUST return an <item-not-found/> stanza error to the user:

                Example: Client attempts to set a non-existent list as active:

                <iq to='[email protected]/orchard' type='error' id='active2'>
                  <query xmlns='jabber:iq:privacy'>
                    <active name='The Empty Set'/>
                  </query>
                  <error type='cancel'>
                    <item-not-found
                        xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
                  </error>
                </iq>

            */

            PrivacyIq pIq = new PrivacyIq();

            pIq.Type = XMPPProtocol.Protocol.client.IqType.set;
            pIq.Query.Active = new Active(name);

            SendStanza(pIq, cb, cbArg);
        }
开发者ID:lsalamon,项目名称:solution2010,代码行数:46,代码来源:PrivacyManager.cs


示例7: UpdateList

        /// <summary>
        /// Update the list with the given name and rules.
        /// </summary>
        /// <remarks>
        /// Specify the desired changes to the list by including all elements/rules in the list 
        /// (not the "delta")
        /// </remarks>
        /// <param name="name">name of this list</param>
        /// <param name="rules">rules of this list</param>
        /// <param name="cb">Callback for the server result</param>
        /// <param name="cbArg">Callback arguments for the result when needed</param>
        public void UpdateList(string name, Item[] rules, IqCB cb, object cbArg)
        {
            PrivacyIq pIq = new PrivacyIq();
            pIq.Type = agsXMPP.protocol.client.IqType.set;

            // create a new list with the given name
            List list = new List(name);
            list.AddItems(rules);
            // add the list to the query
            pIq.Query.AddList(list);

            SendStanza(pIq, cb, cbArg);
        }
开发者ID:phiree,项目名称:dzdocs,代码行数:24,代码来源:PrivacyManager(2).cs


示例8: RemoveList

        /// <summary>
        /// Remove a privacy list
        /// </summary>
        /// <param name="name">name of the privacy list to remove</param>
        /// <param name="cb">Callback for the server result</param>
        /// <param name="cbArg">Callback arguments for the result when needed</param>
        public void RemoveList(string name, IqCB cb, object cbArg)
        {
            PrivacyIq pIq = new PrivacyIq();

            pIq.Type = agsXMPP.protocol.client.IqType.set;
            pIq.Query.AddList(new List(name));

            SendStanza(pIq, cb, cbArg);
        }
开发者ID:phiree,项目名称:dzdocs,代码行数:15,代码来源:PrivacyManager(2).cs


示例9: GetList

        /// <summary>
        /// Requests a privacy list from the server by its name
        /// </summary>
        /// <param name="name">name of the privacy list to retrieve</param>
        /// <param name="cb">Callback for the server result</param>
        /// <param name="cbArg">Callback arguments for the result when needed</param>
        public void GetList(string name, IqCB cb, object cbArg)
        {
            /*
                Example: Client requests a privacy list from server:

                <iq from='[email protected]/orchard' type='get' id='getlist2'>
                  <query xmlns='jabber:iq:privacy'>
                    <list name='public'/>
                  </query>
                </iq>

                Example: Server sends a privacy list to client:

                <iq type='result' id='getlist2' to='[email protected]/orchard'>
                  <query xmlns='jabber:iq:privacy'>
                    <list name='public'>
                      <item type='jid'
                            value='[email protected]'
                            action='deny'
                            order='1'/>
                      <item action='allow' order='2'/>
                    </list>
                  </query>
                </iq>

            */

            PrivacyIq pIq = new PrivacyIq();

            pIq.Type = agsXMPP.protocol.client.IqType.get;
            pIq.Query.AddList(new List(name));

            SendStanza(pIq, cb, cbArg);
        }
开发者ID:phiree,项目名称:dzdocs,代码行数:40,代码来源:PrivacyManager(2).cs


示例10: DeclineDefaultList

        /// <summary>
        /// Decline the use of the default list
        /// </summary>
        /// <param name="cb">Callback for the server result</param>
        /// <param name="cbArg">Callback arguments for the result when needed</param>
        public void DeclineDefaultList(IqCB cb, object cbArg)
        {
            PrivacyIq pIq = new PrivacyIq();

            pIq.Type = agsXMPP.protocol.client.IqType.set;
            pIq.Query.Default = new Default();

            SendStanza(pIq, cb, cbArg);
        }
开发者ID:phiree,项目名称:dzdocs,代码行数:14,代码来源:PrivacyManager(2).cs


示例11: DiscoverItems

 public void DiscoverItems(Jid to, Jid from, IqCB cb, object cbArgs)
 {
     DiscoverItems(to, from, null, cb, cbArgs);
 }
开发者ID:wraithkings,项目名称:wmtalk,代码行数:4,代码来源:DiscoManager.cs


示例12: GetDefaults

 /// <summary>
 /// Get the default configuration of the node.
 /// </summary>
 /// <param name="service">JID of the pub/sub service</param>
 /// <param name="callback">Callback.  Must not be null.  Will not be called back 
 /// if there is an error, but instead OnError will be called.</param>
 /// <param name="state">State information to be passed back to callback</param>
 public void GetDefaults(JID service, IqCB callback, object state)
 {
     OwnerPubSubCommandIQ<OwnerDefault> iq = new OwnerPubSubCommandIQ<OwnerDefault>(m_stream.Document);
     iq.To = service;
     iq.Type = IQType.get;
     BeginIQ(iq, OnDefaults, new IQTracker.TrackerData(callback, state, null, null));
 }
开发者ID:krbysn,项目名称:jabber-net,代码行数:14,代码来源:PubSubManager.cs


示例13: SendIq

        /// <summary>
        /// Send an IQ Request and store the object with callback in the Hashtable
        /// </summary>
        /// <param name="iq">The iq to send</param>
        /// <param name="cb">the callback function which gets raised for the response</param>
        /// <param name="cbArg">additional object for arguments</param>
        public void SendIq(IQ iq, IqCB cb, object cbArg)
        {
            // check if the callback is null, in case of wrong usage of this class
            if (cb != null)
            {
                TrackerData td = new TrackerData();
                td.cb = cb;
                td.data = cbArg;

                m_grabbing[iq.Id] = td;
            }
            m_connection.Send(iq);
        }
开发者ID:jptoto,项目名称:argsxmpp,代码行数:19,代码来源:IqGrabber.cs


示例14: DiscoverInformation

 public void DiscoverInformation(Jid to, Jid from, IqCB cb)
 {
     DiscoverInformation(to, from, null, cb, null);
 }
开发者ID:wraithkings,项目名称:wmtalk,代码行数:4,代码来源:DiscoManager.cs


示例15: SendStanza

 /// <summary>
 /// Sends a PrivacyIq over the active connection
 /// </summary>
 /// <param name="pIq"></param>
 /// <param name="cb"></param>
 /// <param name="cbArg"></param>
 private void SendStanza(PrivacyIq pIq, IqCB cb, object cbArg)
 {
     if (cb == null)
         m_connection.Send(pIq);
     else
         m_connection.IqGrabber.SendIq(pIq, cb, cbArg);
 }
开发者ID:phiree,项目名称:dzdocs,代码行数:13,代码来源:PrivacyManager(2).cs


示例16: SendIq

        /// <summary>
        /// Send an IQ Request and store the object with callback in the Hashtable
        /// </summary>
        /// <param name="iq">The iq to send</param>
        /// <param name="cb">the callback function which gets raised for the response</param>
        /// <param name="cbArg">additional object for arguments</param>
        public void SendIq(IQ iq, IqCB cb, object cbArg,bool isTo)
        {
            // check if the callback is null, in case of wrong usage of this class
            //if (cb != null)
            //{
            //    TrackerData td = new TrackerData();
            //    td.cb = cb;
            //    td.data = cbArg;

            //    m_grabbing[iq.Id] = td;
            //}
            //m_connection.Send(iq);

            // check if the callback is null, in case of wrong usage of this class
            if (cb != null)
            {
                TrackerData td = new TrackerData();
                td.cb = cb;
                td.data = cbArg;

                m_grabbing[iq.Id] = td;

                //iq��CSS.IM.XMPP�з���Iq�ڵ�ʱ����iq.RemoveAttribute("to")
                //iq.RemoveAttribute("to");
            }
            m_connection.Send(iq);
        }
开发者ID:songques,项目名称:CSSIM_Solution,代码行数:33,代码来源:IqGrabber.cs


示例17: AddList

 /// <summary>
 /// Add a new list with the given name and rules.
 /// </summary>        
 /// <param name="name"></param>
 /// <param name="rules"></param>
 ///// <param name="cb">Callback for the server result</param>
 /// <param name="cbArg">Callback arguments for the result when needed</param>
 public void AddList(string name, Item[] rules, IqCB cb, object cbArg)
 {
     UpdateList(name, rules, cb, cbArg);
 }
开发者ID:phiree,项目名称:dzdocs,代码行数:11,代码来源:PrivacyManager(2).cs


示例18: ModifyAffiliations

        /// <summary>
        /// Modify the roles of the parties in this list.
        /// To use, retrive a ParticipantCollection, change the roles
        /// of the parties in that collection, then pass that modified
        /// collection in here.
        /// </summary>
        /// <param name="parties">The modified participant collection</param>
        /// <param name="reason">The reason for the change</param>
        /// <param name="callback">A callback to call when complete.  Will have a null IQ if there were no changes to make.</param>
        /// <param name="state">Caller's state information</param>
        public void ModifyAffiliations(ParticipantCollection parties, string reason, IqCB callback, object state)
        {
            /*
            <iq from='[email protected]'
                id='ban2'
                to='[email protected]/throne'
                type='result'>
              <query xmlns='http://jabber.org/protocol/muc#admin'>
                <item affiliation='outcast'
                      jid='[email protected]'>
                  <reason>Treason</reason>
                </item>
              </query>
            </iq>
            */
            RoomAdminIQ iq = new RoomAdminIQ(m_manager.Stream.Document);
            iq.To = m_room;
            iq.Type = IQType.set;
            AdminQuery query = iq.Instruction;

            int count = 0;
            foreach (RoomParticipant party in parties)
            {
                if (party.Changed && (party.RealJID != null))
                {
                    count++;
                    AdminItem item = query.AddItem();
                    item.JID = party.RealJID;
                    item.Affiliation = party.Affiliation;
                    item.Reason = reason;
                }
            }
            if (count > 0)
                m_manager.BeginIQ(iq, callback, state);
            else
                callback(this, null, state);
        }
开发者ID:sq5gvm,项目名称:JabberNet-2010,代码行数:47,代码来源:ConferenceManager.cs


示例19: Configure

 /// <summary>
 /// Request configuration form as the owner
 /// </summary>
 /// <param name="callback">Callback.  Must not be null.  Will not be called back 
 /// if there is an error, but instead OnError will be called.</param>
 /// <param name="state">State information to be passed back to callback</param>
 public void Configure(IqCB callback, object state)
 {
     OwnerPubSubCommandIQ<OwnerConfigure> iq = new OwnerPubSubCommandIQ<OwnerConfigure>(m_stream.Document);
     iq.To = m_jid;
     iq.Type = IQType.get;
     iq.Command.Node = m_node;
     BeginIQ(iq, OnConfigure, new IQTracker.TrackerData(callback, state, null, null));
 }
开发者ID:krbysn,项目名称:jabber-net,代码行数:14,代码来源:PubSubManager.cs


示例20: ModifyRoles

        /// <summary>
        /// Modify the roles of the parties in this list.
        /// To use, retrive a ParticipantCollection, change the roles
        /// of the parties in that collection, then pass that modified
        /// collection in here.
        /// </summary>
        /// <param name="parties">The modified participant collection</param>
        /// <param name="reason">The reason for the change</param>
        /// <param name="callback">A callback to call when complete.  Will have a null IQ if there were no changes to make.</param>
        /// <param name="state">Caller's state information</param>
        public void ModifyRoles(ParticipantCollection parties, string reason, IqCB callback, object state)
        {
            /*
            <iq from='[email protected]/globe'
                id='voice4'
                to='[email protected]'
                type='set'>
              <query xmlns='http://jabber.org/protocol/muc#admin'>
                <item nick='Hecate'
                      role='visitor'/>
                <item nick='rosencrantz'
                      role='participant'>
                  <reason>A worthy fellow.</reason>
                </item>
                <item nick='guildenstern'
                      role='participant'>
                  <reason>A worthy fellow.</reason>
                </item>
              </query>
            </iq>
            */
            RoomAdminIQ iq = new RoomAdminIQ(m_manager.Stream.Document);
            iq.To = m_room;
            iq.Type = IQType.set;
            AdminQuery query = iq.Instruction;

            int count = 0;
            foreach (RoomParticipant party in parties)
            {
                if (party.Changed)
                {
                    count++;
                    AdminItem item = query.AddItem();
                    item.Nick = party.Nick;
                    item.Role = party.Role;
                    item.Reason = reason;
                }
            }
            if (count > 0)
                m_manager.BeginIQ(iq, callback, state);
            else
                callback(this, null, state);
        }
开发者ID:sq5gvm,项目名称:JabberNet-2010,代码行数:53,代码来源:ConferenceManager.cs



注:本文中的IqCB类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IqType类代码示例发布时间:2022-05-24
下一篇:
C# IplImage类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap