Exemplo n.º 1
0
        private void btnAddBuddy_Click(object sender, EventArgs e)
        {
            if (btnAddBuddy.Enabled)
            {
                var diag = new AddEditBuddy(_helpService, _authAuthService.GetRestService());
                if (diag.ShowDialog() == DialogResult.OK)
                {
                    bool isMyself = diag.BuddyId == _settings.GetPersistent().BuddySyncUserIdV3;
                    if (diag.BuddyId > 0 && !isMyself)
                    {
                        _buddySubscriptionDao.SaveOrUpdate(new BuddySubscription {
                            Id = diag.BuddyId, Nickname = diag.Nickname
                        });
                    }

                    UpdateBuddyList();
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Add another buddy subscription
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void firefoxButton2_Click(object sender, EventArgs e)
        {
            if (long.TryParse(buddyId.Text, out var id))
            {
                if (id > 0 && id != Properties.Settings.Default.BuddySyncUserIdV2)
                {
                    _buddySubscriptionDao.SaveOrUpdate(new BuddySubscription {
                        Id = id
                    });
                }

                UpdateBuddyList();
                _enableCallback(true);
            }
            else
            {
                errorProvider1.SetError(buddyId, GlobalSettings.Language.GetTag("iatag_ui_buddy_userid_numeric_error_message"));
                errorProvider1.SetIconAlignment(buddyId, ErrorIconAlignment.MiddleLeft);
            }

            buddyId.Text = "";
        }