Exemple #1
0
        /// ------------------------------------------------------------------------------------
        public override void SetComponentFile(ComponentFile file)
        {
            _buttonPlay.Enabled = false;

            if (_file != file || _isFirstTimeActivated)
            {
                if (AssociatedComponentFile != null)
                {
                    AssociatedComponentFile.PreGenerateOralAnnotationFileAction  = null;
                    AssociatedComponentFile.PostGenerateOralAnnotationFileAction = null;
                }

                base.SetComponentFile(file);

                var finfo = new FileInfo(_file.PathToAnnotatedFile);
                if (finfo.Exists && finfo.Length > 0)
                {
                    LoadFileAndResetUI();                     // If it's length is 0, it will get loaded after generating below.
                }
                file.PreDeleteAction = () =>
                                       _oralAnnotationWaveViewer.CloseAudioStream();
                AssociatedComponentFile.PreGenerateOralAnnotationFileAction = () =>
                                                                              _oralAnnotationWaveViewer.CloseAudioStream();
                AssociatedComponentFile.PostGenerateOralAnnotationFileAction = HandleOralAnnotationFileGenerated;
            }

            file.GenerateOralAnnotationFile(this, ComponentFile.GenerateOption.GenerateIfNeeded);

            _buttonHelp.Enabled = true;
        }