Пример #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();
        }
Пример #2
0
        private void CtlMostWatchedVideo_Click(object sender, EventArgs e)
        {
            try
            {
                _skipNodeSelection = true;
                CustomeThumbControl ctl = sender as CustomeThumbControl;
                // Find index of currently selected video in list.
                List <VideoInfo> nextVideoList     = new List <VideoInfo>();
                List <VideoInfo> previousVideoList = new List <VideoInfo>();

                this.treeView1.SelectedNode = this.SelectedNode = FindVideoParentTreeNode(ctl.VideoUrl);

                CreatePreviousAndNextPlaylist(_mostWatchedVideos, ctl.VideoUrl, out nextVideoList, out previousVideoList);

                frmUpCommingVideo upcomingVideoForm = (CommonAppStateDataHelper.FindFormByFormType("frmUpCommingVideo") as frmUpCommingVideo);
                if (upcomingVideoForm == null)
                {
                    upcomingVideoForm = new frmUpCommingVideo();
                }
                upcomingVideoForm.ParentFormControl     = this;
                upcomingVideoForm.ClientInfoObject      = this.ClientInfoObject;
                upcomingVideoForm.EncryptedVideo        = false;
                upcomingVideoForm.NextVideoFileList     = nextVideoList;
                upcomingVideoForm.PreviousVideoFileList = previousVideoList;
                upcomingVideoForm.CurrentVideoInfo      = ctl.ThumbnailInformation; //  new VideoInfo() { VideoName = ctl.ThumbnailInformation.VideoName, ThumbnailFilePath = ctl.ThumbnailInformation.ThumbnailFilePath, VideoFullUrl = ctl.ThumbnailInformation.VideoFullUrl };
                upcomingVideoForm.EncryptedVideo        = true;
                upcomingVideoForm.SelectedNode          = this.treeView1.SelectedNode;
                upcomingVideoForm.DashboardFormControl  = this;
                upcomingVideoForm.Show();
                this.Hide();
            }
            finally
            {
                _skipNodeSelection = false;
            }
        }
Пример #3
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;
        }