public TrayPopupForm()
        {
            InitializeComponent();

            this.Width = _trayFormWidth;
            this.Height = _trayFormHeight;

            this._settings = Settings.Deserialize(Constants.SaveSettingsFileName);
            groupLinkLabel.Text = this._settings.GroupId;
            _communicator = new Communicator(this._settings);

            this.MouseEnter += new EventHandler(delegate(object sender, EventArgs e) { this.hideTimer.Enabled = false; });
            this.MouseLeave += new EventHandler(delegate(object sender, EventArgs e)
            {
                Point cursorPosition = Cursor.Position;
                if (
                    (cursorPosition.X < this.Location.X || cursorPosition.X > this.Location.X + this.Width) ||
                    (cursorPosition.Y < this.Location.Y || cursorPosition.Y > this.Location.Y + this.Height)
                    )
                {
                    this.hideTimer.Enabled = true;
                }
            });
            hideTimer.Tick += new EventHandler(hideTimer_Tick);

            _setPopupFormLocation();
            _initTrayIcon();

            this.Paint += new PaintEventHandler(TrayPopupForm_Paint);
            this.Shown += new EventHandler(TrayPopupForm_Shown);
        }
 public SettingsForm(Settings settings, cleancode.bot.schedule.tray.Constants.SettingsTransferEventArgs e)
 {
     InitializeComponent();
     this._settings = settings;
     this._settingsTransferAction = e;
 }
 private void _showSettingsEvent(object sender, EventArgs e)
 {
     SettingsForm settingsForm = new SettingsForm(_settings,
         delegate(Settings settings)
         {
             _settings = settings;
             _communicator.Settings = settings;
             groupLinkLabel.Text = settings.GroupId;
         });
     settingsForm.ShowDialog();
 }
 public Communicator(Settings settings)
 {
     this.Settings = settings;
 }