Пример #1
0
 public static UserSessionService GetInstance()
 {
     if (userSessionService_ == null)
     {
         userSessionService_ = new UserSessionService();
     }
     return(userSessionService_);
 }
Пример #2
0
 public async Task UpdatePreviewPictureSettings(NvrCompressionSettings compressionSettings)
 {
     await Task.Factory.StartNew(() => {
         try {
             NvrSettings nvrSettings = new NvrSettings(UserSessionService.GetInstance().NvrUserSession, true);
             nvrSettings.UpdateStreamCompressionSettings(compressionSettings);
         } catch (NvrSdkException ex) {
             logNvrSdkExceprtion(ex);
             throw new SystemException("NvrController: UpdateStreamCompressionSettings failed", ex);
         } catch (Exception ex) {
             logException(ex);
             throw new SystemException("Exception: UpdateStreamCompressionSettings failed", ex);
         }
     }, TaskCreationOptions.AttachedToParent);
 }
Пример #3
0
 public async Task <NvrCompressionSettings> LoadPreviewPictureSettings()
 {
     return(await Task <NvrCompressionSettings> .Factory.StartNew(() => {
         try {
             NvrSettings nvrSettings = new NvrSettings(UserSessionService.GetInstance().NvrUserSession, true);
             return nvrSettings.LoadStreamCompressionSettings();
         } catch (NvrSdkException ex) {
             logNvrSdkExceprtion(ex);
             throw new SystemException("NvrController: LoadStreamCompressionSettings failed", ex);
         } catch (Exception ex) {
             logException(ex);
             throw new SystemException("Exception: LoadStreamCompressionSettings failed", ex);
         }
     }, TaskCreationOptions.AttachedToParent));
 }
Пример #4
0
 public void StartLiveView(IntPtr playWndHandle)
 {
     try {
         nvrLivePlayer_ = new NvrLivePlayer(UserSessionService.GetInstance().NvrUserSession, true);
         nvrLivePlayer_.DrawOnPictureHandle += drawSomething;
         nvrLivePlayer_.OnPreviewError      += onPreviewError;
         nvrLivePlayer_.StartPreview(playWndHandle, NvrPreviewSettings);
     } catch (NvrSdkException ex) {
         logNvrSdkExceprtion(ex);
         throw new SystemException("NvrController: StartPreview failed", ex);
     } catch (Exception ex) {
         logException(ex);
         throw new SystemException("NvrController: StartPreview failed", ex);
     }
 }
Пример #5
0
 public PlaybackService()
 {
     nvrPlayback_ = new NvrPlayback(UserSessionService.GetInstance().NvrUserSession, true);
 }
Пример #6
0
 public BookmarkService()
 {
     nvrRecordLabels_ = new NvrRecordLabels(UserSessionService.GetInstance().NvrUserSession, true);
 }