Exemple #1
0
        private void OpenVideoLibrary(TreeNode selectedNode)
        {
            frmVideoLibrary frmVideoLibrary = new frmVideoLibrary();

            frmVideoLibrary.ParentFormControl    = this;
            frmVideoLibrary.DashboardFormControl = this;
            frmVideoLibrary.ClientInfoObject     = this.ClientInfoObject;
            frmVideoLibrary.SelectedNode         = selectedNode;
            frmVideoLibrary.Show();
            CommonAppStateDataHelper.AddForm(this);
            this.Hide();
        }
Exemple #2
0
        private void OnAfterAuthentication()
        {
            // Add mac address in firebase database.
            if (_firebaseRegInfo != null && _firebaseRegInfo.MacAddresses.Contains(_currentMacAddress) == false)
            {
                _firebaseRegInfo.MacAddresses.Add(_currentMacAddress);
                UpdateRegInfo(_firebaseRegInfo);
            }

            SessionInfo sessionInfo = new SessionInfo();

            sessionInfo.StartTime           = DateTime.Now;
            _clientInfo.LastAccessStartTime = DateTime.Now;
            _clientInfo.LastAccessEndTime   = DateTime.Now;
            _clientInfo.SessionList.Add(sessionInfo);

            if (string.IsNullOrEmpty(_clientInfo.MacAddress))
            {
                _clientInfo.MacAddress = _currentMacAddress;
            }

            for (int i = 0; i < _clientInfo.VideoInfoList.Count; i++)
            {
                if (Path.Combine(ClientHelper.GetClientRootPath(), _clientInfo.VideoInfoList[i].VideoRelativeUrl).Equals(_clientInfo.VideoInfoList[i].VideoFullUrl) == false)
                {
                    _clientInfo.VideoInfoList[i].VideoFullUrl = Path.Combine(ClientHelper.GetClientRootPath(), _clientInfo.VideoInfoList[i].VideoRelativeUrl);
                    // Nitin Start
                    _clientInfo.VideoInfoList[i].ThumbnailFilePath = ThumbnailHelper.GetThumbnailFilePathByVideoPath(_clientInfo.VideoInfoList[i].VideoFullUrl);
                    // Nitin End
                }
            }

            FileInfo clientInfoFileInfo = new FileInfo(ClientHelper.GetClientInfoFilePath());

            try
            {
                clientInfoFileInfo.Attributes &= ~FileAttributes.Hidden;
                // this.ClientInfoObject.LastAccessStartTime = DateTime.UtcNow;
                Cryptograph.EncryptObject(_clientInfo, ClientHelper.GetClientInfoFilePath());
                clientInfoFileInfo.Attributes |= FileAttributes.Hidden;
            }
            catch (Exception ex)
            {
                ExceptionHandler.HandleException(ex);
                throw;
            }
            finally
            {
                clientInfoFileInfo.Attributes |= FileAttributes.Hidden;
            }

            frmDashboard frm = new frmDashboard();

            // frm.MdiParent = this.MdiParent;
            frm.ParentFormControl = this;
            frm.ClientInfoObject  = CommonAppStateDataHelper.ClientInfoObject;
            CommonAppStateDataHelper.AddForm(this);
            frm.Show();
            this.Hide();
            CommonAppStateDataHelper.LoggedIn = true;
        }