public VideoRecordingSucceedsWithCameraOnly(
     VideoRecording aVideoRecording,
     VideoCamera aCamera)
 {
     videoRecording = aVideoRecording;
     camera         = aCamera;
 }
 public VideoRecordingSucceedsWithCameraAndMicrophone(
     VideoRecording aVideoRecording,
     VideoCamera aCamera,
     Microphone aMicrophone)
 {
     videoRecording = aVideoRecording;
     camera = aCamera;
     microphone = aMicrophone;
 }
 public VideoRecordingFailsWithoutCamera(
     VideoRecording aVideoRecording,
     VideoCamera aCamera,
     Microphone aMicrophone)
 {
     videoRecording = aVideoRecording;
     camera = aCamera;
     microphone = aMicrophone;
 }
 public VideoRecordingSucceedsWithCameraAndMicrophone(
     VideoRecording aVideoRecording,
     VideoCamera aCamera,
     Microphone aMicrophone)
 {
     videoRecording = aVideoRecording;
     camera         = aCamera;
     microphone     = aMicrophone;
 }
 public VideoRecordingFailsWithoutCamera(
     VideoRecording aVideoRecording,
     VideoCamera aCamera,
     Microphone aMicrophone)
 {
     videoRecording = aVideoRecording;
     camera         = aCamera;
     microphone     = aMicrophone;
 }
Example #6
0
        private void PlayVideo(bool isnew = true)
        {
            ReturnRepetition re    = (ReturnRepetition)gridView1.GetRow(gridView1.FocusedRowHandle);
            VideoPlay        play  = new VideoPlay();
            List <VideoPlay> plays = new List <VideoPlay>();

            if (isnew)
            {
                play = VideoData.GetIndexVideoInfo(re.ID);
                plays.Add(play);
            }
            else
            {
                if (re.DuplicateId == 0)
                {
                    return;
                }
                play = VideoData.GetIndexVideoInfo(re.DuplicateId);
                foreach (var item in re.Duplicates)
                {
                    VideoPlay video = VideoData.GetIndexVideoInfo(item.Id);
                    plays.Add(video);
                }
            }
            if (play == null)
            {
                MessageBox.Show("不存在该视频或者已经被删除");
                return;
            }
            VideoRecording recording = new VideoRecording(play, plays);

            if (play == null || play.Uri == null)
            {
                return;
            }
            if (File.Exists(AppSettings.ReturnStringUrl(Methods.ConversionString(play.Uri))))
            {
                recording.Show();
                Program.log.Error($"打开{AppSettings.ReturnStringUrl(Methods.ConversionString(play.Uri))}", new Exception("打开成功"));
            }
            else
            {
                DialogResult MsgBoxResult = MessageBox.Show("指定目录没有找到该视频,是否继续标注", "提示", MessageBoxButtons.YesNo,
                                                            MessageBoxIcon.Information, MessageBoxDefaultButton.Button2);
                if (MsgBoxResult != DialogResult.Yes)
                {
                    return;
                }
                recording.Show();
                Program.log.Error($"打开{AppSettings.ReturnStringUrl(Methods.ConversionString(play.Uri))}", new Exception("没有找到视频"));
            }
        }
                public static VideoRecording FromBaseObject(BaseObject baseObj)
                {
                    if (baseObj == null || baseObj.NativeObject == IntPtr.Zero)
                    {
                        return(null);
                    }
                    VideoRecording obj = baseObj as  VideoRecording;

                    if (object.Equals(obj, null))
                    {
                        obj = new VideoRecording(CreatedWhenConstruct.CWC_NotToCreate);
                        obj.BindNativeObject(baseObj.NativeObject, "VideoRecording");
                        obj.IncreaseCast();
                    }

                    return(obj);
                }
Example #8
0
 public VideoRecording ProcessAndValidate(VideoRecording instance, out List <Exception> exceptions, out bool shouldSuppressProcessing)
 {
     ProcessAndValidateCommon(instance, out exceptions, out shouldSuppressProcessing);
     return(instance);
 }
                public BaseObject Create()
                {
                    VideoRecording emptyInstance = new VideoRecording(CreatedWhenConstruct.CWC_NotToCreate);

                    return(emptyInstance);
                }
        /// <summary>
        /// Performs a JSON-to-Object conversion.
        /// </summary>
        /// <param name="reader">
        /// A JsonReader object.
        /// </param>
        /// <param name="objectType">
        /// The type of the object.
        /// </param>
        /// <param name="existingValue">
        /// The existing value.
        /// </param>
        /// <param name="serializer">
        /// A JsonSerializer object.
        /// </param>
        /// <returns>
        /// A converted object.
        /// </returns>
        public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
        {
            const string ITEM_TYPE_KEY     = "ItemType";
            const string ARGUMENT_EXCEPTON = "Invalid Or Missing ItemType";

            ContentItem contentItem = null;
            ItemType    itemType    = ItemType.Unknown;

            JObject jObject = JObject.Load(reader);
            JToken  jToken  = null;

            if (jObject.TryGetValue(ITEM_TYPE_KEY, StringComparison.CurrentCultureIgnoreCase, out jToken) && jToken != null && Enum.TryParse(jToken.Value <string>(), true, out itemType))
            {
                switch (itemType)
                {
                case ItemType.Unknown:
                    throw new ArgumentException(ARGUMENT_EXCEPTON);

                case ItemType.Book:
                    contentItem = new Book();
                    break;

                case ItemType.Chapter:
                    contentItem = new Chapter();
                    break;

                case ItemType.Journal:
                    contentItem = new Journal();
                    break;

                case ItemType.Magazine:
                    contentItem = new Magazine();
                    break;

                case ItemType.Newspaper:
                    contentItem = new Newspaper();
                    break;

                case ItemType.Webpage:
                    contentItem = new Webpage();
                    break;

                case ItemType.Encyclopedia:
                    contentItem = new Encyclopedia();
                    break;

                case ItemType.Graphic:
                    contentItem = new Graphic();
                    break;

                case ItemType.AudioRecording:
                    contentItem = new AudioRecording();
                    break;

                case ItemType.VideoRecording:
                    contentItem = new VideoRecording();
                    break;

                case ItemType.Broadcast:
                    contentItem = new Broadcast();
                    break;

                case ItemType.PersonalCommunication:
                    contentItem = new PersonalCommunication();
                    break;

                case ItemType.Interview:
                    contentItem = new Interview();
                    break;

                case ItemType.Presentation:
                    contentItem = new Presentation();
                    break;

                case ItemType.Map:
                    contentItem = new Map();
                    break;

                case ItemType.Bill:
                    contentItem = new Bill();
                    break;

                case ItemType.Legislation:
                    contentItem = new Legislation();
                    break;

                case ItemType.LegalCase:
                    contentItem = new LegalCase();
                    break;

                case ItemType.Report:
                    contentItem = new Report();
                    break;

                case ItemType.ConferencePaper:
                    contentItem = new ConferencePaper();
                    break;

                default:
                    throw new NotImplementedException();
                }
            }
            else
            {
                throw new ArgumentException(ARGUMENT_EXCEPTON);
            }

            if (serializer != null)
            {
                serializer.Populate(jObject.CreateReader(), contentItem);
            }
            return(contentItem);
        }