Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using nameof in more places #347

Merged
merged 2 commits into from
Apr 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MockObserver<T> : ITestableObserver<T>
public MockObserver(TestScheduler scheduler)
{
if (scheduler == null)
throw new ArgumentNullException("scheduler");
throw new ArgumentNullException(nameof(scheduler));

this.scheduler = scheduler;
this.messages = new List<Recorded<Notification<T>>>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public IDisposable StartPeriodicTimer(Action action, TimeSpan period)
// for more information.
//
if (period < TimeSpan.FromMilliseconds(1))
throw new ArgumentOutOfRangeException("period", Strings_PlatformServices.WINRT_NO_SUB1MS_TIMERS);
throw new ArgumentOutOfRangeException(nameof(period), Strings_PlatformServices.WINRT_NO_SUB1MS_TIMERS);

var res = global::Windows.System.Threading.ThreadPoolTimer.CreatePeriodicTimer(
tpt =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public WorkItemOptions Options
public override IDisposable Schedule<TState>(TState state, Func<IScheduler, TState, IDisposable> action)
{
if (action == null)
throw new ArgumentNullException("action");
throw new ArgumentNullException(nameof(action));

var d = new SingleAssignmentDisposable();

Expand Down Expand Up @@ -114,7 +114,7 @@ public override IDisposable Schedule<TState>(TState state, Func<IScheduler, TSta
public override IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)
{
if (action == null)
throw new ArgumentNullException("action");
throw new ArgumentNullException(nameof(action));

var dt = Scheduler.Normalize(dueTime);

Expand Down Expand Up @@ -157,9 +157,9 @@ public IDisposable SchedulePeriodic<TState>(TState state, TimeSpan period, Func<
// for more information.
//
if (period < TimeSpan.FromMilliseconds(1))
throw new ArgumentOutOfRangeException("period", Strings_PlatformServices.WINRT_NO_SUB1MS_TIMERS);
throw new ArgumentOutOfRangeException(nameof(period), Strings_PlatformServices.WINRT_NO_SUB1MS_TIMERS);
if (action == null)
throw new ArgumentNullException("action");
throw new ArgumentNullException(nameof(action));

var state1 = state;
var gate = new AsyncLock();
Expand Down
104 changes: 52 additions & 52 deletions Rx.NET/Source/src/System.Reactive/Linq/Observable.Aggregates.cs

Large diffs are not rendered by default.

382 changes: 191 additions & 191 deletions Rx.NET/Source/src/System.Reactive/Linq/Observable.Async.cs

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions Rx.NET/Source/src/System.Reactive/Linq/Observable.Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ public static partial class Observable
public static IObservable<EventPattern<EventArgs>> FromEventPattern(Action<EventHandler> addHandler, Action<EventHandler> removeHandler)
{
if (addHandler == null)
throw new ArgumentNullException("addHandler");
throw new ArgumentNullException(nameof(addHandler));
if (removeHandler == null)
throw new ArgumentNullException("removeHandler");
throw new ArgumentNullException(nameof(removeHandler));

return s_impl.FromEventPattern(addHandler, removeHandler);
}
Expand Down Expand Up @@ -96,11 +96,11 @@ public static IObservable<EventPattern<object>> FromEventPattern(Action<EventHan
public static IObservable<EventPattern<EventArgs>> FromEventPattern(Action<EventHandler> addHandler, Action<EventHandler> removeHandler, IScheduler scheduler)
{
if (addHandler == null)
throw new ArgumentNullException("addHandler");
throw new ArgumentNullException(nameof(addHandler));
if (removeHandler == null)
throw new ArgumentNullException("removeHandler");
throw new ArgumentNullException(nameof(removeHandler));
if (scheduler == null)
throw new ArgumentNullException("scheduler");
throw new ArgumentNullException(nameof(scheduler));

return s_impl.FromEventPattern(addHandler, removeHandler, scheduler);
}
Expand Down Expand Up @@ -521,9 +521,9 @@ public static IObservable<EventPattern<TEventArgs>> FromEventPattern<TEventArgs>
public static IObservable<EventPattern<EventArgs>> FromEventPattern(object target, string eventName)
{
if (target == null)
throw new ArgumentNullException("target");
throw new ArgumentNullException(nameof(target));
if (eventName == null)
throw new ArgumentNullException("eventName");
throw new ArgumentNullException(nameof(eventName));

return s_impl.FromEventPattern(target, eventName);
}
Expand Down Expand Up @@ -571,11 +571,11 @@ public static IObservable<EventPattern<object>> FromEventPattern(object target,
public static IObservable<EventPattern<EventArgs>> FromEventPattern(object target, string eventName, IScheduler scheduler)
{
if (target == null)
throw new ArgumentNullException("target");
throw new ArgumentNullException(nameof(target));
if (eventName == null)
throw new ArgumentNullException("eventName");
throw new ArgumentNullException(nameof(eventName));
if (scheduler == null)
throw new ArgumentNullException("scheduler");
throw new ArgumentNullException(nameof(scheduler));

return s_impl.FromEventPattern(target, eventName, scheduler);
}
Expand Down Expand Up @@ -812,9 +812,9 @@ public static IObservable<EventPattern<TSender, TEventArgs>> FromEventPattern<TS
public static IObservable<EventPattern<EventArgs>> FromEventPattern(Type type, string eventName)
{
if (type == null)
throw new ArgumentNullException("type");
throw new ArgumentNullException(nameof(type));
if (eventName == null)
throw new ArgumentNullException("eventName");
throw new ArgumentNullException(nameof(eventName));

return s_impl.FromEventPattern(type, eventName);
}
Expand Down Expand Up @@ -862,11 +862,11 @@ public static IObservable<EventPattern<object>> FromEventPattern(Type type, stri
public static IObservable<EventPattern<EventArgs>> FromEventPattern(Type type, string eventName, IScheduler scheduler)
{
if (type == null)
throw new ArgumentNullException("type");
throw new ArgumentNullException(nameof(type));
if (eventName == null)
throw new ArgumentNullException("eventName");
throw new ArgumentNullException(nameof(eventName));
if (scheduler == null)
throw new ArgumentNullException("scheduler");
throw new ArgumentNullException(nameof(scheduler));

return s_impl.FromEventPattern(type, eventName, scheduler);
}
Expand Down
Loading