Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/rx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@veritas-vos-liberabit.com>2013-01-22 12:25:22 +0400
committerAtsushi Eno <atsushieno@veritas-vos-liberabit.com>2013-01-22 12:25:22 +0400
commitcde9fc6a8fe569203cb991121a35c2a9c7f4c420 (patch)
tree8633a637be4973b221d9c7e9378af5e0a08b5670 /Rx/NET/Samples/HOL/CS/Excercise5/Step03/Program.cs
parent8911e1d3f169a0e378b4e237926269d9218c8fd3 (diff)
import 2b5dbddd740b, new directory structure in the original rx.
Diffstat (limited to 'Rx/NET/Samples/HOL/CS/Excercise5/Step03/Program.cs')
-rw-r--r--Rx/NET/Samples/HOL/CS/Excercise5/Step03/Program.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/Rx/NET/Samples/HOL/CS/Excercise5/Step03/Program.cs b/Rx/NET/Samples/HOL/CS/Excercise5/Step03/Program.cs
new file mode 100644
index 0000000..5d06ae5
--- /dev/null
+++ b/Rx/NET/Samples/HOL/CS/Excercise5/Step03/Program.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Reactive.Linq;
+using System.Windows.Forms;
+using System.Reactive.Disposables;
+
+namespace Excercise5
+{
+ class Program
+ {
+ static void Main()
+ {
+ var txt = new TextBox();
+
+ var frm = new Form()
+ {
+ Controls = { txt }
+ };
+
+ var input = (from evt in Observable.FromEventPattern(txt, "TextChanged")
+ select ((TextBox)evt.Sender).Text)
+ .Do(inp => Console.WriteLine("Before DistinctUntilChanged: " + inp))
+ .DistinctUntilChanged();
+
+ using (input.Subscribe(inp => Console.WriteLine("User wrote: " + inp)))
+ {
+ Application.Run(frm);
+ }
+
+ }
+ }
+}