Exemplo n.º 1
0
        /// <summary>
        /// Check whether for the validity of DI Video
        /// </summary>
        /// <returns></returns>
        public bool ValiddiVideo()
        {
            bool Retval = false;

            try
            {
                if (Directory.Exists(this.VideoFolderPath))
                {
                    FileInfo[] VideoFiles = new FileInfo[0];

                    //-- Get the xml files
                    DirectoryInfo VideoDir = new DirectoryInfo(this.VideoFolderPath);
                    VideoFiles = VideoDir.GetFiles("*.xml");

                    foreach (FileInfo ImageFile in VideoFiles)
                    {
                        VideoFrameCollection VideoFrames = VideoFrameCollection.Load(ImageFile.FullName);
                        if (VideoFrames != null)
                        {
                            Retval = true;
                            break;
                        }
                    }
                }
            }
            catch (Exception)
            {
            }
            return(Retval);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Get the first frame of di video
        /// </summary>
        /// <returns></returns>
        public string GetFirstVideoFrame()
        {
            string Retval = string.Empty;

            try
            {
                if (Directory.Exists(this.VideoFolderPath))
                {
                    FileInfo[] VideoFiles = new FileInfo[0];

                    DirectoryInfo VideoDir = new DirectoryInfo(this.VideoFolderPath);
                    VideoFiles = VideoDir.GetFiles("*.xml");

                    //-- Iterate through each of the xml file and get the path of first frame.
                    foreach (FileInfo ImageFile in VideoFiles)
                    {
                        VideoFrameCollection VideoFrames = VideoFrameCollection.Load(ImageFile.FullName);
                        if (VideoFrames != null)
                        {
                            foreach (VideoFrame Frame in VideoFrames)
                            {
                                if (!string.IsNullOrEmpty(Frame.SelectedFilePathWithPath) && File.Exists(Frame.SelectedFilePathWithPath))
                                {
                                    Retval = Frame.SelectedFilePathWithPath;
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception)
            {
            }
            return(Retval);
        }