This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
command=`basename "$0"` | |
run-windows-command "$command" "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IObservable<TResult> FromTdf<T, TResult>(this IObservable<T> source, | |
Func<IPropagatorBlock<T, TResult>> blockFactory) => Observable.Create<TResult>(observer => { | |
var block = blockFactory(); | |
var dsp1 = block.AsObservable().Subscribe(observer.OnNext); | |
var dsp2 = source.Subscribe(block.AsObserver()); | |
return new CompositeDisposable {dsp2, dsp1}; | |
}); | |
public static IObservable<TResult> FromTdf<T, TResult>(this IObservable<T> source, | |
IPropagatorBlock<T, TResult> block) => source.FromTdf(() => block); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// A more closed version of the official SpecsFor class, | |
/// with some additional helpers | |
/// </summary> | |
/// <typeparam name="T"></typeparam> | |
public abstract class SpecsFor<T> : SpecsFor.SpecsFor<T>, IAnd<T> where T : class | |
{ | |
protected abstract override void Given(); | |
protected abstract override void When(); | |
public sealed override void TearDown() => base.TearDown(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare module 'linq4es2015/linq' { | |
export default class Linq { | |
static setExtensions(): void; | |
static repeat<T>(element: T, count: number): Enumerable<T>; | |
static range(start: number, count: number): Enumerable<number>; | |
static empty<T>(): Enumerable<T>; | |
static asEnumerable<T>(source: T[]): Enumerable<T>; | |
static aggregate(): any; | |
static all(): any; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Uses character by character parsing for StandardOutput and StandardError, so \r can be processed. | |
/// Uses observables instead of eventhandlers. Do not call BeginReadStandardOutput and BeginReadStandardError etc | |
/// </summary> | |
public class ReactiveProcess : Process | |
{ | |
readonly CompositeDisposable _observables; | |
readonly Subject<string> _standardErrorObserable; | |
readonly Subject<string> _standardOutputObserable; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
readonly ICollection<Action> _transactionCallbacks = new Collection<Action>(); | |
public override int SaveChanges() { | |
int r; | |
try { | |
ExecuteDomainEvents(); | |
r = base.SaveChanges(); | |
} catch (Exception) { | |
_transactionCallbacks.Clear(); | |
throw; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class BaseHub : Hub | |
{ | |
public EventHandler Disposing; | |
bool _disposed; | |
protected override void Dispose(bool disposing) { | |
if (_disposed) | |
return; | |
_disposed = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestViewModel : ReactiveObject | |
{ | |
const int _intVal = 1; | |
public int IntVal { get { return _intVal; } } | |
ObservableAsPropertyHelper<int> _MyReactiveVal; | |
public int MyReactiveVal | |
{ | |
get { return _MyReactiveVal.Value; } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Workaround for RXUi, first object initialization must be on UI Thread | |
private class DummyModel : BindableBase | |
{ | |
private ObservableAsPropertyHelper<string> _propertyHelper; | |
public string PropertyHelper | |
{ | |
get { return _propertyHelper.Value; } | |
} | |
private string _Name; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Type: System.Exception | |
Message: An OnError occurred on an object (usually ObservableAsPropertyHelper) that would break a binding or command. To prevent this, Subscribe to the ThrownExceptions property of your objects | |
Source: ReactiveUI | |
TargetSite: Void <.cctor>b__2() | |
Data: System.Collections.ListDictionaryInternal | |
RubyMessage: An OnError occurred on an object (usually ObservableAsPropertyHelper) that would break a binding or command. To prevent this, Subscribe to the ThrownExceptions property of your objects | |
Inner Exception: | |
Type: System.NullReferenceException | |
Message: Object reference not set to an instance of an object. | |
Source: System |