Permalink
Browse files

Add more Rx2 stubs in System.Reactive.Core.dll.

  • Loading branch information...
1 parent 30d6697 commit ff9a38461b87933e8bbeaf99a9866de507f0f82c @atsushieno committed Jul 1, 2012
@@ -0,0 +1,20 @@
+using System;
+
+namespace System.Reactive.Concurrency
+{
+ public static class VirtualTimeSchedulerExtensions
+ {
+ public static IDisposable ScheduleAbsolute<TAbsolute, TRelative> (this VirtualTimeSchedulerBase<TAbsolute,TRelative> scheduler, TAbsolute dueTime, Action action)
+ where TAbsolute : IComparable<TAbsolute>
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IDisposable ScheduleAbsolute<TAbsolute, TRelative> (this VirtualTimeSchedulerBase<TAbsolute,TRelative> scheduler, TRelative dueTime, Action action)
+ where TAbsolute : IComparable<TAbsolute>
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
+
@@ -138,6 +138,8 @@
<Compile Include="..\System.Reactive\System.Reactive.Concurrency\ScheduledItemImpl.cs">
<Link>System.Reactive.Concurrency\ScheduledItemImpl.cs</Link>
</Compile>
+ <Compile Include="System.Reactive.Concurrency\VirtualTimeSchedulerExtensions.cs" />
+ <Compile Include="System.Reactive\ListObservable.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
@@ -0,0 +1,90 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace System.Reactive.Linq
+{
+ public class ListObservable<T> : IList<T>, IObservable<T>
+ {
+ public ListObservable ()
+ {
+ }
+
+ public IEnumerator GetEnumerator ()
+ {
+ throw new System.NotImplementedException ();
+ }
+
+ IEnumerator<T> IEnumerable<T>.GetEnumerator ()
+ {
+ throw new System.NotImplementedException ();
+ }
+
+ public void Add (T item)
+ {
+ throw new System.NotImplementedException ();
+ }
+
+ public void Clear ()
+ {
+ throw new System.NotImplementedException ();
+ }
+
+ public bool Contains (T item)
+ {
+ throw new System.NotImplementedException ();
+ }
+
+ public void CopyTo (T[] array, int arrayIndex)
+ {
+ throw new System.NotImplementedException ();
+ }
+
+ public bool Remove (T item)
+ {
+ throw new System.NotImplementedException ();
+ }
+
+ public int Count {
+ get {
+ throw new System.NotImplementedException ();
+ }
+ }
+
+ public bool IsReadOnly {
+ get {
+ throw new System.NotImplementedException ();
+ }
+ }
+
+ public int IndexOf (T item)
+ {
+ throw new System.NotImplementedException ();
+ }
+
+ public void Insert (int index, T item)
+ {
+ throw new System.NotImplementedException ();
+ }
+
+ public void RemoveAt (int index)
+ {
+ throw new System.NotImplementedException ();
+ }
+
+ public T this [int index] {
+ get {
+ throw new System.NotImplementedException ();
+ }
+ set {
+ throw new System.NotImplementedException ();
+ }
+ }
+
+ public IDisposable Subscribe (IObserver<T> observer)
+ {
+ throw new System.NotImplementedException ();
+ }
+ }
+}
+
@@ -7,6 +7,22 @@ namespace System.Reactive.Concurrency
{
public class HistoricalScheduler : HistoricalSchedulerBase
{
+#if REACTIVE_2_0
+ public HistoricalScheduler ()
+ {
+ }
+
+ public HistoricalScheduler (DateTimeOffset initialClock)
+ : base (initialClock, Comparer<DateTimeOffset>.Default)
+ {
+ }
+
+ public HistoricalScheduler (DateTimeOffset initialClock, IComparer<DateTimeOffset> comparer)
+ : base (initialClock, comparer)
+ {
+ }
+#endif
+
List<ScheduledItem<DateTimeOffset>> tasks = new List<ScheduledItem<DateTimeOffset>> ();
protected override IScheduledItem<DateTimeOffset> GetNext ()
@@ -1,9 +1,26 @@
using System;
+using System.Collections.Generic;
namespace System.Reactive.Concurrency
{
public abstract class HistoricalSchedulerBase : VirtualTimeSchedulerBase<DateTimeOffset, TimeSpan>
{
+#if REACTIVE_2_0
+ protected HistoricalSchedulerBase ()
+ {
+ }
+
+ protected HistoricalSchedulerBase (DateTimeOffset initialClock)
+ : base (initialClock, Comparer<DateTimeOffset>.Default)
+ {
+ }
+
+ protected HistoricalSchedulerBase (DateTimeOffset initialClock, IComparer<DateTimeOffset> comparer)
+ : base (initialClock, comparer)
+ {
+ }
+#endif
+
protected override DateTimeOffset Add (DateTimeOffset absolute, TimeSpan relative)
{
return absolute + relative;
@@ -9,8 +9,6 @@ public abstract class VirtualTimeScheduler<TAbsolute, TRelative>
: VirtualTimeSchedulerBase<TAbsolute, TRelative>
where TAbsolute : IComparable<TAbsolute> // strictly to say, this is not in Rx1, but it must be anyways.
{
- IComparer<TAbsolute> comparer = Comparer<TAbsolute>.Default;
-
protected VirtualTimeScheduler ()
{
tasks = new List<ScheduledItem<TAbsolute>> ();
@@ -44,7 +42,7 @@ void AddTask (IList<ScheduledItem<TAbsolute>> tasks, ScheduledItem<TAbsolute> ta
int pos = -1;
TAbsolute dueTime = task.DueTime;
for (int i = tasks.Count - 1; i >= 0; i--) {
- if (comparer.Compare (dueTime, tasks [i].DueTime) >= 0) {
+ if (Comparer.Compare (dueTime, tasks [i].DueTime) >= 0) {
tasks.Insert (i + 1, task);
pos = i;
break;
@@ -93,7 +93,15 @@ public void Stop ()
{
// what is this method for?
}
-
+
+#if REACTIVE_2_0
+ public IStopwatch StartStopwatch ()
+ {
+ // what is this method for?
+ throw new NotImplementedException ();
+ }
+#endif
+
protected abstract DateTimeOffset ToDateTimeOffset (TAbsolute absolute);
protected abstract TRelative ToRelative (TimeSpan timeSpan);
@@ -2871,5 +2871,77 @@ public static IObservable<TResult> When<TResult> (params Plan<TResult>[] plans)
return When (first.And (second).Then (resultSelector));
}
+
+#if REACTIVE_2_0
+ public static IObservable<TResult> Case<TValue, TResult> (System.Func<TValue> selector, IDictionary<TValue,IObservable<TResult>> sources)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IObservable<TResult> Case<TValue, TResult> (System.Func<TValue> selector, IDictionary<TValue,IObservable<TResult>> sources, IObservable<TResult> defaultSource)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IObservable<TResult> Case<TValue, TResult> (System.Func<TValue> selector, IDictionary<TValue,IObservable<TResult>> sources, IScheduler scheduler)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IEnumerable<IList<TSource>> Chunkify<TSource> (this IObservable<TSource> source)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IEnumerable<TResult> Collect<TSource, TResult> (this IObservable<TSource> source, Func<TResult> getInitialCollector, Func<TResult,TSource,TResult> merge, Func<TResult,TResult> getNewCollector)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IEnumerable<TResult> Collect<TSource, TResult> (this IObservable<TSource> source, Func<TResult> newCollector, Func<TResult,TSource,TResult> merge)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IObservable<TSource> DelaySubscription<TSource> (this IObservable<TSource> source, DateTimeOffset dueTime, IScheduler scheduler)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IObservable<TSource> DelaySubscription<TSource> (this IObservable<TSource> source, DateTimeOffset dueTime)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IObservable<TSource> DelaySubscription<TSource> (this IObservable<TSource> source, TimeSpan dueTime, IScheduler scheduler)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IObservable<TSource> DelaySubscription<TSource> (this IObservable<TSource> source, TimeSpan dueTime)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IObservable<TResult> Let<TSource, TResult> (this IObservable<TSource> source, Func<IObservable<TSource>,IObservable<TResult>> selector)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IObservable<TResult> ManySelect<TSource, TResult> (this IObservable<TSource> source, Func<IObservable<TSource>,TResult> selector)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static IObservable<TResult> ManySelect<TSource, TResult> (this IObservable<TSource> source, Func<IObservable<TSource>,TResult> selector, IScheduler scheduler)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static ListObservable<TSource> ToListObservable<TSource> (this IObservable<TSource> source)
+ {
+ throw new NotImplementedException ();
+ }
+#endif
}
}

0 comments on commit ff9a384

Please sign in to comment.