本文整理汇总了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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}