• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ISchedulerProvider类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ISchedulerProvider的典型用法代码示例。如果您正苦于以下问题:C# ISchedulerProvider类的具体用法?C# ISchedulerProvider怎么用?C# ISchedulerProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ISchedulerProvider类属于命名空间,在下文中一共展示了ISchedulerProvider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ImapClient

 public ImapClient(ISchedulerProvider schedulerProvider, ILoggerFactory loggerFactory)
 {
     //_dedicatedScheduler = schedulerProvider.CreateEventLoopScheduler("IMAP");
     _dedicatedScheduler = schedulerProvider.Concurrent;
     _loggerFactory = loggerFactory;
     _logger = loggerFactory.CreateLogger(GetType());
 }
开发者ID:CallWall,项目名称:CallWall.Web,代码行数:7,代码来源:ImapClient.cs


示例2: TailViewModelFactory

        public TailViewModelFactory([NotNull] IObjectProvider objectProvider,
            [NotNull] ISchedulerProvider schedulerProvider, 
            [NotNull] IColourProvider colourProvider,
            [NotNull] ISearchMetadataFactory searchMetadataFactory, 
            [NotNull] IIconProvider iconProvider,
            [NotNull] ITailViewStateControllerFactory tailViewStateControllerFactory,
            [NotNull] ITextAssociationCollection textAssociationCollection,
            [NotNull]  IThemeProvider themeProvider)
        {
            if (objectProvider == null) throw new ArgumentNullException(nameof(objectProvider));
            if (schedulerProvider == null) throw new ArgumentNullException(nameof(schedulerProvider));
            if (colourProvider == null) throw new ArgumentNullException(nameof(colourProvider));
            if (searchMetadataFactory == null) throw new ArgumentNullException(nameof(searchMetadataFactory));
            if (iconProvider == null) throw new ArgumentNullException(nameof(iconProvider));
            if (tailViewStateControllerFactory == null)
                throw new ArgumentNullException(nameof(tailViewStateControllerFactory));

            _objectProvider = objectProvider;
            _schedulerProvider = schedulerProvider;
            _colourProvider = colourProvider;
            _searchMetadataFactory = searchMetadataFactory;
            _iconProvider = iconProvider;
            _tailViewStateControllerFactory = tailViewStateControllerFactory;
            _textAssociationCollection = textAssociationCollection;
            _themeProvider = themeProvider;
        }
开发者ID:mgnslndh,项目名称:TailBlazer,代码行数:26,代码来源:TailViewModelFactory.cs


示例3: GeneralOptionsViewModel

        public GeneralOptionsViewModel(ISetting<GeneralOptions> setting, ISchedulerProvider schedulerProvider)
        {
            var reader = setting.Value.Subscribe(options =>
            {
                UseDarkTheme = options.Theme== Theme.Dark;
                HighlightTail = options.HighlightTail;
                HighlightDuration = options.HighlightDuration;
                Scale = options.Scale;
            });

            var writter = this.WhenAnyPropertyChanged()
                .Subscribe(vm =>
                {
                    setting.Write(new GeneralOptions(UseDarkTheme ? Theme.Dark : Theme.Light, HighlightTail, HighlightDuration, Scale));
                });

            HighlightDurationText = this.WhenValueChanged(vm=>vm.HighlightDuration)
                                        .Select(value => value.ToString("0.00 Seconds"))
                                        .ForBinding();

            ScaleText = this.WhenValueChanged(vm => vm.Scale)

                                        .Select(value => $"{value} %" )
                                        .ForBinding();

            ScaleRatio= this.WhenValueChanged(vm => vm.Scale)
                                        .Select(value =>(decimal)value / (decimal)100)
                                       // .Sample(TimeSpan.FromMilliseconds(250))
                                        .ForBinding();

            _cleanUp = new CompositeDisposable(reader, writter,  HighlightDurationText, ScaleText, ScaleRatio);
        }
开发者ID:mgnslndh,项目名称:TailBlazer,代码行数:32,代码来源:GeneralOptionsViewModel.cs


示例4: Setup

        public void Setup()
        {
            _sparkCoreSettings = A.Fake<Configuration.ISparkCore>();
            A.CallTo(() => _sparkCoreSettings.AccessToken).Returns("0123456789abcdef123456");
            A.CallTo(() => _sparkCoreSettings.DefaultIndexName).Returns("CoreIndex");
            A.CallTo(() => _sparkCoreSettings.DefaultInterval).Returns(TimeSpan.FromSeconds(100));
            A.CallTo(() => _sparkCoreSettings.DefaultType).Returns("CoreType");
            A.CallTo(() => _sparkCoreSettings.Devices).Returns(new[] { _deviceA, _deviceB });

            _elasticSearchSettings = A.Fake<Configuration.IElasticSearch>();
            A.CallTo(() => _elasticSearchSettings.Host).Returns("http://localhost:9220");
            A.CallTo(() => _elasticSearchSettings.Indexes).Returns(new[] { _tempIndex, _humidityIndex, _lightIndex });

            _settings = A.Fake<Configuration.ISettings>();
            A.CallTo(() => _settings.SparkCore).Returns(_sparkCoreSettings);
            A.CallTo(() => _settings.ElasticSearch).Returns(_elasticSearchSettings);

            _sparkApi = A.Fake<Io.Spark.IApi>();
            _documentFactory = A.Fake<Document.IFactory>();
            _schedulerProvider = A.Fake<ISchedulerProvider>();
            _testScheduler = new TestScheduler();
            A.CallTo(() => _schedulerProvider.AsyncScheduler).Returns(_testScheduler);

            _subject = new SparkSource(_settings, _sparkApi, _documentFactory, _schedulerProvider);
        }
开发者ID:yonglehou,项目名称:OneCog.Spark.Sparkles,代码行数:25,代码来源:SparkSourceTestFixture.cs


示例5: SearchHints

        public SearchHints(ITradeService tradeService, ISchedulerProvider schedulerProvider)
        {
            //instaniate a filter controller so we can change the filter any time
            var filter = new FilterController<string>();

            //build a predicate when SeatchText changes
            var filterApplier = this.WhenValueChanged(t => t.SearchText)
                .Throttle(TimeSpan.FromMilliseconds(250))
                .Select(BuildFilter)
                .Subscribe(filter.Change);

            //share the connection
            var shared = tradeService.All.Connect().Publish();
            //distinct list of customers
            var customers = shared.DistinctValues(trade => trade.Customer);
            //distinct list of currency pairs
            var currencypairs = shared.DistinctValues(trade => trade.CurrencyPair);

            //create single list of all customers all items in currency ypairs
            var loader = customers.Or(currencypairs)
                .Filter(filter)     //filter strings
                .Sort(SortExpressionComparer<string>.Ascending(str=>str))
                .ObserveOn(schedulerProvider.MainThread)
                .Bind(out _hints)       //bind to hints list
                .Subscribe();

            _cleanUp = new CompositeDisposable(loader, filter, shared.Connect(), filterApplier);
        }
开发者ID:GorelH,项目名称:Dynamic.Trader,代码行数:28,代码来源:SearchHints.cs


示例6: PagedDataViewer

        public PagedDataViewer(ITradeService tradeService, ISchedulerProvider schedulerProvider)
        {
            //build observable predicate from search text
            var filter = this.WhenValueChanged(t => t.SearchText)
                .Throttle(TimeSpan.FromMilliseconds(250))
                .Select(BuildFilter);

            //build observable sort comparer
            var sort = SortParameters.WhenValueChanged(t => t.SelectedItem)
                .Select(prop => prop.Comparer)
                .ObserveOn(schedulerProvider.TaskPool);

            //build observable comparer
            var currentPageChanged = PageParameters.WhenValueChanged(p => p.CurrentPage);
            var pageSizeChanged = PageParameters.WhenValueChanged(p => p.PageSize);
            var pager = currentPageChanged.CombineLatest(pageSizeChanged,(page, size) => new PageRequest(page, size))
                .StartWith(new PageRequest(1, 25))
                .DistinctUntilChanged()
                .Sample(TimeSpan.FromMilliseconds(100));
            
            // filter, sort, page and bind to observable collection
            _cleanUp = tradeService.All.Connect()
                .Filter(filter) // apply user filter
                .Transform(trade => new TradeProxy(trade), new ParallelisationOptions(ParallelType.Ordered, 5))
                .Sort(sort, SortOptimisations.ComparesImmutableValuesOnly)
                .Page(pager)
                .ObserveOn(schedulerProvider.MainThread)
                .Do(changes => _pageParameters.Update(changes.Response))
                .Bind(out _data)        // update observable collection bindings
                .DisposeMany()          // dispose when no longer required
                .Subscribe();
        }
开发者ID:reactiveui-forks,项目名称:Dynamic.Trader,代码行数:32,代码来源:PagedDataViewer.cs


示例7: TradeService

        public TradeService(ILogger logger,TradeGenerator tradeGenerator, ISchedulerProvider schedulerProvider)
        {
            _logger = logger;
            _tradeGenerator = tradeGenerator;
            _schedulerProvider = schedulerProvider;

            //construct a cache specifying that the primary key is Trade.Id
            _tradesSource = new SourceCache<Trade, long>(trade => trade.Id);

            //call AsObservableCache() to hide the update methods as we are exposing the cache
            _all = _tradesSource.AsObservableCache();

            //create a derived cache  
            _live = _tradesSource.Connect(trade => trade.Status == TradeStatus.Live).AsObservableCache();

            //code to emulate an external trade provider
            var tradeLoader = GenerateTradesAndMaintainCache();

            //expire closed items from the cache ro avoid unbounded data
           var expirer = _tradesSource
               .ExpireAfter(t => t.Status == TradeStatus.Closed ? TimeSpan.FromMinutes(1) : (TimeSpan?)null,TimeSpan.FromMinutes(1),schedulerProvider.TaskPool)
               .Subscribe(x=>_logger.Info("{0} filled trades have been removed from memory",x.Count()));

            //log changes
            var loggerWriter = LogChanges();

            _cleanup = new CompositeDisposable(_all, _tradesSource, tradeLoader, loggerWriter, expirer);
        }
开发者ID:bbqchickenrobot,项目名称:Dynamic.Trader,代码行数:28,代码来源:TradeService.cs


示例8: TradesByTimeViewer

        public TradesByTimeViewer(ITradeService tradeService, ISchedulerProvider schedulerProvider)
        {
            _schedulerProvider = schedulerProvider;

            var groupController = new GroupController();
            var grouperRefresher = Observable.Interval(TimeSpan.FromSeconds(1))
                .Subscribe(_ => groupController.RefreshGroup());

            var loader = tradeService.Trades.Connect()
                .Group(trade =>
                       {
                           var diff = DateTime.Now.Subtract(trade.Timestamp);
                           if (diff.TotalSeconds <= 60) return TimePeriod.LastMinute;
                           if (diff.TotalMinutes <= 60) return TimePeriod.LastHour;
                           return TimePeriod.Older;
                       }, groupController)
                .Transform(group => new TradesByTime(group, _schedulerProvider))
                .Sort(SortExpressionComparer<TradesByTime>.Ascending(t => t.Period))
                .ObserveOn(_schedulerProvider.Dispatcher)
                .Bind(_data)
                .DisposeMany()
                .Subscribe();
            
            _cleanUp = new CompositeDisposable(loader, grouperRefresher);
        }
开发者ID:sk8tz,项目名称:TradingDemo,代码行数:25,代码来源:TradesByTimeViewer.cs


示例9: RecentFilesViewModel

        public RecentFilesViewModel(IRecentFileCollection recentFileCollection, ISchedulerProvider schedulerProvider)
        {
            _recentFileCollection = recentFileCollection;
            if (recentFileCollection == null) throw new ArgumentNullException(nameof(recentFileCollection));
            if (schedulerProvider == null) throw new ArgumentNullException(nameof(schedulerProvider));
            
            ReadOnlyObservableCollection<RecentFileProxy> data;
            var recentLoader = recentFileCollection.Items
                .Connect()
                .Transform(rf => new RecentFileProxy(rf, toOpen =>
                                                            {
                                                                _fileOpenRequest.OnNext(new FileInfo(toOpen.Name));
                                                            },
                                                            recentFileCollection.Remove))
                .Sort(SortExpressionComparer<RecentFileProxy>.Descending(proxy => proxy.Timestamp))
                .ObserveOn(schedulerProvider.MainThread)
                .Bind(out data)
                .Subscribe();

            Files = data;

            _cleanUp = Disposable.Create(() =>
            {
                recentLoader.Dispose();
                _fileOpenRequest.OnCompleted();
            }) ;
        }
开发者ID:ckarcz,项目名称:TailBlazer,代码行数:27,代码来源:RecentFilesViewModel.cs


示例10: BluetoothDevice

 public BluetoothDevice(IBluetoothDeviceInfo deviceInfo, IBluetoothService bluetoothService, ISchedulerProvider schedulerProvider)
 {
     _deviceInfo = deviceInfo;
     _bluetoothService = bluetoothService;
     _schedulerProvider = schedulerProvider;
     _pairDeviceCommand = new DelegateCommand(PairDevice, () => !Status.IsProcessing && !IsAuthenticated);
     _removeDeviceCommand = new DelegateCommand(RemoveDevice, () => !Status.IsProcessing && _deviceInfo.IsAuthenticated);
 }
开发者ID:CallWall,项目名称:CallWall.Windows,代码行数:8,代码来源:BluetoothDevice.cs


示例11: ProfileDashBoardViewModel

 public ProfileDashBoardViewModel(IProfileDashboard profileDashboard, ISchedulerProvider schedulerProvider)
 {
     _profileDashboard = profileDashboard;
     _schedulerProvider = schedulerProvider;
     _messages = new DashboardCollection<Message>(_profileDashboard.Messages.ObserveOn(_schedulerProvider.Dispatcher));
     _pictureAlbums = new DashboardCollection<Album>(_profileDashboard.PictureAlbums.ObserveOn(_schedulerProvider.Dispatcher));
     _calendarEvents = new DashboardCollection<ICalendarEvent>(_profileDashboard.CalendarEvents.ObserveOn(_schedulerProvider.Dispatcher));
 }
开发者ID:CallWall,项目名称:CallWall.Windows,代码行数:8,代码来源:ProfileDashBoardViewModel.cs


示例12: TailViewModelFactory

        public TailViewModelFactory([NotNull] IObjectProvider objectProvider, [NotNull] ISchedulerProvider schedulerProvider)
        {
            if (objectProvider == null) throw new ArgumentNullException(nameof(objectProvider));
            if (schedulerProvider == null) throw new ArgumentNullException(nameof(schedulerProvider));

            _objectProvider = objectProvider;
            _schedulerProvider = schedulerProvider;
        }
开发者ID:CalvinRodo,项目名称:TailBlazer,代码行数:8,代码来源:TailViewModelFactory.cs


示例13: PuzzleBoardViewModel

 public PuzzleBoardViewModel(IPuzzlesService puzzlesService, ISchedulerProvider scheduler, IUserService userService)
 {
     _cells = new ObservableCollection<CellEmptyViewModel>();
     _words = new ObservableCollection<WordViewModel>();
     _scheduler = scheduler;
     _userService = userService;
     _puzzlesService = puzzlesService;
     CreateCellsForBoard();
 }
开发者ID:abdulbaruwa,项目名称:CrossSharp,代码行数:9,代码来源:PuzzleBoardViewModel.cs


示例14: TailViewStateController

        public TailViewStateController([NotNull] TailViewModel tailView, IStateBucketService stateBucketService, ISchedulerProvider schedulerProvider, ITailViewStateRestorer tailViewStateRestorer, ILogger logger, bool loadDefaults)
        {
            if (tailView == null) throw new ArgumentNullException(nameof(tailView));

            _tailView = tailView;

            var converter = new TailViewToStateConverter();

            bool loadingSettings=false;
            const string type = "TailView";
            logger.Info("Loading state for {0}", tailView.Name);

            //Load state

            if (loadDefaults)
            {
                stateBucketService
                    .Lookup(type, tailView.Name)
                    .IfHasValue(tailviewstate =>
                    {
                        schedulerProvider.Background.Schedule(() =>
                        {
                            try
                            {
                                loadingSettings = true;
                                tailViewStateRestorer.Restore(tailView, tailviewstate);
                            }
                            finally
                            {
                                loadingSettings = false;
                            }

                        });
                    });
            }

            //write latest to file when something triggers a change
            var selectedChanged = tailView.SearchCollection
                    .WhenValueChanged(sc=>sc.Selected,false)
                    .Where(vm => vm !=null)
                    .Select(vm=>vm.Text);

            var metaChanged = _tailView.SearchMetadataCollection.Metadata.Connect()
                    .ToCollection()
                    .Select(metaData => metaData.ToArray());

            var writer = selectedChanged.CombineLatest(metaChanged,(selected, metadata)=>new { selected , metadata })
                        .Where(_=> !loadingSettings)
                        .Throttle(TimeSpan.FromMilliseconds(250))
                        .Select(x => converter.Convert(_tailView.Name, x.selected, x.metadata))
                    .Subscribe(state =>
                    {
                        stateBucketService.Write(type, tailView.Name, state);
                    });

            _cleanUp = new CompositeDisposable(writer);
        }
开发者ID:CalvinRodo,项目名称:TailBlazer,代码行数:57,代码来源:TailViewStateController.cs


示例15: FileTailerViewModel

        public FileTailerViewModel(ILogger logger,ISchedulerProvider schedulerProvider, FileInfo fileInfo)
        {
            if (logger == null) throw new ArgumentNullException(nameof(logger));
            if (schedulerProvider == null) throw new ArgumentNullException(nameof(schedulerProvider));
            if (fileInfo == null) throw new ArgumentNullException(nameof(fileInfo));

            var filterRequest = this.WhenValueChanged(vm => vm.SearchText).Throttle(TimeSpan.FromMilliseconds(125));
            var autoChanged = this.WhenValueChanged(vm => vm.AutoTail);
            var scroller = _userScrollRequested
                        .CombineLatest(autoChanged, (user, auto) =>
                        {
                            var mode = AutoTail ? ScrollingMode.Tail : ScrollingMode.User;
                            return  new ScrollRequest(mode, user.PageSize, user.FirstIndex);
                        })
                        .Sample(TimeSpan.FromMilliseconds(150))
                        .DistinctUntilChanged();

            var tailer = new FileTailer(fileInfo, filterRequest, scroller);

            //create user display for count line count
            var lineCounter = tailer.TotalLines.CombineLatest(tailer.MatchedLines,(total,matched)=>
            {
                return total == matched
                    ? $"File has {total.ToString("#,###")} lines"
                    : $"Showing {matched.ToString("#,###")} of {total.ToString("#,###")} lines";
            })
            .Subscribe(text => LineCountText=text);

            //load lines into observable collection
            var loader = tailer.Lines.Connect()
                .Transform(line => new LineProxy(line))
                .Sort(SortExpressionComparer<LineProxy>.Ascending(proxy => proxy.Number))
                .ObserveOn(schedulerProvider.MainThread)
                .Bind(out _data)
                .Subscribe(changes => logger.Info($"Rows changed {changes.Adds} adds, {changes.Removes} removed"),
                            ex => logger.Error(ex, "There is a problem with bind data"));

            //monitor matching lines and start index,
            var matchedLinesMonitor = tailer.MatchedLines
                .Subscribe(matched => MatchedLineCount = matched);

            //track first visible index
            var firstIndexMonitor = tailer.Lines.Connect()
                .QueryWhenChanged(lines =>lines.Count == 0 ? 0 : lines.Select(l => l.Index).Min())
                .Subscribe(first=> FirstIndex= first);

            _cleanUp = new CompositeDisposable(tailer,
                lineCounter,
                loader,
                firstIndexMonitor,
                matchedLinesMonitor,
                Disposable.Create(() =>
                {
                    _userScrollRequested.OnCompleted();
                }));
        }
开发者ID:WELL-E,项目名称:TailBlazer,代码行数:56,代码来源:FileTailerViewModel.cs


示例16: DashboardModule

 public DashboardModule(ITypeRegistry typeRegistry, IRegionManager regionManager, ISchedulerProvider schedulerProvider, 
     Func<IProfileActivatorAggregator> profileActivatorAggregatorFactory,
     Func<IProfileDashboardView> profileDashboardViewFactory)
 {
     _typeRegistry = typeRegistry;
     _regionManager = regionManager;
     _schedulerProvider = schedulerProvider;
     _profileActivatorAggregatorFactory = profileActivatorAggregatorFactory;
     _profileDashboardViewFactory = profileDashboardViewFactory;
 }
开发者ID:CallWall,项目名称:CallWall.Windows,代码行数:10,代码来源:DashboardModule.cs


示例17: RealTimeModel

        public RealTimeModel(ISchedulerProvider schProvider, IBikeService bikeService)
        {
            _schProvider = schProvider;
            _bikeService = bikeService;
            _bikeDataSource = new SourceCache<StationDto, string>(bike => bike.Name);
            _all = _bikeDataSource.AsObservableCache();

            var data = GenerateRealTimeData();
            _cleanup = new CompositeDisposable(_all, _bikeDataSource, data);
        }
开发者ID:karlobrien,项目名称:DynamicRealTimeBikes,代码行数:10,代码来源:RealTimeModel.cs


示例18: NearToMarketViewer

 public NearToMarketViewer(INearToMarketService nearToMarketService, ISchedulerProvider schedulerProvider)
 {
     _cleanUp = nearToMarketService.Query(() => NearToMarketPercent) 
         .Transform(trade => new TradeProxy(trade))
         .Sort(SortExpressionComparer<TradeProxy>.Descending(t => t.Timestamp))
         .ObserveOn(schedulerProvider.MainThread)
         .Bind(_data)  
         .DisposeMany() 
         .Subscribe();
 }
开发者ID:TomKearney,项目名称:Dynamic.Trader,代码行数:10,代码来源:NearToMarketViewer.cs


示例19: CrystalQuartzPanelApplication

 public CrystalQuartzPanelApplication(
     ISchedulerProvider schedulerProvider, 
     ISchedulerDataProvider schedulerDataProvider, 
     string customCssUrl) :
     base(Assembly.GetAssembly(typeof(CrystalQuartzPanelApplication)), "CrystalQuartz.Web.Content.")
 {
     _schedulerProvider = schedulerProvider;
     _schedulerDataProvider = schedulerDataProvider;
     _customCssUrl = customCssUrl;
 }
开发者ID:wanglong,项目名称:CrystalQuartz,代码行数:10,代码来源:CrystalQuartzPanelApplication.cs


示例20: PositionsViewer

 public PositionsViewer(ITradeService tradeService, ISchedulerProvider schedulerProvider)
 {
     _cleanUp = tradeService.Live.Connect()
         .Group(trade => trade.CurrencyPair)
         .Transform(group => new CurrencyPairPosition(group))
         .Sort(SortExpressionComparer<CurrencyPairPosition>.Ascending(t => t.CurrencyPair))
         .ObserveOn(schedulerProvider.MainThread)
         .Bind(_data)
         .DisposeMany()
         .Subscribe();
 }
开发者ID:TomKearney,项目名称:Dynamic.Trader,代码行数:11,代码来源:PositionsViewer.cs



注:本文中的ISchedulerProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ISchedulerService类代码示例发布时间:2022-05-24
下一篇:
C# IScheduler类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap