private void OpenLink(TabGroupItem barItemConfig) { var isAllowed = barItemConfig.UserGranted; if (isAllowed && !String.IsNullOrEmpty(barItemConfig.Password)) { using (var form = new FormPassword(barItemConfig.Password, barItemConfig.Title)) { var result = form.ShowDialog(this); if (result == DialogResult.Cancel) { return; } isAllowed = result == DialogResult.OK; } } if (!isAllowed) { MessageBox.Show(this, "You are not authorized to access this feature", "Not authorized", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } barItemConfig.Open(); }
private void OpenLink(TabGroupItem barItemConfig) { var isAllowed = barItemConfig.UserGranted; if (isAllowed && !String.IsNullOrEmpty(barItemConfig.Password)) { using (var form = new FormPassword(barItemConfig.Password, barItemConfig.Title)) { var result = form.ShowDialog(this); if (result == DialogResult.Cancel) return; isAllowed = result == DialogResult.OK; } } if (!isAllowed) { MessageBox.Show(this, "You are not authorized to access this feature", "Not authorized", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } barItemConfig.Open(); }