Пример #1
0
		private void CreateVideo(Page parentPage, MMPartsElementeLayoutConnector layoutConnector)
			{
			Video newVideo = TargetPlayerDb.Videos.NewRow();
			newVideo.Id = Guid.NewGuid();
			newVideo.Page = parentPage;

			if (layoutConnector.MMElement.MMVideo == null)
				{
				throw new Exception($"Falsch generiertes {nameof(MMElement)}[{layoutConnector.MMElement.Id}].");
				}
			if (layoutConnector.MMElement.MMVideo != null)
				{
				//if (String.IsNullOrWhiteSpace(layoutConnector.MMElement.MMVideo.PlayerFileNameReference))
				//	throw new FileNotFoundException
				//		($"Bei der MMUnit {layoutConnector.MMElement.MMUnit.NameId} " +
				//		$"({layoutConnector.MMElement.MMUnit.Id}) beim VideoFile " +
				//		$"{layoutConnector.MMElement.MMVideo.OriginalDirectoryNameReference} ist keine " +
				//		$"PlayerFileNameReference eingetragen");
				//FileInfo videoTargetFileName =
				//	VisualBasics.GetPlayerCacheFileInfo(layoutConnector.MMElement.MMVideo.PlayerFileNameReference);
				FileInfo videoTargetFileName =
					VisualBasics.GetPlayerArchiveFileInfo
					(layoutConnector.MMElement.MMVideo.OriginalDirectoryNameReference,
					layoutConnector.MMElement.MMVideo.PlayerBestFittingSourceReference ?? String.Empty);

				newVideo.FileIdentifier = layoutConnector.MMElement.MMVideo.Id;
				newVideo.DiagnosticText = Path.GetFileNameWithoutExtension(videoTargetFileName.FullName);
				newVideo.Extension = Path.GetExtension(videoTargetFileName.FullName).Replace(".", "");
				}
			ApplyLayout(newVideo, layoutConnector);
			newVideo.Table.Add(newVideo);
			}
Пример #2
0
		private void CreateText(Page parentPage, MMPartsElementeLayoutConnector layoutConnector)
			{
			Text newText = TargetPlayerDb.Texts.NewRow();
			newText.Id = Guid.NewGuid();
			newText.Page = parentPage;
			if (ApplyLayout(newText, layoutConnector))
				newText.Table.Rows.Add(newText);
			}
Пример #3
0
		private void CreateImage(Page parentPage, MMPartsElementeLayoutConnector layoutConnector)
			{
			Image newImage = TargetPlayerDb.Images.NewRow();
			newImage.Id = Guid.NewGuid();
			newImage.Page = parentPage;
			ApplyLayout(newImage, layoutConnector);
			newImage.Table.Rows.Add(newImage);
			}