public MainPageViewModel( IWorkerServiceClientFactory factory ) { this.factory = factory; this.ExecuteEcho = DelegateCommand.Create() .OnExecute( o => { var context = TaskScheduler.FromCurrentSynchronizationContext(); using( var client = this.factory.CreateAsyncClient() ) { client.WorkOnAsync( new Job( new EchoJobTask() { Message = this.Message } ) ) .ContinueWith( e => { var r = e.Result.GetTaskResult<EchoJobTaskResult>().EchoedMessage; this.EchoResult = r; }, context ); } using( var client = this.factory.CreateAsyncClient() ) { client.ExecuteAsync( new SampleCommand() ) .ContinueWith( e => { var r = e.Result as EmptyCommandExecutionResult; }, context ); } } ); }
public MainViewModel(IWorkerServiceClientFactory clientFactory, IViewContextFactory <IPizzerieViewContext> pizzerieViewContextFactory) { this.clientFactory = clientFactory; this.pizzerieViewContextFactory = pizzerieViewContextFactory; this.Pizzerie = new ObservableCollection <PizzeriaView>(); this.Orders = new ObservableCollection <OrderView>(); }
public MainPageViewModel(IWorkerServiceClientFactory factory) { this.factory = factory; this.ExecuteEcho = DelegateCommand.Create() .OnExecute(o => { var context = TaskScheduler.FromCurrentSynchronizationContext(); using (var client = this.factory.CreateAsyncClient()) { client.WorkOnAsync(new Job(new EchoJobTask() { Message = this.Message })) .ContinueWith(e => { var r = e.Result.GetTaskResult <EchoJobTaskResult>().EchoedMessage; this.EchoResult = r; }, context); } using (var client = this.factory.CreateAsyncClient()) { client.ExecuteAsync(new SampleCommand()) .ContinueWith(e => { var r = e.Result as EmptyCommandExecutionResult; }, context); } }); }
public DefaultJasonClientConfiguration( String pathToScanForAssemblies, IWorkerServiceClientFactory clientFactory, String assemblySelectPattern = "*" ) { this.CommandsSelector = t => false; this.path = pathToScanForAssemblies; this.clientFactory = clientFactory; this.AssemblySelector = name => name.IsLike( "jason.*", assemblySelectPattern ); }
public DefaultJasonClientConfiguration(String pathToScanForAssemblies, IWorkerServiceClientFactory clientFactory, String assemblySelectPattern = "*") { this.CommandsSelector = t => false; this.path = pathToScanForAssemblies; this.clientFactory = clientFactory; this.AssemblySelector = name => name.IsLike("jason.*", assemblySelectPattern); }
public MainViewModel( IWorkerServiceClientFactory clientFactory, IViewContextFactory<IPeopleViewContext> peopleViewContextFactory ) { this.clientFactory = clientFactory; this.peopleViewContextFactory = peopleViewContextFactory; this.People = new ObservableCollection<PersonView>(); this.GetPropertyMetadata( () => this.SelectedPerson ) .AddCascadeChangeNotifications( () => this.CanTouchSelectedPerson ); }
public MainViewModel( IWorkerServiceClientFactory clientFactory, Func<IStatelessSession> sessionFactory ) { this.clientFactory = clientFactory; this.sessionFactory = sessionFactory; this.People = new ObservableCollection<PersonView>(); this.GetPropertyMetadata( () => this.SelectedPerson ) .AddCascadeChangeNotifications( () => this.CanTouchSelectedPerson ); }
public MainViewModel(IWorkerServiceClientFactory clientFactory, IViewContextFactory <IPeopleViewContext> peopleViewContextFactory) { this.clientFactory = clientFactory; this.peopleViewContextFactory = peopleViewContextFactory; this.People = new ObservableCollection <PersonView>(); this.GetPropertyMetadata(() => this.SelectedPerson) .AddCascadeChangeNotifications(() => this.CanTouchSelectedPerson); }
public MainViewModel(IWorkerServiceClientFactory clientFactory, Func <IStatelessSession> sessionFactory) { this.clientFactory = clientFactory; this.sessionFactory = sessionFactory; this.People = new ObservableCollection <PersonView>(); this.GetPropertyMetadata(() => this.SelectedPerson) .AddCascadeChangeNotifications(() => this.CanTouchSelectedPerson); }
public OrderCompletedHandler(IWorkerServiceClientFactory clientFactory) { this.clientFactory = clientFactory; }
public WinRTJasonClientConfiguration(IWorkerServiceClientFactory clientFactory) { this.clientFactory = clientFactory; this.CommandsSelector = t => false; this.AssembliesProvider = () => this.GetCompositionAssemblies(); }