Skip to content

Commit

Permalink
Fix more build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
anaisbetts committed Apr 29, 2011
1 parent d385c9d commit 44adc6f
Show file tree
Hide file tree
Showing 18 changed files with 439 additions and 59 deletions.
8 changes: 6 additions & 2 deletions ReactiveUI.Blend/ReactiveUI.Blend.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Reactive">
<Reference Include="System.Reactive, Version=1.0.2856.104, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ext\System.Reactive.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Windows.Threading, Version=1.0.10425.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ext\System.Reactive.Windows.Threading.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
Expand Down Expand Up @@ -81,4 +85,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Reactive">
<HintPath>..\ext\System.Reactive.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Reactive.Testing">
<HintPath>..\ext\Microsoft.Reactive.Testing.dll</HintPath>
</Reference>
<Reference Include="System.Reactive, Version=1.0.2856.104, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ext\System.Reactive.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
Expand Down
5 changes: 3 additions & 2 deletions ReactiveUI.Serialization/ReactiveUI.Serialization.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Reactive">
<Reference Include="System.Reactive, Version=1.0.2856.104, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ext\System.Reactive.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
Expand Down Expand Up @@ -76,4 +77,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
2 changes: 1 addition & 1 deletion ReactiveUI.Tests/DependencyObjectMixinTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void ObservableFromDPSmokeTest()
Assert.Equal("TestString", v.PropertyName);
}
return Unit.Value;
return Unit.Default;
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions ReactiveUI.Tests/ObservedChangedMixinTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void ValueTest()
public void BindToSmokeTest()
{
(new TestScheduler()).With(sched => {
var input = new Subject<string>(sched);
var input = new ScheduledSubject<string>(sched);
var fixture = new HostTestFixture() {Child = new TestFixture()};
input.BindTo(fixture, x => x.Child.IsNotNullString);
Expand All @@ -121,7 +121,7 @@ public void BindToSmokeTest()
public void DisposingDisconnectsTheBindTo()
{
(new TestScheduler()).With(sched => {
var input = new Subject<string>(sched);
var input = new ScheduledSubject<string>(sched);
var fixture = new HostTestFixture() {Child = new TestFixture()};
var subscription = input.BindTo(fixture, x => x.Child.IsNotNullString);
Expand All @@ -144,7 +144,7 @@ public void DisposingDisconnectsTheBindTo()
public void BindToIsNotFooledByIntermediateObjectSwitching()
{
(new TestScheduler()).With(sched => {
var input = new Subject<string>(sched);
var input = new ScheduledSubject<string>(sched);
var fixture = new HostTestFixture() {Child = new TestFixture()};
var subscription = input.BindTo(fixture, x => x.Child.IsNotNullString);
Expand Down
7 changes: 4 additions & 3 deletions ReactiveUI.Tests/ReactiveUI.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Reactive">
<HintPath>..\ext\System.Reactive.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Reactive.Testing">
<HintPath>..\ext\Microsoft.Reactive.Testing.dll</HintPath>
</Reference>
<Reference Include="System.Reactive, Version=1.0.2856.104, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ext\System.Reactive.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml" />
Expand Down
18 changes: 7 additions & 11 deletions ReactiveUI.Tests/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,25 @@ public IDisposable Schedule(Action action)
return InnerScheduler.Schedule(action);
}

public IDisposable Schedule(Action action, TimeSpan dueTime)
{
ScheduledItems.Add(new Tuple<Action, TimeSpan?>(action, dueTime));
return InnerScheduler.Schedule(action, dueTime);
}

public DateTimeOffset Now {
get { return InnerScheduler.Now; }
}

public IDisposable Schedule<TState>(TState state, Func<IScheduler, TState, IDisposable> action, DateTimeOffset dueTime)
public IDisposable Schedule<TState>(TState state, DateTimeOffset dueTime, Func<IScheduler, TState, IDisposable> action)
{
throw new NotImplementedException();
return InnerScheduler.Schedule(state, dueTime, action);
}

public IDisposable Schedule<TState>(TState state, Func<IScheduler, TState, IDisposable> action, TimeSpan dueTime)
public IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)
{
throw new NotImplementedException();
ScheduledItems.Add(new Tuple<Action, TimeSpan?>(null, dueTime));
return InnerScheduler.Schedule(state, dueTime, action);
}

public IDisposable Schedule<TState>(TState state, Func<IScheduler, TState, IDisposable> action)
{
throw new NotImplementedException();
ScheduledItems.Add(new Tuple<Action, TimeSpan?>(null, null));
return InnerScheduler.Schedule(state, action);
}
}

Expand Down
22 changes: 11 additions & 11 deletions ReactiveUI.Xaml/ReactiveAsyncCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Reactive.Concurrency;
using System.Diagnostics.Contracts;
using System.Reactive;
using System.Reactive.Concurrency;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using ReactiveUI;
Expand Down Expand Up @@ -79,12 +78,12 @@ public static ReactiveAsyncCommand Create<TRet>(

void commonCtor(int maximumConcurrent, IScheduler scheduler)
{
_canExecuteSubject = new Subject<bool>(Scheduler.Immediate);
_executeSubject = new Subject<object>(Scheduler.Immediate);
_canExecuteSubject = new ScheduledSubject<bool>(Scheduler.Immediate);
_executeSubject = new ScheduledSubject<object>(Scheduler.Immediate);
_normalSched = scheduler ?? RxApp.DeferredScheduler;

AsyncStartedNotification = new Subject<Unit>(RxApp.DeferredScheduler);
AsyncCompletedNotification = new Subject<Unit>(RxApp.DeferredScheduler);
AsyncStartedNotification = new ScheduledSubject<Unit>(RxApp.DeferredScheduler);
AsyncCompletedNotification = new ScheduledSubject<Unit>(RxApp.DeferredScheduler);

ItemsInflight = Observable.Merge(
AsyncStartedNotification.Select(_ => 1),
Expand Down Expand Up @@ -117,9 +116,9 @@ void commonCtor(int maximumConcurrent, IScheduler scheduler)

IScheduler _normalSched;
Func<object, bool> _canExecuteExplicitFunc = null;
Subject<bool> _canExecuteSubject;
ISubject<bool> _canExecuteSubject;
bool _canExecuteLatest;
Subject<object> _executeSubject;
ISubject<object> _executeSubject;
int _maximumConcurrent;

public IObservable<int> ItemsInflight { get; protected set; }
Expand Down Expand Up @@ -171,15 +170,15 @@ public IObservable<TResult> RegisterAsyncFunction<TResult>(
{
Contract.Requires(calculationFunc != null);

var taskSubj = new Subject<object>(scheduler ?? RxApp.TaskpoolScheduler);
var taskSubj = new ScheduledSubject<object>(scheduler ?? RxApp.TaskpoolScheduler);
_executeSubject.Multicast(taskSubj).RefCount();

var unit = new Unit();
return taskSubj
.Do(_ => AsyncStartedNotification.OnNext(unit))
.Select(calculationFunc)
.Do(_ => AsyncCompletedNotification.OnNext(unit))
.Multicast(new Subject<TResult>(RxApp.DeferredScheduler));
.Multicast(new ScheduledSubject<TResult>(RxApp.DeferredScheduler));
}

/// <summary>
Expand Down Expand Up @@ -210,7 +209,7 @@ public IObservable<TResult> RegisterAsyncObservable<TResult>(Func<object, IObser
{
Contract.Requires(calculationFunc != null);

var taskSubj = new Subject<object>(RxApp.TaskpoolScheduler);
var taskSubj = new ScheduledSubject<object>(RxApp.TaskpoolScheduler);
_executeSubject.Multicast(taskSubj).RefCount();

var unit = new Unit();
Expand All @@ -220,7 +219,8 @@ public IObservable<TResult> RegisterAsyncObservable<TResult>(Func<object, IObser

return ret
.SelectMany(x => x.Finally(() => AsyncCompletedNotification.OnNext(unit)))
.Multicast(new Subject<TResult>(RxApp.DeferredScheduler));
.Multicast(new ScheduledSubject<TResult>(RxApp.DeferredScheduler))
.RefCount();
}

/// <summary>
Expand Down
8 changes: 6 additions & 2 deletions ReactiveUI.Xaml/ReactiveUI.Xaml.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,14 @@
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Reactive">
<Reference Include="System.Reactive, Version=1.0.2856.104, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ext\System.Reactive.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Windows.Threading, Version=1.0.10425.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ext\System.Reactive.Windows.Threading.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
Expand Down Expand Up @@ -128,4 +132,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
8 changes: 4 additions & 4 deletions ReactiveUI/MakeObjectReactiveHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ public IDisposable SuppressChangeNotifications()
public event PropertyChangedEventHandler PropertyChanged;
public event PropertyChangingEventHandler PropertyChanging;

readonly Subject<IObservedChange<object, object>> _Changing =
new Subject<IObservedChange<object, object>>(RxApp.DeferredScheduler);
readonly ISubject<IObservedChange<object, object>> _Changing =
new ScheduledSubject<IObservedChange<object, object>>(RxApp.DeferredScheduler);

public IObservable<IObservedChange<object, object>> Changing {
#if SILVERLIGHT
Expand All @@ -52,8 +52,8 @@ public IObservable<IObservedChange<object, object>> Changing {
#endif
}

Subject<IObservedChange<object, object>> _Changed =
new Subject<IObservedChange<object, object>>(RxApp.DeferredScheduler);
ISubject<IObservedChange<object, object>> _Changed =
new ScheduledSubject<IObservedChange<object, object>>(RxApp.DeferredScheduler);

public IObservable<IObservedChange<object, object>> Changed {
#if SILVERLIGHT
Expand Down
6 changes: 3 additions & 3 deletions ReactiveUI/MessageBus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ public static IMessageBus Current {
get { return RxApp.MessageBus; }
}

Subject<T> setupSubjectIfNecessary<T>(string contract, IScheduler scheduler)
ISubject<T> setupSubjectIfNecessary<T>(string contract, IScheduler scheduler)
{
scheduler = scheduler ?? RxApp.DeferredScheduler;
Subject<T> ret = null;
ISubject<T> ret = null;
NotAWeakReference subjRef = null;

withMessageBus(typeof(T), contract, (mb, tuple) => {
Expand All @@ -117,7 +117,7 @@ Subject<T> setupSubjectIfNecessary<T>(string contract, IScheduler scheduler)
return;
}
ret = new Subject<T>(scheduler);
ret = new ScheduledSubject<T>(scheduler);
mb[tuple] = new NotAWeakReference(ret);
});

Expand Down
2 changes: 1 addition & 1 deletion ReactiveUI/ObservableAsPropertyHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public ObservableAsPropertyHelper(
scheduler = scheduler ?? RxApp.DeferredScheduler;
_lastValue = initialValue;

var subj = new Subject<T>(scheduler);
var subj = new ScheduledSubject<T>(scheduler);
subj.Subscribe(x => {
this.Log().InfoFormat("Property helper {0:X} changed", this.GetHashCode());
_lastValue = x;
Expand Down
4 changes: 2 additions & 2 deletions ReactiveUI/ObservableAsyncMRUCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public static IObservable<TRet> CachedSelectMany<T, TRet>(this IObservable<T> Th

internal class SemaphoreSubject<T> : ISubject<T>, IEnableLogger
{
readonly Subject<T> _inner;
readonly ISubject<T> _inner;
Queue<T> _nextItems = new Queue<T>();
long _count;
readonly long _maxCount;
Expand All @@ -204,7 +204,7 @@ public SemaphoreSubject(int maxCount, IScheduler sched = null)
#if WINDOWS_PHONE
_inner = new Subject<T>();
#else
_inner = (sched != null ? new Subject<T>(sched) : new Subject<T>());
_inner = (sched != null ? (ISubject<T>)new ScheduledSubject<T>(sched) : new Subject<T>());
#endif
_maxCount = maxCount;
}
Expand Down
20 changes: 10 additions & 10 deletions ReactiveUI/ReactiveCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ public class ReactiveCollection<T> : ObservableCollection<T>, IReactiveCollectio

void setupRx(IEnumerable<T> List = null)
{
_BeforeItemsAdded = new Subject<T>(RxApp.DeferredScheduler);
_BeforeItemsRemoved = new Subject<T>(RxApp.DeferredScheduler);
_BeforeItemsAdded = new ScheduledSubject<T>(RxApp.DeferredScheduler);
_BeforeItemsRemoved = new ScheduledSubject<T>(RxApp.DeferredScheduler);
aboutToClear = new Subject<int>();

if (List != null) {
Expand All @@ -59,7 +59,7 @@ void setupRx(IEnumerable<T> List = null)
.SelectMany(x =>
(x.NewItems != null ? x.NewItems.OfType<T>() : Enumerable.Empty<T>())
.ToObservable())
.Multicast(new Subject<T>(RxApp.DeferredScheduler)).RefCount();
.Multicast(new ScheduledSubject<T>(RxApp.DeferredScheduler)).RefCount();

_ItemsRemoved = ocChangedEvent
.Where(x =>
Expand All @@ -69,7 +69,7 @@ void setupRx(IEnumerable<T> List = null)
.SelectMany(x =>
(x.OldItems != null ? x.OldItems.OfType<T>() : Enumerable.Empty<T>())
.ToObservable())
.Multicast(new Subject<T>(RxApp.DeferredScheduler)).RefCount();
.Multicast(new ScheduledSubject<T>(RxApp.DeferredScheduler)).RefCount();

_CollectionCountChanging = Observable.Merge(
_BeforeItemsAdded.Select(_ => this.Count),
Expand All @@ -81,8 +81,8 @@ void setupRx(IEnumerable<T> List = null)
.Select(x => this.Count)
.DistinctUntilChanged();

_ItemChanging = new Subject<IObservedChange<T, object>>(RxApp.DeferredScheduler);
_ItemChanged = new Subject<IObservedChange<T,object>>(RxApp.DeferredScheduler);
_ItemChanging = new ScheduledSubject<IObservedChange<T, object>>(RxApp.DeferredScheduler);
_ItemChanged = new ScheduledSubject<IObservedChange<T,object>>(RxApp.DeferredScheduler);

// TODO: Fix up this selector nonsense once SL/WP7 gets Covariance
_Changing = Observable.Merge(
Expand Down Expand Up @@ -158,7 +158,7 @@ public IObservable<T> ItemsAdded {
}

[IgnoreDataMember]
protected Subject<T> _BeforeItemsAdded;
protected ISubject<T> _BeforeItemsAdded;

/// <summary>
/// Fires before an item is going to be added to the collection.
Expand All @@ -179,7 +179,7 @@ public IObservable<T> ItemsRemoved {
}

[IgnoreDataMember]
protected Subject<T> _BeforeItemsRemoved;
protected ISubject<T> _BeforeItemsRemoved;

/// <summary>
/// Fires before an item will be removed from a collection, providing
Expand Down Expand Up @@ -215,7 +215,7 @@ public IObservable<int> CollectionCountChanged {
}

[IgnoreDataMember]
protected Subject<IObservedChange<T, object>> _ItemChanging;
protected ISubject<IObservedChange<T, object>> _ItemChanging;

/// <summary>
/// Provides Item Changed notifications for any item in collection that
Expand All @@ -230,7 +230,7 @@ IObservable<IObservedChange<object, object>> IReactiveCollection.ItemChanging {
}

[IgnoreDataMember]
protected Subject<IObservedChange<T, object>> _ItemChanged;
protected ISubject<IObservedChange<T, object>> _ItemChanged;

/// <summary>
/// Provides Item Changing notifications for any item in collection that
Expand Down
Loading

0 comments on commit 44adc6f

Please sign in to comment.