Exemple #1
0
        public NewHiddenSegmentDialog(IServiceProvider serviceProvider)
            : base(serviceProvider)
        {
            InitializeComponent();

            var container = new CompositeDisposable();

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

            container.Add(
                Observable.FromEventPattern <EventArgs>(txtName, "TextChanged")
                .Sample(TimeSpan.FromSeconds(1))
                .ObserveOn(System.Threading.SynchronizationContext.Current)
                .Subscribe(evt =>
            {
                btnOK.Enabled = !string.IsNullOrWhiteSpace(txtName.Text);
            }));

            container.Add(
                Observable.FromEventPattern <EventArgs>(btnOK, "Click")
                .ObserveOn(System.Threading.SynchronizationContext.Current)
                .Subscribe(evt =>
            {
                Item         = new HiddenSegmentsItem(null);
                Item.Segment = txtName.Text;
                DialogResult = DialogResult.OK;
            }));
        }
Exemple #2
0
 public SegmentListViewItem(HiddenSegmentsItem item, RequestFilteringPage page)
     : base(item.Segment)
 {
     Item  = item;
     _page = page;
 }