Пример #1
0
        private DeltaModelManager <IRoot> Build(IDeltaServiceProvider deltaServiceProvider)
        {
            var builder = new DeltaModelBuilder();

            builder.Config <IChannel>(c =>
            {
                c.HasLocal((s, m, p) => new ChannelModel(s, p.Get <IAppEnvironment>(), p.Get <CoreData>(), p.Get <MainTargetsModel>()));
            });

            //builder.Config<IVideoInput>(c =>
            //{
            //    c.HasLocal((s, m, p) => new LocalVideoInputModel(s, this, p.Get<MainSourcesModel>(), p.Get<LocalSettingsService>()));
            //});

            //builder.Config<IAudioInput>(c =>
            //{
            //    c.HasLocal((s, m, p) => new LocalAudioInputModel(s, this, p.Get<MainSourcesModel>()));
            //});

            builder.Config <ISettings>(c =>
            {
                c.Property(s => s.SelectedVideo).DontCompareBeforeSet();
                c.Property(s => s.SelectedAudio).DontCompareBeforeSet();
            });

            builder.Config <IIndicatorCpu>(c => { c.Property(s => s.Load).DontCompareBeforeSet(); });

            builder.Config <IIndicatorCloudIn>(c => { c.Property(s => s.Bitrate).DontCompareBeforeSet(); });
            builder.Config <IIndicatorCloudOut>(c => { c.Property(s => s.Bitrate).DontCompareBeforeSet(); });
            builder.Config <IIndicatorEncoder>(c => c.Property(s => s.Data).DontCompareBeforeSet());

            builder.Config <IIndicatorVpn>(c => { c.Property(s => s.Sent).DontCompareBeforeSet(); });
            builder.Config <IIndicatorVpn>(c => { c.Property(s => s.Received).DontCompareBeforeSet(); });

            return(builder.Build <IRoot>(deltaServiceProvider, new SingleThreadLockerProvider()));
        }
Пример #2
0
        public ModelTest()
        {
            var b = new DeltaModelBuilder();

            b.Config <ILevel2>(c => { c.HasLocal((s, m, p) => new Level2Local(m, s)); });
            _manager1 = b.Build <ITestModel>();

            var b2 = new DeltaModelBuilder();

            b2.Config <ILevel2>(c => { c.HasLocal((s, m, p) => new Level2Local(m, s)); });
            _manager2 = b2.Build <ITestModel>();

            var b3 = new DeltaModelBuilder();

            _manager3 = b3.Build <ITestModel>();

            _modelClient12 = new ModelClient {
                Filter = new FilterConfigurator(true).Build()
            };
            _modelClient21 = new ModelClient {
                Filter = new FilterConfigurator(true).Build()
            };
            _modelClient23 = new ModelClient {
                Filter = new FilterConfigurator(true).Build()
            };
            _modelClient32 = new ModelClient {
                Filter = new FilterConfigurator(true).Build()
            };

            _manager1.Register(_modelClient12);

            _manager2.Register(_modelClient21);
            _manager2.Register(_modelClient23);

            _manager3.Register(_modelClient32);
        }