本文整理汇总了C#中IObservable.ObserveOnDispatcher方法的典型用法代码示例。如果您正苦于以下问题:C# IObservable.ObserveOnDispatcher方法的具体用法?C# IObservable.ObserveOnDispatcher怎么用?C# IObservable.ObserveOnDispatcher使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObservable
的用法示例。
在下文中一共展示了IObservable.ObserveOnDispatcher方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InteractionsContainer
public InteractionsContainer(IObservable<ActivateInteractionMsg> activateInteractionObservable)
{
_interactionModelsReadOnly = new ReadOnlyObservableCollection<IInteractionModel>(_interactionModels);
activateInteractionObservable
.ObserveOnDispatcher()
.Subscribe(OnAttentionRequested);
}
示例2: ReactiveEditCommand
public ReactiveEditCommand(
Func<IEditor> createEditor,
IObservable<bool> canExecute,
IScheduler editorScheduler,
object editable)
{
Editable = editable;
CreateEditor = createEditor;
CanExecute = canExecute.ObserveOnDispatcher();
EditorScheduler = editorScheduler;
}
示例3: RenderFrameObservableChanged
void RenderFrameObservableChanged(IObservable<RenderFrame> renderFrameObservable)
{
if (m_compositeDisposable != null)
{
m_compositeDisposable.Dispose();
}
m_compositeDisposable = new CompositeDisposable();
renderFrameObservable
.ObserveOnDispatcher()
.Subscribe(frame =>
{
// update & draw
m_renderer.Render(frame);
})
.AddTo(m_compositeDisposable)
;
}
示例4: CreateMonitor
protected override IPollingMonitor CreateMonitor(Dictionary<string, string> configuration)
{
var username = configuration["Username"];
var password = configuration["Password"];
var uri = configuration["Uri"];
var buildTypeIds = new string[0];
if (configuration.ContainsKey("BuildTypeIds"))
{
buildTypeIds = configuration["BuildTypeIds"].Split(',');
}
var client = new TeamCityClient(uri, username, password);
var monitor = new TeamCityBuildMonitor(client, buildTypeIds);
_eventSource = Observable.FromEventPattern<BuildEventArgs>(monitor, "BuildUpdated").Select(e=>e.EventArgs.Build);
_eventHandler = _eventSource.ObserveOnDispatcher().Subscribe(ReceiveBuild);
return monitor;
}
示例5: WrapObservableQuery
protected override IObservable<TrackingInformation> WrapObservableQuery(IObservable<TrackingInformation> qry)
{
return qry.ObserveOnDispatcher();
}
示例6: PositionPresenter
public PositionPresenter(IMappingService MappingService, IObservable<EarthPoint> Position)
{
_mappingService = MappingService;
Position.ObserveOnDispatcher()
.Subscribe(RefreshPosition);
}