private bool CreatePlayerPage(MMPart mmPart, PageGroup parentGroup) { Page newPage = ActuallPlayerDb.Pages.NewRow(); newPage.Id = mmPart.Id; newPage.NameId = mmPart.NameId; newPage.ExpectedDuration = mmPart.PlayingDuration; newPage.PageGroup = parentGroup; newPage.SortOrder = mmPart.SortOrder; newPage.BorderColor = String.Empty; newPage.Background = String.Empty; newPage.Background = "White"; newPage.HasFixedRatio = true; newPage.RatioX = 16; newPage.RatioY = 9; newPage.Table.Rows.Add(newPage); foreach (MMPartsElementeLayoutConnector layoutConnector in mmPart.MMPartsElementeLayoutConnectoren .OrderBy(ord => ord.DefaultedProcessingOrder)) { if ((layoutConnector.MMPartsElementeLayoutConnectorTyp.TypNameId == "Logo") || (layoutConnector.MMPartsElementeLayoutConnectorTyp.TypNameId == "DynamicPicture") || (layoutConnector.MMPartsElementeLayoutConnectorTyp.TypNameId == "Programm") || (layoutConnector.MMPartsElementeLayoutConnectorTyp.TypNameId == "Bild")) { CreatePlayerImage(newPage, layoutConnector); } else if (layoutConnector.MMPartsElementeLayoutConnectorTyp.TypNameId == "Video") { CreatePlayerVideo(newPage, layoutConnector); } else if (layoutConnector.MMPartsElementeLayoutConnectorTyp.TypNameId == "Text") { CreatePlayerText(newPage, layoutConnector); } else { throw new Exception($"{layoutConnector.MMPartsElementeLayoutConnectorTyp.TypNameId} nicht implementiert"); } } return true; }
public PageGroup Generate() { TargetPageGroup = TargetPlayerDb.PageGroups.Find(MMUnitSource.Id); if (TargetPageGroup != null) return TargetPageGroup; TargetPageGroup = TargetPlayerDb.PageGroups.NewRow(); TargetPageGroup.Id = MMUnitSource.Id; TargetPageGroup.Name = $"{MMUnitSource.NameId} - {MMUnitSource.MMForeignUnitTyp.TypNameId} - {MMUnitSource.Id}"; TargetPageGroup.Table.Rows.Add(TargetPageGroup); foreach (MMPart mmPart in MMUnitSource.MMParts.OrderBy(ord => ord.SortOrder)) { CreatePlayerPage(mmPart); } return TargetPageGroup; }
public String CreateAndStorePageGroupAsDataSet(PageGroup pageGroup, String pageGroupSerializedName = "") { RingPlayerDb dataSet = pageGroup.Copy_BundledData_In_New_DataSet(true); FileInfo fileInfo; if (String.IsNullOrEmpty(pageGroupSerializedName)) fileInfo = VisualBasics.CreateScreenGroupFileInfo(pageGroup.Id, pageGroup.NameId); else fileInfo = VisualBasics.GetWeatherScreenGroupFileInfo($"{pageGroupSerializedName}.ScreenGroup"); if (!fileInfo.Exists) dataSet.SaveAs_SerializedBinary(fileInfo); return fileInfo.FullName; }