private void FillPartDistrictContainerContent (Page parentPage, DrawingElementContainerDefinition drawingElement, int sortOrder) { Page districtPartPage = MultiMediaDb.Pages.NewRow(); districtPartPage.Id = Guid.NewGuid(); districtPartPage.DiagnosticText = "districtPartVisual"; districtPartPage.ParentPage = parentPage; districtPartPage.SortOrder = sortOrder++; districtPartPage.MMUnit = parentPage.MMUnit; districtPartPage.MarginThickness = drawingElement.GetPercentageOuterThickness().ToString(); districtPartPage.Table.Add(districtPartPage); Text textElement = MultiMediaDb.Texts.NewRow(); textElement.Id = Guid.NewGuid(); textElement.DiagnosticText = drawingElement.Text; textElement.Page = districtPartPage; textElement.SortOrder = sortOrder++; textElement.TextColumn = drawingElement.Text; textElement.FontWeight = FontWeights.ExtraLight.ToString(); textElement.Foreground = Colors.Black.ToString(); textElement.MarginThickness = drawingElement.GetPercentageSubDistrictTextThickness().ToString(); textElement.Table.Add(textElement); Image imageElement = MultiMediaDb.Images.NewRow(); imageElement.Id = Guid.NewGuid(); imageElement.DiagnosticText = drawingElement.Text; imageElement.Page = districtPartPage; imageElement.SortOrder = sortOrder; MMPicture picture = MultiMediaDb.MMPictures .GetWeatherIcon($"icon_{IconCode}"); if (picture == null) { } imageElement.ImageId = picture.Id; imageElement.Extension = picture.Extension; imageElement.MarginThickness = drawingElement.GetPercentageSubDistrictIconThickness().ToString(); imageElement.Table.Add(imageElement); }
private void AddTextRow(Page parentPage, DrawingElementContainerDefinition drawingElement, String text, int sortOrder) { Text textElement = MultiMediaDb.Texts.NewRow(); textElement.Id = Guid.NewGuid(); textElement.DiagnosticText = drawingElement.Text; textElement.Page = parentPage; textElement.SortOrder = sortOrder; textElement.TextColumn = text; textElement.FontWeight = "Bold"; textElement.MarginThickness = drawingElement.GetPercentageOuterThickness().ToString(); textElement.Table.Add(textElement); }
private void FillDistrictContainerContent(Page weatherContentContainer, DrawingElementContainerDefinition drawingElement, int sortOrder) { if (drawingElement.Text == "WindRose") { Image imageElement = MultiMediaDb.Images.NewRow(); imageElement.Id = Guid.NewGuid(); imageElement.DiagnosticText = drawingElement.Text; imageElement.Page = weatherContentContainer; imageElement.SortOrder = sortOrder++; MMPicture picture = MultiMediaDb.MMPictures .GetWeatherIcon($"wind_{WindDirText}"); imageElement.ImageId = picture.Id; imageElement.Extension = picture.Extension; imageElement.MarginThickness = drawingElement.GetPercentageOuterThickness().ToString(); imageElement.Table.Add(imageElement); } if (drawingElement.Text == "WindGeschwindigkeit") { AddTextRow(weatherContentContainer, drawingElement, $"{WindSpeed} km/h", sortOrder++); } if (drawingElement.Text == "WindRichtung") { AddTextRow(weatherContentContainer, drawingElement, $"Wind aus {WindDirText}", sortOrder++); } if (drawingElement.Text == "Temperatur") { String TempString; if (String.Compare(TempMin, TempMax) != 0) TempString = "Temp: " + TempMin + "° - " + TempMax + "°"; else TempString = "Temp: " + TempMax + "°"; AddTextRow(weatherContentContainer, drawingElement, TempString, sortOrder++); } if (drawingElement.Text == "Kurztext") { AddTextRow(weatherContentContainer, drawingElement, IconText, sortOrder++); } }