示例#1
0
      public ChatForm()
      {
         // Initialize logging system.
         Log.InitLogging();

         // Start up this window.
         InitializeComponent();

         // Restore window position.
         //WindowUtils.RestoreWindowPosition(this, null, WindowUtils.DefaultPosition.GlobalDefault);

         // Create and initialize the controller for all the internal logic.
         m_controller = new SenescoController();
         m_controller.ProgressUpdated += progressUpdated;
         m_controller.Connected += connected;
         m_controller.Disconnected += disconnected;
         m_controller.ChatReceived += chatReceived;
         m_controller.UserListUpdate += userListUpdate;
         //m_controller.PmReceived += pmReceived;
         //m_controller.UserInfoReceived += userInfoReceived;

         // Clear the window title initially.
         SetWindowTitle(null);

         // Synchronize the bookmark menu with the current bookmark files.
         UpdateBookmarks();

         // Process the command-line arguments.
         //ProcessStartup();
      }
示例#2
0
      public Presenter(string[] startupArgs)
      {
         // Initialize logging system.
         Log.InitLogging();

         // Keep a handle to the current main GUI thread, so that we can have proper object
         // ownership when it comes time for this presenter to present new GUI objects.
         m_dispatcher = Dispatcher.CurrentDispatcher;

         // Create and initialize the controller for all the internal logic.
         m_controller = new SenescoController();
         m_controller.ProgressUpdated += progressUpdated;
         m_controller.Connected += connected;
         m_controller.Disconnected += disconnected;
         m_controller.ChatReceived += chatReceived;
         m_controller.UserListUpdate += userListUpdate;
         m_controller.PmReceived += pmReceived;
         m_controller.UserInfoReceived += userInfoReceived;
         m_controller.NewVersionAvailable += newVersionAvailable;

         // Create and show the main chat window.
         // Note that this creator is run in the main GUI thread, so this chat window is properly owned,
         // but other windows we create may be in different threads so we'll have to take extra care.
         m_chatWindow = new ChatWindow(this, m_controller);
         m_chatWindow.Show();

         // Process the command-line arguments.
         ProcessStartup(startupArgs);
      }
示例#3
0
      public PmSendWindow(Window owner, SenescoController controller, User targetUser, string replyText)
      {
         WindowUtils.ConfigureChildWindow(owner, this);
         InitializeComponent();
         WindowUtils.RestoreWindowPosition(this, owner, WindowUtils.DefaultPosition.CenterOnParent);

         m_controller = controller;
         m_targetUser = targetUser;

         if (m_targetUser != null)
            m_recipientLabel.Content = String.Format("Recipient: {0}", m_targetUser.Username);

         // Hide the quote and splitter grid rows if there is no text to quote.
         if (String.IsNullOrEmpty(replyText))
         {
            m_quoteRow.Height = new GridLength(0);
            m_splitterRow.Height = new GridLength(0);
         }
         else
         {
            // Otherwise put the reply text in its text box.
            m_replyTextBox.AppendText(replyText);
            // And slightly extend the window height.
            //this.Height *= 1.2;
         }
      }
示例#4
0
      public ConnectWindow(Window owner, SenescoController controller)
      {
         WindowUtils.ConfigureChildWindow(owner, this);
         InitializeComponent();
         WindowUtils.RestoreWindowPosition(this, owner, WindowUtils.DefaultPosition.CenterOnParent);

         m_controller = controller;
      }
示例#5
0
      public UserListWindow(Window owner, SenescoController controller)
      {
         // Set up this new window.
         WindowUtils.ConfigureChildWindow(owner, this);
         InitializeComponent();
         WindowUtils.RestoreWindowPosition(this, owner, WindowUtils.DefaultPosition.RightOfParent);

         // Configure the internals and user objects.
         m_controller = controller;
         CreateContextMenu(m_userListBox);
         RefreshUserList();
      }
      public PmReceiveWindow(Window owner, SenescoController controller, string sendingNick, int sendingUserId, string message)
      {
         WindowUtils.ConfigureChildWindow(owner, this);
         InitializeComponent();
         WindowUtils.RestoreWindowPosition(this, owner, WindowUtils.DefaultPosition.CenterOnParent);

         m_owner = owner;
         m_controller = controller;
         m_sendingNick = sendingNick;
         m_sendingUserId = sendingUserId;
         m_senderLabel.Content = String.Format("Sender: {0}", sendingNick);
         m_pmText.AppendText(message);
      }
示例#7
0
      public ChatWindow(Presenter presenter, SenescoController controller)
      {
         m_presenter = presenter;
         m_controller = controller;

         // Start up this window.
         InitializeComponent();

         // Restore window position.
         WindowUtils.RestoreWindowPosition(this, null, WindowUtils.DefaultPosition.GlobalDefault);

         // Clear the window title initially.
         SetWindowTitle(null);

         // Synchronize the bookmark menu with the current bookmark files.
         UpdateBookmarks();
      }
示例#8
0
      public UserListForm(SenescoController controller)
      {
         InitializeComponent();

         m_controller = controller;
      }