本文整理汇总了C#中Chat.SendMessage方法的典型用法代码示例。如果您正苦于以下问题:C# Chat.SendMessage方法的具体用法?C# Chat.SendMessage怎么用?C# Chat.SendMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chat
的用法示例。
在下文中一共展示了Chat.SendMessage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: send_message
public void send_message(string username, string message)
{
var user = new User();
var users = new UserCollection {user};
var chat = new Chat();
// chat.AddMembers(users);
chat.SendMessage(message);
}
示例2: SendMessage
/// <summary>
/// 指定したチャットに、指定したメッセージを送信します。
/// </summary>
/// <param name="chat"></param>
/// <param name="text"></param>
private void SendMessage(Chat chat, string text)
{
chat.SendMessage(text);
}
示例3: newUpdatesTest
public void newUpdatesTest()
{
Chat chat = new Chat();
Assert.IsFalse(chat.newUpdates(1), "Updates for a not existing chatter id");
Chatter chatter = new Chatter(new Guid(), "chatter");
chatter.intId = 2;
chat.join(chatter);
Assert.IsTrue(chat.newUpdates(chatter.intId), "No updates after joining");
chat.iAmUpToDate(chatter.intId);
Assert.IsFalse(chat.newUpdates(chatter.intId), "Updates after call 'I'm up to date'");
chat.SendMessage("hallo");
Assert.IsTrue(chat.newUpdates(chatter.intId), "No updates after receiving a new message");
chat.iAmUpToDate(chatter.intId);
chat.SendMessageTo("hallo", 1);
Assert.IsFalse(chat.newUpdates(chatter.intId), "Updates after whispering to a different chatter");
chat.SendMessageTo("hallo", 2);
Assert.IsTrue(chat.newUpdates(chatter.intId), "No updates after whispering to this chatter");
}
示例4: InitBatle
public void InitBatle(string Name, Chat ch, string donger)
{
Init();
if (p1.nll == true)
{
Donger tmp=dongers.Find(x => x.dongerName == donger);
if (tmp==null)
p1 = new Player(Name, dongers[SeijaHelper.RandomProvider.GetThreadRandom().Next(0, dongers.Count)].Clone(), GetKonfaName(ch.Name));
else
p1 = new Player(Name, tmp.Clone(), GetKonfaName(ch.Name));
ch.SendMessage("Первый игрок - " + p1.name + " и его донгер: \n\r" + p1.donger.Info + "\n\rОжидание второго игрока");
ch1 = ch;
restTimer = new System.Windows.Threading.DispatcherTimer();
restTimer.Interval = new TimeSpan(0, 0, 30);
restTimer.Tick += RestTick;
restTimer.Start();
}
else
{
restTimer.Stop();
ch2 = ch;
if (Name == p1.name)
p2 = new Player("SeijaBot", Donger.seija.Clone(), GetKonfaName(ch.Name));
else
{
Donger tmp=dongers.Find(x => x.dongerName == donger);
if (tmp == null)
{
Donger temp;
do
{
temp = dongers[SeijaHelper.RandomProvider.GetThreadRandom().Next(0, dongers.Count)].Clone();
}
while (temp.dongerName == p1.donger.dongerName);
p2 = new Player(Name, temp.Clone(), GetKonfaName(ch.Name));
}
else
p2 = new Player(Name, tmp.Clone(), GetKonfaName(ch.Name));
}
SendMessages("Второй игрок - " + p2.name + " и его донгер: \n\r" + p2.donger.Info);
StartBattle();
}
}
示例5: SendMessageTest1
public void SendMessageTest1()
{
Chat chat = new Chat();
for (int i = 0; i < 5; i++)
{
string message = "Another test message!!! " + i;
string returnMessage = chat.SendMessage(message);
Assert.IsTrue(returnMessage.Contains(message), "Run " + i + ": the message text was not used");
Assert.AreEqual(returnMessage, chat.AllMessages[chat.AllMessages.Count - 1].Message, "Run " + i + ": the saved message is not the returned message");
Assert.AreEqual(-1, chat.AllMessages[chat.AllMessages.Count - 1].id, "Run " + i + ": The message is not visible for all chatters");
}
}
示例6: Leave
public void Leave(Chat chat)
{
if (!chat.Equals(myChats[0])) {
chat.leave(this);
myChats.Remove(chat);
chat.SendMessage("User [b]" + m_name + "[/b] left the Chat Room");
}
mainChat = 0;
}
示例7: Join
public void Join(Chat chat)
{
if (!myChats.Contains(chat)) {
chat.join(this);
myChats.Add(chat);
chat.SendMessage("User [b]" + m_name + "[/b] has joined the Chat");
}
}
示例8: SendResponse
public void SendResponse(Chat chat, string message)
{
chat.SendMessage(message);
}
示例9: SetSettingsGroup
private void SetSettingsGroup(Chat group)
{
if (ToLink.IsChecked == true)
{
try {
group.SendMessage("/set options +JOINING_ENABLED");
}
catch { }
group.SendMessage("/get uri");
group.SendMessage("Это ссылка для вступления в группу по ссылке.");
}
//if (HappyDay.IsChecked == true)
//{
// group.SendMessage("/nobday");
//}
if (OldPosts.IsChecked==true)
{
try
{
group.SendMessage("/set options +HISTORY_DISCLOSED");
}
catch { }
}
if (UserAreListener.IsChecked == true)
{
try
{
group.SendMessage("/set options +USERS_ARE_LISTENERS");
}
catch { }
}
//if (FormatText.IsChecked == true)
//{
// group.SendMessage("/wikimarkup off");
//}
try
{
group.SendMessage("/set options +TOPIC_AND_PIC_LOCKED_FOR_USERS");
}
catch { }
}