Пример #1
0
        public void Init(DeviceDescriptionHolder devHolder, NvtSessionFactory sessionFactory, IUnityContainer container)
        {
            this.container = container;
            //Add device section (all devices must have this section)
            parent.Title = devHolder.Name;

            //Display progress bar
            devicePanel.Content = new ProgressView("Loading ...");

            //Begin load device section
            disposables.Add(SectionDevice.Load(devHolder, sessionFactory)
                            .ObserveOnCurrentDispatcher()
                            .Subscribe(
                                args => {
                invtSession = args.nvtSession;

                SectionDevice devView = container.Resolve <SectionDevice>();
                disposables.Add(devView);
                devView.Init(args);
                devicePanel.Content = devView;

                //Load sections
                LoadSections(args);
            },
                                err => {
                ErrorView errorView = new ErrorView(err);
                disposables.Add(errorView);

                devicePanel.Content = errorView;
            }
                                ));
        }
Пример #2
0
        private void GetStreamUri(INvtSession session, Profile profile)
        {
            var streamSetup = new StreamSetup()
            {
                stream    = StreamType.rtpUnicast,
                transport = new Transport()
                {
                    protocol = TransportProtocol.tcp
                }
            };

            disposables.Add(
                session
                .GetStreamUri(streamSetup, profile.token)
                .ObserveOnCurrentDispatcher()
                .Subscribe(
                    muri => {
                videoSize = new Size(profile.videoEncoderConfiguration.resolution.width, profile.videoEncoderConfiguration.resolution.height);
                InitializePlayer(muri.uri.ToString(), credentials, videoSize);
            },
                    err => {
            }
                    )
                );
        }
Пример #3
0
 public NVAButtonBase(IEventAggregator eventAggregator, INvtSession session, Account currentAccount, AnalyticsEngine engine, AnalyticsEngineControl control, IVideoInfo videoInfo = null)
     : base(eventAggregator, session, currentAccount)
 {
     this.engine    = engine;
     this.control   = control;
     this.videoInfo = videoInfo;
 }
Пример #4
0
        IUnityContainer CreateActivityContext(string regionName, INvtSession session, ContentColumn column)
        {
            var container = this.container.CreateChildContainer();

            //create & register view presenter
            var presenter = ViewPresenter.Create(view => {
                var region = regionManager.Regions[regionName];
                //dbg.Assert(column.Content == null);
                column.Content = view;

                return(Disposable.Create(() => {
                    //column.Content = null;
                }));
            });

            container.RegisterInstance <IViewPresenter>(presenter);
            container.RegisterInstance <INvtSession>(session);
            container.RegisterInstance <Dispatcher>(Dispatcher.CurrentDispatcher);

            var app = Application.Current as App;

            if (app != null && app.plugins != null)
            {
                try {
                    foreach (var p in app.plugins)
                    {
                        p.OnDeviceSettingsContextCreated(container);
                    }
                } catch (Exception err) {
                    dbg.Error(err);
                }
            }

            return(container);
        }
Пример #5
0
        private void Init(Model model)
        {
            this.model = model;

            OnCompleted += () => {
                //TODO: release player host
                disposables.Dispose();
                subscription.Dispose();
            };
            this.DataContext = this;
            InitializeComponent();

            Presets = new ObservableCollection <PTZPreset>();

            var ptzInfo = activityContext.container.Resolve <IPtzInfo>();

            CurrentSession = activityContext.container.Resolve <INvtSession>();
            profileToken   = ptzInfo.ProfileToken;

            VideoStartup();

            InitData();
            BindData();
            Localize();
        }
Пример #6
0
 public UserManagerButton(IEventAggregator eventAggregator, INvtSession session, Account currentAccount, string DevModel, string Manufact)
     : base(eventAggregator, session, currentAccount)
 {
     this.devName  = DevModel;
     this.manufact = Manufact;
     Init();
 }
        public override void Load(INvtSession session, Account account) {
            CurrentSession = session;

            //show default log at startup
            subscription.Add(CurrentSession
                .GetSystemLog(SelectedType.type)
                .ObserveOnCurrentDispatcher()
                .Subscribe(syslog =>
                {
                    try
                    {
                        if (syslog == null)
                            return;

                        logDescr.FillData(syslog, SelectedType);
                    }
                    catch (Exception err)
                    {
                        dbg.Error(err);
                    }
                    finally
                    {
                        if (logDescr != null && logDescr.IsReceived)
                            InitData();
                        Current = States.Common;
                    }
                }, err =>
                {
                    dbg.Error(err);
                    Current = States.Common;
                }));

        }
Пример #8
0
        void Reload(INvtSession session)
        {
            var vs = AppDefaults.visualSettings;

            //vidBuff = new VideoBuffer(resolution.Width, resolution.Height);

            var streamSetup = new StreamSetup()
            {
                transport = new Transport()
                {
                    protocol = AppDefaults.visualSettings.Transport_Type
                }
            };

            //TODO: provide a way of cancelation
            //VideoInfo.MediaUri = model.uri;
            //VideoStartup(VideoInfo);
            VideoStartup();

            //subscription.Add(session.GetStreamUri(strSetup, profile.token)
            //	.ObserveOnCurrentDispatcher()
            //	.Subscribe(uri => {
            //		VideoInfo.MediaUri = uri.Uri;
            //		VideoStartup(VideoInfo);
            //	}, err => {
            //	}));
        }
Пример #9
0
            public EventManager(INvtSession session)
            {
                // TODO: Complete member initialization
                this.session = session;

                Run();
            }
Пример #10
0
 public ChannelButtonBase(IEventAggregator eventAggregator, INvtSession session, Account currentAccount, String channelToken, Profile profile, IVideoInfo videoInfo)
     : base(eventAggregator, session, currentAccount)
 {
     this.channelToken = channelToken;
     this.profile      = profile;
     this.videoInfo    = videoInfo;
 }
		public void Init(DeviceDescriptionHolder devHolder, NvtSessionFactory sessionFactory, IUnityContainer container) {
			this.container = container;
			//Add device section (all devices must have this section)
			parent.Title = devHolder.Name;
			
			//Display progress bar
			devicePanel.Content = new ProgressView("Loading ...");

			//Begin load device section
			disposables.Add(SectionDevice.Load(devHolder, sessionFactory)
				.ObserveOnCurrentDispatcher()
				.Subscribe(
					args => {
						invtSession = args.nvtSession;

						SectionDevice devView = container.Resolve<SectionDevice>();
						disposables.Add(devView);
						devView.Init(args);
						devicePanel.Content = devView;

						//Load sections
						LoadSections(args);
					}, 
					err => {
						ErrorView errorView = new ErrorView(err);
						disposables.Add(errorView);

						devicePanel.Content = errorView;
					}
			));

		}
Пример #12
0
 public MaintenanceButton(IEventAggregator eventAggregator, INvtSession session, Account currentAccount, global::onvif.services.Capabilities caps, string DevModel, string Manufact)
     : base(eventAggregator, session, currentAccount)
 {
     this.caps     = caps;
     this.devName  = DevModel;
     this.manufact = Manufact;
     Init();
 }
Пример #13
0
        public ButtonBase(IEventAggregator eventAggregator, INvtSession session, Account currentAccount) {
			this.eventAggregator = eventAggregator;
			this.session = session;
            this.currentAccount = currentAccount;
			InitCommands();
		
			this.Cursor = Cursors.Hand;
		}
Пример #14
0
        public ButtonBase(IEventAggregator eventAggregator, INvtSession session, Account currentAccount)
        {
            this.eventAggregator = eventAggregator;
            this.session         = session;
            this.currentAccount  = currentAccount;
            InitCommands();

            this.Cursor = Cursors.Hand;
        }
Пример #15
0
 public virtual void Init(INvtSession session, String chanToken, string profileToken, Account account, IVideoInfo videoInfo)
 {
     base.CurrentSession = session;
     this.ChannelToken   = chanToken;
     this.profileToken   = profileToken;
     CurrentAccount      = account;
     VideoInfo           = videoInfo;
     Load(session, chanToken, profileToken, account, videoInfo);
 }
Пример #16
0
        public static FSharpAsync <AnalyticsArgs> Load(INvtSession nvtSession, OdmSession odmSession, Capabilities capabilities)
        {
            AnalyticsArgs args = new AnalyticsArgs();

            args.odmSession   = odmSession;
            args.capabilities = capabilities;
            args.nvtSession   = nvtSession;

            return(Apm.Iterate(LoadImpl(args)).Select(f => { return args; }));
        }
Пример #17
0
		public static FSharpAsync<SourceViewArgs> Load(ChannelDescription channelDescr,
														Capabilities capabilities,
														INvtSession nvtSession,
														OdmSession odmsession,
														string prof = null) {
			SourceViewArgs args = new SourceViewArgs();
			args.nvtSession = nvtSession;
			args.odmSession = odmsession;
			args.capabilities = capabilities;
			args.channelDescr = channelDescr;
			args.selectedProfileToken = prof;

			return Apm.Iterate(LoadImpl(args)).Select(f => { return args; });
		}
		public static FSharpAsync<EngineViewArgs> Load(AnalyticsEngine engine,
														Capabilities capabilities,
														INvtSession nvtSession,
														OdmSession odmsession,
														string ctrl = null) {
			EngineViewArgs args = new EngineViewArgs();
			args.nvtSession = nvtSession;
			args.odmSession = odmsession;
			args.capabilities = capabilities;
			args.engine = engine;
			args.selectedEngineControlToken = ctrl;

			return Apm.Iterate(LoadImpl(args)).Select(f => { return args; });
		}
        public static FSharpAsync <EngineViewArgs> Load(AnalyticsEngine engine,
                                                        Capabilities capabilities,
                                                        INvtSession nvtSession,
                                                        OdmSession odmsession,
                                                        string ctrl = null)
        {
            EngineViewArgs args = new EngineViewArgs();

            args.nvtSession   = nvtSession;
            args.odmSession   = odmsession;
            args.capabilities = capabilities;
            args.engine       = engine;
            args.selectedEngineControlToken = ctrl;

            return(Apm.Iterate(LoadImpl(args)).Select(f => { return args; }));
        }
Пример #20
0
        public static FSharpAsync <SourceViewArgs> Load(ChannelDescription channelDescr,
                                                        Capabilities capabilities,
                                                        INvtSession nvtSession,
                                                        OdmSession odmsession,
                                                        string prof = null)
        {
            SourceViewArgs args = new SourceViewArgs();

            args.nvtSession           = nvtSession;
            args.odmSession           = odmsession;
            args.capabilities         = capabilities;
            args.channelDescr         = channelDescr;
            args.selectedProfileToken = prof;

            return(Apm.Iterate(LoadImpl(args)).Select(f => { return args; }));
        }
 public override void Load(INvtSession session, Account account)
 {
     this.session   = session;
     CurrentAccount = account;
     Current        = States.Loading;
     session.GetRelayOutputs()
     .ObserveOnCurrentDispatcher()
     .Subscribe(relayOutputs => {
         relayOutputs.ForEach(x => {
             relays.Add(x);
         });
         Current = States.Common;
     }, err => {
         ErrorMessage  = err.Message;
         ErrorBtnClick = new DelegateCommand(() => { Reload(); });
         Current       = States.Error;
     });
 }
Пример #22
0
        void ManualInitDeviceHolder(INvtSession session, DeviceDescriptionHolder devHolder)
        {
            devHolder.session = session;

            facade = new OdmSession(session);
            var model = new IdentificationModel();

            IdentitySubscriptions.Add(
                facade.GetIdentity(() => model)
                .ObserveOnCurrentDispatcher()
                .Subscribe(mod => {
                devHolder.Init(mod);
            }, err => {
                //dbg.Error(err);
                //MessageBox.Show(err.Message);
            })
                );
        }
        public UpgradeBatchTaskView(IActivityContext <Unit> context)
        {
            this.context = context;

            items         = new ObservableCollection <BatchItem>();
            manufacturers = new ObservableCollection <string>();
            models        = new ObservableCollection <string>();

            CommonList = new List <BatchItem>();
            BatchTaskEventArgs evargs = context.container.Resolve <BatchTaskEventArgs>();

            nvtSession = evargs.session;;

            evargs.Devices.ForEach(dev => {
                BatchItem bitem        = new BatchItem(dev);
                bitem.PropertyChanged += new PropertyChangedEventHandler((object sender, PropertyChangedEventArgs e) => {
                    CanUpgrade();
                });
                CommonList.Add(bitem);
            });

            this.CommandBindings.Add(
                new CommandBinding(
                    UpgradeBatchTaskView.UpgradeCommand,
                    (s, a) => {
                OnUpgrade();
            }
                    )
                );

            this.CommandBindings.Add(
                new CommandBinding(
                    UpgradeBatchTaskView.CancelCommand,
                    (s, a) => {
                Success();
            }
                    )
                );

            InitializeComponent();

            BindData();
            Localization();
        }
Пример #24
0
        public RestoreBatchTaskView(IActivityContext <Unit> context)
        {
            this.activityContext = context;

            items         = new ObservableCollection <BatchItem>();
            manufacturers = new ObservableCollection <string>();
            models        = new ObservableCollection <string>();
            firmwares     = new ObservableCollection <string>();

            CommonList = new List <BatchItem>();
            BatchTaskEventArgs evargs = context.container.Resolve <BatchTaskEventArgs>();

            nvtSession = evargs.session;
            ;

            evargs.Devices.ForEach(dev => {
                BatchItem bitem = new BatchItem(dev);
                CommonList.Add(bitem);
            });

            this.CommandBindings.Add(
                new CommandBinding(
                    RestoreBatchTaskView.RestoreCommand,
                    (s, a) => {
                OnRestore();
            }
                    )
                );

            this.CommandBindings.Add(
                new CommandBinding(
                    RestoreBatchTaskView.CancelCommand,
                    (s, a) => {
                Success();
            }
                    )
                );

            InitializeComponent();

            BindData();
            Localization();
        }
Пример #25
0
 private void GetProfiles(INvtSession session)
 {
     disposables.Add(
         session
         .GetProfiles()
         .ObserveOnCurrentDispatcher()
         .Subscribe(
             profs => {
         var profile = profs.FirstOrDefault();
         if (profile != null)
         {
             GetStreamUri(session, profile);
         }
     },
             err => {
     }
             )
         );
 }
 private void GetPtzConfiguration(INvtSession session, Profile profile)
 {
     disposables.Add(
         session
         .GetNode(nodeToken)
         .ObserveOnCurrentDispatcher()
         .Subscribe(
             node =>
     {
         if (node != null)
         {
             panTiltSpace = node.supportedPTZSpaces.continuousPanTiltVelocitySpace.FirstOrDefault();
         }
     },
             err =>
     {
     }
             )
         );
 }
Пример #27
0
 void GetProfiles(INvtSession session)
 {
     //Every video source can have it's own profiles
     disposables.Add(session.GetProfiles()
                     .ObserveOnCurrentDispatcher()
                     .Subscribe(
                         profs => {
         var selectedProfile = profs.FirstOrDefault();
         if (selectedProfile == null)
         {
             //Device vave not any profiles
             errBox.Text = "Profile is empty";
         }
         else
         {
             GetStreamUri(session, selectedProfile);
         }
     }, err => {
         errBox.Text = err.Message;
     }));
 }
Пример #28
0
        void InitDeviceHolder(INvtSession session, DeviceDescriptionHolder devHolder, bool publish)
        {
            devHolder.session = session;
            facade            = new OdmSession(session);
            var model = new IdentificationModel();

            IdentitySubscriptions.Add(
                facade.GetIdentity(() => model)
                .ObserveOnCurrentDispatcher()
                .Subscribe(mod => {
                devHolder.Init(mod);
                if (publish)
                {
                    DeviceSelectedPublish(devHolder, sessionFactory);
                }
            }, err => {
                //dbg.Error(err);
                //MessageBox.Show(err.Message);
            })
                );
        }
Пример #29
0
        void GetStreamUri(INvtSession session, onvif.services.Profile prof)
        {
            var srtSetup = new StreamSetup()
            {
                stream    = StreamType.rtpUnicast,
                transport = new Transport()
                {
                    protocol = TransportProtocol.udp
                }
            };

            //Get stream uri for selected profile
            disposables.Add(session.GetStreamUri(srtSetup, prof.token)
                            .ObserveOnCurrentDispatcher()
                            .Subscribe(
                                muri => {
                Size videosize = new Size(prof.videoEncoderConfiguration.resolution.width, prof.videoEncoderConfiguration.resolution.height);

                InitPlayer(muri.uri.ToString(), account, videosize);
            }, err => {
                errBox.Text = err.Message;
            }));
        }
Пример #30
0
        public ChannelViewModel(INvtSession session, ChannelDescription channelDescr, IUnityContainer container, Capabilities devcap)
        {
            this.eventAggregator = container.Resolve <IEventAggregator>();
            this.devcap          = devcap;
            UIsubscription       = eventAggregator.GetEvent <VideoChangedEvent>().Subscribe(VideoChangedEvent, false);
            RefreshSubscription  = eventAggregator.GetEvent <RefreshSelection>().Subscribe(RefreshSelection, false);
            ProfileSubscription  = eventAggregator.GetEvent <ProfileChangedEvent>().Subscribe(ProfileChangedEvent, false);
            this.videoSource     = channelDescr.videoSource;
            this.session         = session;
            this.container       = container;
            Buttons = new ObservableCollection <ButtonBase>();
            Name    = InfoStrings.loadingData;

            SnapShotClick = new DelegateCommand(() => {
                if (profToken != null)
                {
                    GetSnapshot(profToken);
                }
            });

            BindData();
            Load();
        }
        private void GetProfiles(INvtSession session)
        {
            disposables.Add(
                session
                .GetProfiles()
                .ObserveOnCurrentDispatcher()
                .Subscribe(
                    profs => {
                profile = profs.FirstOrDefault();
                if (profile != null)
                {
                    profileToken = profile.token;
                    nodeToken    = profile.ptzConfiguration.nodeToken;

                    GetPtzConfiguration(session, profile);
                    GetStreamUri(session, profile);
                }
            },
                    err => {
            }
                    )
                );
        }
        public override void Load(INvtSession session, Account account)
        {
            CurrentSession = session;

            //show default log at startup
            subscription.Add(CurrentSession
                             .GetSystemLog(SelectedType.type)
                             .ObserveOnCurrentDispatcher()
                             .Subscribe(syslog =>
            {
                try
                {
                    if (syslog == null)
                    {
                        return;
                    }

                    logDescr.FillData(syslog, SelectedType);
                }
                catch (Exception err)
                {
                    dbg.Error(err);
                }
                finally
                {
                    if (logDescr != null && logDescr.IsReceived)
                    {
                        InitData();
                    }
                    Current = States.Common;
                }
            }, err =>
            {
                dbg.Error(err);
                Current = States.Common;
            }));
        }
        //public ObservableCollection<MetadataUnit> MetaData { get; set; }

        void Reload(INvtSession session)
        {
            var vs = AppDefaults.visualSettings;

            StreamSetup strSetup = new StreamSetup()
            {
                stream    = StreamType.rtpUnicast,
                transport = new Transport()
                {
                    protocol = vs.Transport_Type,
                    tunnel   = null
                }
            };

            //TODO: provide a way of cancelation
            //try {
            //	var streamInfo = await session.GetStreamUri(strSetup, profile.token);
            //	VideoInfo.MediaUri = streamInfo.uri;
            //	VideoStartup(VideoInfo);
            //} catch (Exception err) {
            //	dbg.Error(err);
            //	throw;
            //}

            subscription.Add(
                session.GetStreamUri(strSetup, profile.token)
                .ObserveOnCurrentDispatcher()
                .Subscribe(
                    uri => {
                VideoInfo.MediaUri = uri.uri;
                VideoStartup(VideoInfo);
            },
                    err => {
            }
                    )
                );
        }
        //private void VideoNewFrame(object sender, NewFrameEventArgs eventArgs)
        //{
        //    // get new frame
        //    Bitmap bitmap = eventArgs.Frame;
        //    // process the frame
        //}

        private void Connect()
        {
            if (!string.IsNullOrEmpty(user))
            {
                credentials = new NetworkCredential(user, password);
            }

            var factory = new NvtSessionFactory(credentials);

            disposables.Add(
                factory
                .CreateSession(new Uri[] { new Uri(cameraUrl) })
                .ObserveOnCurrentDispatcher()
                .Subscribe(
                    session => {
                this.session = session;

                GetProfiles(session);
            },
                    err => {
            }
                    )
                );
        }
Пример #35
0
        public MaintenanceButton(IEventAggregator eventAggregator, INvtSession session, Account currentAccount, global::onvif.services.Capabilities caps, string DevModel, string Manufact)
            : base(eventAggregator, session, currentAccount) {
                this.caps = caps;
				this.devName = DevModel;
				this.manufact = Manufact;
                Init();
        }
Пример #36
0
        public DeviceEventsButton(IEventAggregator eventAggregator, ObservableCollection<FilterExpression> filters, EventsStorage events, INvtSession session, Account currentAccount)
            : base(eventAggregator, session, currentAccount) {
            Init();
            this.events = events;
			this.filters = filters;
        }
Пример #37
0
 public ActionTriggersButton(IEventAggregator eventAggregator, INvtSession session, Account currentAccount)
     : base(eventAggregator, session, currentAccount) {
     Init();
 }
		public override void Load(INvtSession session, Account account) {
			Current = States.Common;
		}
		//public ObservableCollection<MetadataUnit> MetaData { get; set; }

		void Reload(INvtSession session) {
			var vs = AppDefaults.visualSettings;

			StreamSetup strSetup = new StreamSetup() {
				stream = StreamType.rtpUnicast,
				transport = new Transport(){
					protocol = vs.Transport_Type,
					tunnel = null
				}
			};

			//TODO: provide a way of cancelation
			//try {
			//	var streamInfo = await session.GetStreamUri(strSetup, profile.token);
			//	VideoInfo.MediaUri = streamInfo.uri;
			//	VideoStartup(VideoInfo);
			//} catch (Exception err) {
			//	dbg.Error(err);
			//	throw;
			//}

			subscription.Add(
				session.GetStreamUri(strSetup, profile.token)
				.ObserveOnCurrentDispatcher()
				.Subscribe(
					uri => {
						VideoInfo.MediaUri = uri.uri;
						VideoStartup(VideoInfo);
					}, 
					err => {
					}
				)
			);
		}
Пример #40
0
 public XMLExplorerButton(IEventAggregator eventAggregator, INvtSession session, Account currentAccount)
     : base(eventAggregator, session, currentAccount) {
     Init();
 }
Пример #41
0
		public NVASettingsButton(IEventAggregator eventAggregator, INvtSession session, AnalyticsEngine engine, AnalyticsEngineControl control, Account currentAccount, IVideoInfo videoInfo = null)
			: base(eventAggregator, session, currentAccount, engine, control, videoInfo) {
			Init();
		}
		public void Init(INvtSession session, Account account, SysLogDescriptor slogdescr) {
            logDescr = slogdescr;
            base.Init(session, account);
		}
Пример #43
0
 public abstract void Load(INvtSession session, String chanToken, string profileToken, Account account, IVideoInfo videoInfo);
Пример #44
0
        public ChannelButtonBase(IEventAggregator eventAggregator, INvtSession session, Account currentAccount, String channelToken, Profile profile, IVideoInfo videoInfo)
            : base(eventAggregator, session, currentAccount) {
            this.channelToken = channelToken;
            this.profile = profile;
            this.videoInfo = videoInfo;
	    }
		void Reload(INvtSession session) {
			var vs = AppDefaults.visualSettings;

			//vidBuff = new VideoBuffer(resolution.Width, resolution.Height);

			var streamSetup = new StreamSetup() {
				transport = new Transport() {
					protocol = AppDefaults.visualSettings.Transport_Type
				}
			};

			//TODO: provide a way of cancelation
			//VideoInfo.MediaUri = model.uri;
			//VideoStartup(VideoInfo);
			VideoStartup();

			//subscription.Add(session.GetStreamUri(strSetup, profile.token)
			//	.ObserveOnCurrentDispatcher()
			//	.Subscribe(uri => {
			//		VideoInfo.MediaUri = uri.Uri;
			//		VideoStartup(VideoInfo);
			//	}, err => {
			//	}));
		}
Пример #46
0
        public SystemLogButton(IEventAggregator eventAggregator, INvtSession session, Account currentAccount, SysLogDescriptor slog)
            : base(eventAggregator, session, currentAccount) {
				this.slog = slog;
				Init();
        }
Пример #47
0
		public VideoStreamingButton(IEventAggregator eventAggregator, INvtSession session, String channelToken, Profile profile, Account currentAccount, IVideoInfo videoInfo)
            : base(eventAggregator, session, currentAccount, channelToken, profile, videoInfo) {
            Init();
        }
Пример #48
0
 public NetworkButton(IEventAggregator eventAggregator, INvtSession session, Account currentAccount)
     : base(eventAggregator, session, currentAccount) {
     Init();
 }
Пример #49
0
		public UITestButton(IEventAggregator eventAggregator, INvtSession session, String channelToken, Profile profile, Account currentAccount, IVideoInfo videoInfo)
			: base(eventAggregator, session, currentAccount, channelToken, profile, videoInfo) {
			this.profile = profile;
			Init();
		}
		IUnityContainer CreateActivityContext(string regionName, INvtSession session, ContentColumn column) {
			var container = this.container.CreateChildContainer();

			//create & register view presenter
			var presenter = ViewPresenter.Create(view => {
				var region = regionManager.Regions[regionName];
				//dbg.Assert(column.Content == null);
				column.Content = view;

				return Disposable.Create(() => {
					//column.Content = null;
				});
			});
			container.RegisterInstance<IViewPresenter>(presenter);
			container.RegisterInstance<INvtSession>(session);
			container.RegisterInstance<Dispatcher>(Dispatcher.CurrentDispatcher);

			var app = Application.Current as App;
			if (app != null && app.plugins != null) {
				try {
					foreach (var p in app.plugins) {
						p.OnDeviceSettingsContextCreated(container);
					}
				} catch (Exception err) {
					dbg.Error(err);
				}
			}

			return container;
		}
Пример #51
0
		public UserManagerButton(IEventAggregator eventAggregator, INvtSession session, Account currentAccount, string DevModel, string Manufact)
			: base(eventAggregator, session, currentAccount) {
			this.devName = DevModel;
			this.manufact = Manufact;
            Init();
        }
Пример #52
0
		public StreamInfoArgs(INvtSession nvtSession) {
			this.nvtSession = nvtSession;
		}
Пример #53
0
        public IdentificationButton(IEventAggregator eventAggregator, INvtSession session, Account currentAccount)
			: base(eventAggregator, session, currentAccount) {
			Init();
		}
Пример #54
0
        public DeviceButtonBase(IEventAggregator eventAggregator, INvtSession session, Account currentAccount)
            : base(eventAggregator, session, currentAccount) {
	    }
		public static FSharpAsync<SourcesArgs> Load(INvtSession nvtSession, OdmSession odmSession, Capabilities capabilities) {
			SourcesArgs args = new SourcesArgs();
			args.odmSession = odmSession;
			args.capabilities = capabilities;
			args.nvtSession = nvtSession;

			return Apm.Iterate(LoadImpl(args)).Select(f => { return args; });
		}
		public override void Load(INvtSession session, Account account) {
			this.session = session;
			CurrentAccount = account;
			Current = States.Loading;
			session.GetRelayOutputs()
				.ObserveOnCurrentDispatcher()
				.Subscribe(relayOutputs => {
					relayOutputs.ForEach(x => {
						relays.Add(x);
					});
					Current = States.Common;
				}, err => {
					ErrorMessage = err.Message;
					ErrorBtnClick = new DelegateCommand(() => { Reload(); });
					Current = States.Error;
				});
		}
Пример #57
0
		public NVAButtonBase(IEventAggregator eventAggregator, INvtSession session, Account currentAccount, AnalyticsEngine engine, AnalyticsEngineControl control, IVideoInfo videoInfo = null)
            : base(eventAggregator, session, currentAccount) {
            this.engine = engine;
            this.control = control;
            this.videoInfo = videoInfo;
	    }