当前位置: 首页>>代码示例>>C#>>正文


C# Message.AddChild方法代码示例

本文整理汇总了C#中Message.AddChild方法的典型用法代码示例。如果您正苦于以下问题:C# Message.AddChild方法的具体用法?C# Message.AddChild怎么用?C# Message.AddChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Message的用法示例。


在下文中一共展示了Message.AddChild方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: write

    public override int write(string path, int flags, string buffer, int offset, int length)
    {
        if (getWorkPathArray(path)[1] == "contacts")
        {
            Console.WriteLine("looking for contacts:" + getNewfileName(path));
            return 0;
        }
        else if (getWorkPathArray(path)[1] == "chats")
        {
            Console.WriteLine("looking for chats:" + getNewfileName(path)+" : " + buffer);
            xmppManager.xmpp.Send(new agsXMPP.protocol.client.Message("[email protected]", MessageType.chat, buffer));
            return 0;
        }
        else if (getWorkPathArray(path)[1] == "nodes")
        {
            Console.WriteLine("write received:" + buffer);

            AgIXML agiMsg = new AgIXML("tput", "/home");
            Jid to = new Jid("[email protected]");
            Message msg = new Message();
            msg.To = to;
            msg.AddChild(agiMsg);

            xmppManager.xmpp.Send(msg);

            return 0;
        }
        else
           return errors.READ_ONLY;
    }
开发者ID:Softsurve,项目名称:Silver-Iodide,代码行数:30,代码来源:XMPPFS.cs

示例2: SendGameInvite

 public void SendGameInvite(User user, Guid sessionId, string gamePassword)
 {
     Log.InfoFormat("Sending game request to {0}", user.UserName);
     var req = new InviteToGameRequest(sessionId, gamePassword);
     var m = new Message(user.JidUser, this.Me.JidUser, MessageType.normal, "", "invitetogamerequest");
     m.GenerateId();
     m.AddChild(req);
     this.xmpp.Send(m);
 }
开发者ID:digitalalchemy,项目名称:OCTGN,代码行数:9,代码来源:Client.cs

示例3: BeginHostGame

 /// <summary>
 /// The begin host game.
 /// </summary>
 /// <param name="game">
 /// The game.
 /// </param>
 /// <param name="gamename">
 /// The gamename.
 /// </param>
 public void BeginHostGame(Octgn.DataNew.Entities.Game game, string gamename,
     string password, string actualgamename, string gameIconUrl, Version sasVersion, bool specators)
 {
     var hgr = new HostGameRequest(game.Id, game.Version, gamename, actualgamename, gameIconUrl, password ?? "", sasVersion, specators);
     //string data = string.Format("{0},:,{1},:,{2},:,{3},:,{4}", game.Id.ToString(), game.Version, gamename, password ?? "",actualgamename);
     Log.InfoFormat("BeginHostGame {0}", hgr);
     var m = new Message(this.Config.GameBotUser.JidUser, this.Me.JidUser, MessageType.normal, "", "hostgame");
     m.GenerateId();
     m.AddChild(hgr);
     this.xmpp.Send(m);
 }
开发者ID:digitalalchemy,项目名称:OCTGN,代码行数:20,代码来源:Client.cs

示例4: SetSub

 public void SetSub(bool subbed)
 {
     if (!this.IsConnected) return;
     var m = new Message(new Jid("[email protected]" + Host), MessageType.groupchat, string.Empty);
     //m.Body = Me.FullUserName + " " + subbed;
     m.AddChild(new Sub(subbed));
     m.GenerateId();
     this.xmpp.Send(m);
 }
开发者ID:TriAdX,项目名称:OCTGN,代码行数:9,代码来源:Client.cs

示例5: Decline

        /// <summary>
        /// Decline a groupchat invitation
        /// </summary>
        /// <param name="to">
        /// the jid which invited us
        /// </param>
        /// <param name="room">
        /// to room to which we send the decline (this is normally the same room we were invited to)
        /// </param>
        /// <param name="reason">
        /// reason why we decline the invitation
        /// </param>
        public void Decline(Jid to, Jid room, string reason)
        {
            Message msg = new Message();
            msg.To = room;

            User user = new User();
            if (reason != null)
            {
                user.Decline = new Decline(to, reason);
            }
            else
            {
                user.Decline = new Decline(to);
            }

            msg.AddChild(user);

            m_connection.Send(msg);
        }
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:31,代码来源:MucManager.cs

示例6: Invite

        /// <summary>
        /// Invite multiple contacts to a chatroom
        /// </summary>
        /// <param name="jids">
        /// </param>
        /// <param name="room">
        /// </param>
        /// <param name="reason">
        /// </param>
        public void Invite(Jid[] jids, Jid room, string reason)
        {
            Message msg = new Message();
            msg.To = room;

            User user = new User();
            foreach (Jid jid in jids)
            {
                if (reason != null)
                {
                    user.AddChild(new Invite(jid, reason));
                }
                else
                {
                    user.AddChild(new Invite(jid));
                }
            }

            msg.AddChild(user);

            m_connection.Send(msg);
        }
开发者ID:Inzaghi2012,项目名称:teamlab.v7.5,代码行数:31,代码来源:MucManager.cs


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