示例#1
0
      static void MainForm_TypingStateChanged(object sender, ChatForm.TypingEvent e)
      {
         BBConversation convers = sender as BBConversation;
         // Create istyping message
         BBMessage msg = new BBMessage();
         msg.MsgTypingMsg(e.isTyping);
         msg.Conversation = convers;

         // Send it.
         Client.SendMessage(msg.GetNetMessage(), NetChannel.ReliableUnordered);
      }
示例#2
0
      static void Main()
      {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         //PList = new PlayerList();
         MainForm = new ChatForm();
         AppConfig = new Configuration();
         IsAppHidden = AppConfig.RunMinimized;

         // Create a configuration for the client
         Program.ChatApplicationBusiness.Config = new NetAppConfiguration("BBTcpTest");

         Program.BBBotBusiness = new BBBotBusiness(Program.ChatApplicationBusiness);

         // enable encryption; this key was generated using the 'GenerateEncryptionKeys' application
         Config.EnableEncryption(
              "AQABwV1rQ1NDWzkkhUsYtMiRGjyxSn/zI13tros2RlXHlW6PA7Cvw2nOyMhDmweM+" +
              "T/+FWzssAWLh8qd+YHaMCCFskVdaZfRzquZlNOs9mX/vtxkLrXgBUaJQD/XOuBeJF" +
              "o3RfAKA4uhrEr7Bk1iB3zJQW1bSHK7KmmEWzMErk6iA7c=", null);

         Log = new NetLog();
         Log.IgnoreTypes = NetLogEntryTypes.Verbose; //  Verbose;
         Log.IsOutputToFileEnabled = false;

         Log.OutputFileName = "clientlog.html";

         // uncomment this if you want to start multiple instances of this process on the same computer
         //Log.OutputFileName = "clientlog" + System.Diagnostics.Process.GetCurrentProcess().Id + ".html";

         //Log.LogEvent += new EventHandler<NetLogEventArgs>(Log_LogEvent);

         Client = new NetClient(Config, Log);
         Client.StatusChanged += new EventHandler<NetStatusEventArgs>(Client_StatusChanged);

         Application.Idle += new EventHandler(ApplicationLoop);
         //MainForm.TypingStateChanged += new EventHandler<ChatForm.TypingEvent>(MainForm_TypingStateChanged);

         CreateNotificationIcon();
         Application.Run(MainForm);

         if (Client != null)
            Client.Shutdown("Application exiting");

         if (notifyIconNA != null)
            notifyIconNA.Visible = false;
      }