コード例 #1
0
        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;
                }));

        }
コード例 #2
0
        public ButtonBase(IEventAggregator eventAggregator, INvtSession session, Account currentAccount) {
			this.eventAggregator = eventAggregator;
			this.session = session;
            this.currentAccount = currentAccount;
			InitCommands();
		
			this.Cursor = Cursors.Hand;
		}
コード例 #3
0
        void InitAccounts() {
            IsNotApply = true;
            Accounts.Clear();

            anonymous = new Account();
            anonymous.Name = "<Anonymous>";
            Accounts.Add(anonymous);
            AccountManager.Load().ForEach(x => Accounts.Add(x));

            try {
                var curaccount = AccountManager.CurrentAccount;
                if (curaccount == null)
                    CurrentAccount = anonymous;
                else {
                    Accounts.ForEach(x => {
                        if (x.Name == curaccount.Name && x.Password == curaccount.Password)
                            CurrentAccount = x;
                    });
                }
            } catch (Exception err) {
                dbg.Error(err);
            }
        }
コード例 #4
0
        public SystemLogButton(IEventAggregator eventAggregator, INvtSession session, Account currentAccount, SysLogDescriptor slog)
            : base(eventAggregator, session, currentAccount) {
				this.slog = slog;
				Init();
        }
コード例 #5
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();
        }
コード例 #6
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;
        }
コード例 #7
0
 public ActionTriggersButton(IEventAggregator eventAggregator, INvtSession session, Account currentAccount)
     : base(eventAggregator, session, currentAccount) {
     Init();
 }
コード例 #8
0
 public void SetCurrentAccount(Account account, bool remember)
 {
     this.CurrentAccount = account;
     Save(remember ? account : Account.Anonymous);
 }
コード例 #9
0
		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;
				});
		}
コード例 #10
0
		public VideoStreamingButton(IEventAggregator eventAggregator, INvtSession session, String channelToken, Profile profile, Account currentAccount, IVideoInfo videoInfo)
            : base(eventAggregator, session, currentAccount, channelToken, profile, videoInfo) {
            Init();
        }
コード例 #11
0
		public NVASettingsButton(IEventAggregator eventAggregator, INvtSession session, AnalyticsEngine engine, AnalyticsEngineControl control, Account currentAccount, IVideoInfo videoInfo = null)
			: base(eventAggregator, session, currentAccount, engine, control, videoInfo) {
			Init();
		}
コード例 #12
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;
	    }
コード例 #13
0
        public DeviceButtonBase(IEventAggregator eventAggregator, INvtSession session, Account currentAccount)
            : base(eventAggregator, session, currentAccount) {
	    }
コード例 #14
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;
	    }
コード例 #15
0
		public void Init(INvtSession session, Account account, SysLogDescriptor slogdescr) {
            logDescr = slogdescr;
            base.Init(session, account);
		}
コード例 #16
0
 public NetworkButton(IEventAggregator eventAggregator, INvtSession session, Account currentAccount)
     : base(eventAggregator, session, currentAccount) {
     Init();
 }
コード例 #17
0
 public XMLExplorerButton(IEventAggregator eventAggregator, INvtSession session, Account currentAccount)
     : base(eventAggregator, session, currentAccount) {
     Init();
 }
コード例 #18
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();
		}
コード例 #19
0
		public override void Load(INvtSession session, Account account) {
			Current = States.Common;
		}
コード例 #20
0
		public UserManagerButton(IEventAggregator eventAggregator, INvtSession session, Account currentAccount, string DevModel, string Manufact)
			: base(eventAggregator, session, currentAccount) {
			this.devName = DevModel;
			this.manufact = Manufact;
            Init();
        }
コード例 #21
0
        public IdentificationButton(IEventAggregator eventAggregator, INvtSession session, Account currentAccount)
			: base(eventAggregator, session, currentAccount) {
			Init();
		}
コード例 #22
0
 private void Save(Account account)
 {
     try
     {
         if (File.Exists(settingsPath))
             File.Delete(settingsPath);
         
         using (var sr = File.CreateText(settingsPath))
         {
             XmlSerializer serializer = new XmlSerializer(typeof(Account));
             serializer.Serialize(sr, account);
         }
     }
     catch (Exception err)
     {
         dbg.Error(err);
     }
 }