Example #1
0
        public MainForm()
        {
            InitializeComponent();
              components = new NestedContainer(this);

              var uiThread = new SynchronizationContextScheduler(SynchronizationContext.Current);

              var subscriptions = new CompositeDisposable(
            RxMessageBrokerMinimod.Default.Register<Log>(m =>
            {
              Debug.WriteLine(m.Message);

              var addedIndex = lbxEvents.Items.Add(m.Message);
              lbxEvents.SelectedIndex = addedIndex;
            }, uiThread),
            RxMessageBrokerMinimod.Default.Register<CurrentFile>(m =>
            {
              lblCurrentFile.Text = m.FileName;
              lblLength.Text = m.Length.ToString();
            }, uiThread));

              components.Add(new Disposer(_ => subscriptions.Dispose()));
        }