Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
		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();
		}