Exemplo n.º 1
0
        public DigestEditDialog(IServiceProvider serviceProvider, DigestItem item, AuthenticationFeature feature)
            : base(serviceProvider)
        {
            InitializeComponent();
            txtRealm.Text = item.Realm;
            txtRealm.SelectAll();

            var container = new CompositeDisposable();

            FormClosed += (sender, args) => container.Dispose();

            container.Add(
                Observable.FromEventPattern <EventArgs>(btnOK, "Click")
                .ObserveOn(System.Threading.SynchronizationContext.Current)
                .Subscribe(evt =>
            {
                item.Realm = txtRealm.Text;
                item.Apply();
                DialogResult = DialogResult.OK;
            }));

            container.Add(
                Observable.FromEventPattern <CancelEventArgs>(this, "HelpButtonClicked")
                .ObserveOn(System.Threading.SynchronizationContext.Current)
                .Subscribe(EnvironmentVariableTarget =>
            {
                feature.ShowHelp();
            }));
        }
Exemplo n.º 2
0
        public DigestEditDialog(IServiceProvider serviceProvider, DigestItem item)
            : base(serviceProvider)
        {
            InitializeComponent();
            txtRealm.Text = item.Realm;
            txtRealm.SelectAll();

            var container = new CompositeDisposable();

            FormClosed += (sender, args) => container.Dispose();

            container.Add(
                Observable.FromEventPattern <EventArgs>(btnOK, "Click")
                .Subscribe(evt =>
            {
                item.Realm = txtRealm.Text;
                item.Apply();
                DialogResult = DialogResult.OK;
            }));
        }