示例#1
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);
			}
示例#2
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)
				{
				layoutConnector.MMElement.MMVideo = Data.DbServer3.MultiMedia.MMVideos
					.GetVideoFile(layoutConnector.MMElement.ValueFileReference);
				}
			if (layoutConnector.MMElement.MMVideo != null)
				{
				FileInfo videoTargetFileName =
					VisualBasics.GetPlayerCacheFileInfo(Path.Combine(layoutConnector.MMElement.MMVideo.PlayerFileNameReference));
				//if (!videoTargetFileName.Exists)
				//	{
				//	int FileLengthInKB = (int)(new FileInfo(layoutConnector.MMElement.MMVideo.Get_BestFittingVideoName)).Length / 1024;
				//	Window copyWindow = new Window();
				//	copyWindow.Content = new TextBlock()
				//		{
				//		Text = $"Kopiert wird {layoutConnector.MMElement.MMVideo.Get_BestFittingVideoName}\r\n" +
				//				$"in der Länge von {FileLengthInKB} kB"
				//		};
				//	copyWindow.Show();
				//	videoTargetFileName.CreateDirectory_IfNotExists();
				//	File.Copy(layoutConnector.MMElement.MMVideo.Get_BestFittingVideoName,
				//		videoTargetFileName.FullName);
				//	copyWindow.Close();
				//	}
				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);
			}
示例#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);
			}
		private bool CreatePlayerText(Page parentPage, MMPartsElementeLayoutConnector layoutConnector)
			{
			Text newText = ActuallPlayerDb.Texts.NewRow();
			newText.Id = Guid.NewGuid();
			newText.Page = parentPage;
			if (FillPlayerVisualFromMMLayoutConnector(newText, layoutConnector) == false)
				return false;
			ActuallPlayerDb.Texts.Rows.Add(newText);
			return true;
			}
		private bool CreatePlayerVideo(Page parentPage, MMPartsElementeLayoutConnector layoutConnector)
			{
			Video newVideo = ActuallPlayerDb.Videos.NewRow();
			newVideo.Id = Guid.NewGuid();
			newVideo.Page = parentPage;
			if (layoutConnector.MMElement.MMVideo == null)
				{
				layoutConnector.MMElement.MMVideo = Data.DbServer3.MultiMedia.MMVideos
					.GetVideoFile(layoutConnector.MMElement.ValueFileReference);
				}
			if (layoutConnector.MMElement.MMVideo != null)
				{
				FileInfo videoTargetFileName = VisualBasics.CreateVideoCacheFileInfo
					(layoutConnector.MMElement.MMVideo.Id,
						layoutConnector.MMElement.MMVideo.NameId,
						Path.GetExtension(layoutConnector.MMElement
								.MMVideo.Get_BestFittingVideoName).Replace(".", ""));
				if (!videoTargetFileName.Exists)
					{
					int FileLengthInKB = (int)(new FileInfo(layoutConnector.MMElement.MMVideo.Get_BestFittingVideoName)).Length / 1024;
					Window copyWindow = new Window();
					copyWindow.Content = new TextBlock()
						{
						Text = $"Kopiert wird {layoutConnector.MMElement.MMVideo.Get_BestFittingVideoName}\r\n" +
								$"in der Länge von {FileLengthInKB} kB"
						};
					copyWindow.Show();
					videoTargetFileName.CreateDirectory_IfNotExists();
					File.Copy(layoutConnector.MMElement.MMVideo.Get_BestFittingVideoName,
						videoTargetFileName.FullName);
					copyWindow.Close();

					}
				newVideo.VideoId = layoutConnector.MMElement.MMVideo.Id;
				newVideo.NameId = Path.GetFileNameWithoutExtension(videoTargetFileName.FullName);
				newVideo.Extension = Path.GetExtension(videoTargetFileName.FullName).Replace(".", "");
				}
			FillPlayerVisualFromMMLayoutConnector(newVideo, layoutConnector);
			ActuallPlayerDb.Videos.Rows.Add(newVideo);
			return true;
			}
		private bool CreatePlayerImage(Page parentPage, MMPartsElementeLayoutConnector layoutConnector)
			{
			DbEntitiesPlayer.hsserver.ringplayerdb.rows.Image newImage = ActuallPlayerDb.Images.NewRow();
			newImage.Id = Guid.NewGuid();
			newImage.Page = parentPage;
			FillPlayerVisualFromMMLayoutConnector(newImage, layoutConnector);
			ActuallPlayerDb.Images.Rows.Add(newImage);
			return true;
			}