public ManagedSimpleTimingsControl () { InitializeComponent (); m_CVM = new CVM.CommonValues (); m_XAMLHandling = new XAMLHandling (m_CVM); //m_XAMLHandling.ShowGridLines = true; this.Loaded +=new RoutedEventHandler(ManagedSimpleTimingsControl_Loaded); }
public SimpleInputWindow () { InitializeComponent (); ShowGridLines = false; m_CVM = new CVM.CommonValues (); m_XAML = new XAMLHandling (m_CVM); ValueChangeRequested = false; RunAsColorPicker = false; }
private void UserControl_Loaded (object sender, RoutedEventArgs e) { m_XAMLHandler = new XAMLHandling (m_CVM); switch (RequiredFunction) { case BeitraegeFunction.SelectBackGroundTemplateBeitraege: { RunSelectBackGroundTemplateBeitraege (); } break; } }
private void Window_Loaded (object sender, RoutedEventArgs e) { if (WMB.Basics.IAmActiveBefore ()) { WMB.Basics.ReportErrorToEventViewer ("WPMediaPlayingDataController.Window_Loaded", "Start wird abgebrochen, weil schon eine Instanz aktiv ist"); Close (); return; } m_CVM = new CommonValues(); m_XAMLHandling = new XAMLHandling (m_CVM); m_CVM.SetVideoSize (); Width = 0; Height = 0; MaxWidth = 0; MaxHeight = 0; MinWidth = 0; MinHeight = 0; Top = 0; Left = 0; this.Topmost = false; CreateTimeWindow (); if (CheckIfLogoWindowShouldUsed () == true) CreateLogoWindow (); this.WindowStartupLocation = WindowStartupLocation.Manual; m_StartDataCopyProcess = new DispatcherTimer(); m_StartDataCopyProcess.Tick += new EventHandler (m_StartDataCopyProcess_Tick); m_StartDataCopyProcess.Interval = TimeSpan.FromSeconds (60); #if DEBUG m_StartDataCopyProcess.Interval = TimeSpan.FromSeconds (1); m_StartDataCopyProcess.Start (); return; #endif m_StartDataCopyProcess.Start (); m_ShowTimeTimer = new DispatcherTimer(); m_ShowTimeTimer.Interval = TimeSpan.FromSeconds (1); m_ShowTimeTimer.Tick += new EventHandler (m_ShowTimeTimer_Tick); m_ShowTimeTimer.Start (); m_StartPlayerTimer = new DispatcherTimer (); m_StartPlayerTimer.Tick += new EventHandler (m_StartPlayerTimer_Tick); m_StartPlayerTimer.Interval = TimeSpan.FromSeconds (10); m_StartPlayerTimer.Start (); Mouse.OverrideCursor = Cursors.None; }
public void SetParameter (CVM.CommonValues Cvm, String [] Arguments, int VideoWidth, int VideoHeight, double CompletePlayLengthInSeconds) { m_CVM = Cvm; m_XAML = new XAMLHandling (m_CVM); m_Arguments = Arguments; if (m_Arguments.Length == 0) return; if (!File.Exists (m_Arguments [0])) { CloseRequestedCall (""); return; } m_WPMediaProgramm = m_CVM.GetExternalProgrammDetails (m_Arguments, ref m_ProgrammClass, ref m_ProgrammInstance); m_ProgrammRoot = m_CVM.GetProgrammDirectory (); m_XAML = new XAMLHandling (m_CVM); m_XAML.ShowGridLines = false; }
private void Window_Loaded (object sender, RoutedEventArgs e) { m_DataBase = new WCFStandardsNS.WCFStandards (); m_DataBase.DefaultConnectionStringName = Properties.Settings.Default.WebConnectionStringName; WMB.WPMediaApplicationState.Instance.Properties ["DataBase"] = m_DataBase; System.Threading.Thread.CurrentThread.SetApartmentState (ApartmentState.STA); m_XAMLHandling = new XAMLHandling (m_CVM); // sac xxx #if DEBUG if (String.Compare (WMB.Basics.GetComputerName (), "Heinz64", true) == 0) { String WPMediaConnectionStringName = WMB.Basics.GetUserConfigurationSettingsValue("WPMediaConnectionStringName"); RunTest(); return; } #endif RunCreation (); }
private void PackageDataControl_OnLoaded (object Sender, RoutedEventArgs E) { m_CVM = new CVM.CommonValues (); m_XAMLHandler = new CVM.XAMLHandling (m_CVM); m_RootGrid = m_XAMLHandler.CreateGrid(new int[] { 200, 400 }, new int[] { 5, 95 }); this.Content = m_RootGrid; m_PackageDataElemente = new TreeView (); m_PackageDataElemente.Margin = (Thickness)m_TConverter.ConvertFromString("0, 0, 5, 0"); Grid.SetColumn(m_PackageDataElemente, 0); Grid.SetRow (m_PackageDataElemente, 1); m_ContentArea = new TabControl (); CVM.DataSetViewer.ContentTabControl = m_ContentArea; m_RootGrid.Children.Add(m_ContentArea); Grid.SetColumn(m_ContentArea, 1); Grid.SetRow (m_ContentArea, 0); Grid.SetRowSpan (m_ContentArea, 2); FillGraphicsHandlerElements (m_PackageDataElemente); m_RootGrid.Children.Add (m_PackageDataElemente); m_XAMLHandler.SetColumnAsPositionMover(m_RootGrid, 0); }
protected void Page_Load (object sender, EventArgs e) { String LogicalUserName = String.Empty; String[] LogicalRollen = null; InternetSecurityFunctions.RunRequestStarupSecurity(Request, Session, ref LogicalUserName, ref LogicalRollen); m_CVM = new CommonValues(true); m_XAMLHandling = new XAMLHandling (m_CVM); if (Request.QueryString ["Entry"] != null) { String EntryName = Request.QueryString ["Entry"].ToString (); if (EntryName == "AEAGLeisure") { String DayToExpand = "Heute"; if (Request.QueryString ["DayToExpand"] != null) DayToExpand = Request.QueryString ["DayToExpand"].ToString (); PerformShowOverview (DayToExpand); return; } } if ((Request.QueryString ["Table"] != null) && (Request.QueryString ["Display"] != null) && (Request.QueryString ["DateTime"] != null)) { String TableName = Request.QueryString ["Table"].ToString (); String DisplayBlock = Request.QueryString ["Display"].ToString (); String DateToDisplay = Request.QueryString ["DateTime"].ToString (); String HinweisDate = String.Empty; TimeSpan Difference = DateTime.Parse (DateToDisplay).Date - DateTime.Now.Date; if (Math.Abs (Difference.TotalMinutes) < 1) HinweisDate = TagesTable [0]; if (Math.Abs (Difference.TotalMinutes - 1440) < 1) HinweisDate = TagesTable [1]; if (Math.Abs (Difference.TotalMinutes - 2880) < 1) HinweisDate = TagesTable [2]; PerformShowOverview (HinweisDate); PerformShowEntry (TableName, DisplayBlock, DateToDisplay); return; } }
public void SetParameter () { this.CompleteAreaCanvas.Width = m_HostCVM.VideoWidth; this.CompleteAreaCanvas.Height = m_HostCVM.VideoHeight; this.PictureAreaGrid.Width = m_HostCVM.VideoWidth; this.PictureAreaGrid.Height = m_HostCVM.VideoHeight; BrushConverter BRConverter = new BrushConverter (); this.PictureAreaGrid.Background = (Brush)BRConverter.ConvertFromString ("Black"); m_IndexForActualDirectory = -1; m_TransitionTimeInMilliseconds = 1200; SetTransitionTime (m_TransitionTimeInMilliseconds); int Index = 0; while (Index < m_LastShownPictures.Length) m_LastShownPictures [Index++] = null; ModifyLayout ((m_HostCVM.CreatePictureThumbnails) ? false : true); m_XAML = new CVM.XAMLHandling (m_HostCVM); }
private void UserControl_Loaded (object sender, RoutedEventArgs e) { m_CVM = new CommonValues (); m_XAML = new XAMLHandling (m_CVM); Grid EditGrid = m_XAML.CreateGrid (new int [] { 1}, new int [] { 10, 10, 8, 5000}); Content = EditGrid; EditGrid.RowDefinitions [0].MinHeight = 40; EditGrid.RowDefinitions [0].MaxHeight = 40; EditGrid.RowDefinitions [1].MinHeight = 40; EditGrid.RowDefinitions [1].MaxHeight = 40; EditGrid.RowDefinitions [2].MinHeight = 30; EditGrid.RowDefinitions [2].MaxHeight = 30; m_MainControlButtons = m_XAML.CreateGrid (new int [] { 5, 3, 1 }, new int [] { 1 }); EditGrid.Children.Add (m_MainControlButtons); Grid.SetRow (m_MainControlButtons, 0); Grid.SetColumn (m_MainControlButtons, 0); FillMainControl (m_MainControlButtons); m_DateControlButtons = m_XAML.CreateGrid (new int [] { 18, 6, 75 }, new int [] { 1 }); EditGrid.Children.Add (m_DateControlButtons); Grid.SetRow (m_DateControlButtons, 1); Grid.SetColumn (m_DateControlButtons, 0); m_TimeControlButtons = m_XAML.CreateGrid (new int [] { 1 }, new int [] { 1 }); EditGrid.Children.Add (m_TimeControlButtons); Grid.SetRow (m_TimeControlButtons, 2); Grid.SetColumn (m_TimeControlButtons, 0); m_BookingControlButtons = m_XAML.CreateGrid (new int [] { 1 }, new int [] { 1 }); EditGrid.Children.Add (m_BookingControlButtons); Grid.SetRow (m_BookingControlButtons, 3); Grid.SetColumn (m_BookingControlButtons, 0); }
private void DoStartup () { if (m_DataAccess != null) return; m_DataAccess = new WCFStandardsNS.WCFStandards (); // default is WPMedia m_CVM = new CommonValues (); m_XAMLHandling = new XAMLHandling (m_CVM); }
private void Page_Loaded (object sender, RoutedEventArgs e) { if (DesignerProperties.GetIsInDesignMode (this)) return; if (String.IsNullOrEmpty (TableToProcess)) { LastSelectedTableRows = null; CloseRequestedCall (this, ""); return; } DrawingWidth = 600; m_CVM = new CommonValues (); m_XAML = new XAMLHandling (m_CVM); m_XAML.WebPageIsRequestedCall += new XAMLHandling.WebPageIsRequestedEvent (m_XAML_WebPageIsRequestedCall); m_XAML.ShowTextFrames = true; m_XAML.ShowGridLines = true; HeadLine.Content = "Es wird die Tabelle \"" + TableToProcess + "\" bearbeitet"; RootGrid.DataContext = this; //CreateAdaptedSelectionDefinitions (SchemaDataSet); if (IsTreeViewStructuredTable ()) { AvailableEntriesListBox.Visibility = Visibility.Collapsed; AvailableEntriesTreeView.Visibility = Visibility.Visible; LoadAndFillTableEntriesIntoTreeView (); } else { AvailableEntriesListBox.Visibility = Visibility.Visible; AvailableEntriesTreeView.Visibility = Visibility.Collapsed; LoadAndFillTableEntriesIntoListView (); } m_ManagedTimingsControl = new ManagedTimingsControl (); m_ManagedTimingsControl.ConnectedType = TableToProcess; m_ManagedTimingsControl.DataAccess = m_DataBase; TimingsGrid.Children.Add (m_ManagedTimingsControl); m_ManagedTimingsControl.ConnectedID = String.Empty; if (InAdministratorMode) Administrator_Button.IsEnabled = true; UpdateLayout (); //WindowWidth = ActualWidth; //WindowHeight = ActualHeight + ((Window) Parent). if (ExternalControlServer.ActuallCommands.ContainsKey ("StartEntry")) { String IDToSelect = ExternalControlServer.ActuallCommands ["StartEntry"]; ListBoxItem FoundItem = null; foreach (ListBoxItem Entry in AvailableEntriesListBox.Items) { if (String.Compare ((Entry.Tag as String), IDToSelect, StringComparison.OrdinalIgnoreCase) == 0) { FoundItem = Entry; break; } } if (FoundItem != null) { AvailableEntriesListBox.SelectedItem = FoundItem; SelectButton_Click (null, null); if ((ExternalControlServer.ActuallCommands.ContainsKey ("ProcessingType")) && (ExternalControlServer.ActuallCommands ["ProcessingType"] == "Delete")) { DeleteButton_Click (null, null); ExternalControlServer.ClearCommands (null); } } ExternalControlServer.ClearCommands (new String [] {"StartTable", "StartEntry", "ProcessingType"}); // ExternalControlServer.ReportProcessingEndedBack (); } }
private void UserControl_Loaded (object sender, RoutedEventArgs e) { if (DesignerProperties.GetIsInDesignMode (this)) return; m_AutomaticDataCollection = new DispatcherTimer(); m_AutomaticDataGeneration = new DispatcherTimer(); m_CVM = new CommonValues (); m_XAML = new XAMLHandling (m_CVM); Grid BasicGrid = m_XAML.CreateGrid (new int [] { 1, 1, 1, 1, 1, 1 }, new int [] { 1, 5000, 1 }); BasicGrid.RowDefinitions [0].MinHeight = 30; BasicGrid.RowDefinitions [0].MaxHeight = 40; BasicGrid.RowDefinitions [1].MinHeight = 60; BasicGrid.RowDefinitions [2].MinHeight = 30; BasicGrid.RowDefinitions [2].MaxHeight = 40; TextBox HeadLine = new TextBox (); BasicGrid.Children.Add (HeadLine); Grid.SetColumn (HeadLine, 0); Grid.SetRow (HeadLine, 0); Grid.SetColumnSpan (HeadLine, 6); m_WorkingAreaGrid.ShowGridLines = true; Grid.SetColumn (m_WorkingAreaGrid, 0); Grid.SetRow (m_WorkingAreaGrid, 1); Grid.SetColumnSpan (m_WorkingAreaGrid, 6); BasicGrid.Children.Add (m_WorkingAreaGrid); m_LeisureBookingControl.DataAccess = m_DataBase; m_LeisureBookingControl.CloseRequestedCall += new CloseRequested (m_LeisureBookingControl_CloseRequestedCall); if (IsAutoRun) { Grid.SetColumn (m_LeisureBookingControl, 0); Grid.SetRow (m_LeisureBookingControl, 0); m_WorkingAreaGrid.Children.Add (m_LeisureBookingControl); HeadLine.Text = "Datenübernahme zur Mieterinformation"; m_AutomaticDataCollection.Tick += new EventHandler (AutomaticDataCollection_Tick); m_AutomaticDataCollection.Interval = TimeSpan.FromSeconds (20); m_AutomaticDataCollection.Start (); m_AutomaticDataGeneration.Tick += new EventHandler (m_AutomaticDataGeneration_Tick); m_AutomaticDataGeneration.Interval = TimeSpan.FromSeconds (1); m_AutomaticDataGeneration.Start (); } else if (InAdministratorMode) { Button LeisureBookingButton = new Button (); LeisureBookingButton.Content = "Buchung"; BasicGrid.Children.Add (LeisureBookingButton); Grid.SetColumn (LeisureBookingButton, 0); Grid.SetRow (LeisureBookingButton, 2); LeisureBookingButton.Click += new RoutedEventHandler (LeisureBookingButton_Click); Button AutomaticLeisureBookingButton = new Button (); AutomaticLeisureBookingButton.Content = "Start Automat"; BasicGrid.Children.Add (AutomaticLeisureBookingButton); Grid.SetColumn (AutomaticLeisureBookingButton, 1); Grid.SetRow (AutomaticLeisureBookingButton, 2); AutomaticLeisureBookingButton.Click += new RoutedEventHandler (AutomaticLeisureBookingButton_Click); Button RessourcesManagementButton = new Button (); RessourcesManagementButton.Content = "Ressourcen"; BasicGrid.Children.Add (RessourcesManagementButton); Grid.SetColumn (RessourcesManagementButton, 2); Grid.SetRow (RessourcesManagementButton, 2); RessourcesManagementButton.Click += new RoutedEventHandler (RessourcesManagementButton_Click); Button CreationRulesButton = new Button (); CreationRulesButton.Content = "CreationRules"; BasicGrid.Children.Add (CreationRulesButton); Grid.SetColumn (CreationRulesButton, 3); Grid.SetRow (CreationRulesButton, 2); CreationRulesButton.Click += new RoutedEventHandler (CreationRulesButton_Click); Button HandlingRulesButton = new Button (); HandlingRulesButton.Content = "HandlingRules"; BasicGrid.Children.Add (HandlingRulesButton); Grid.SetColumn (HandlingRulesButton, 4); Grid.SetRow (HandlingRulesButton, 2); HandlingRulesButton.Click += new RoutedEventHandler (HandlingRulesButton_Click); HeadLine.Text = "Bitte wählen Sie aus"; } Button FertigButton = new Button (); FertigButton.Content = "Fertig"; BasicGrid.Children.Add (FertigButton); Grid.SetColumn (FertigButton, 5); Grid.SetRow (FertigButton, 2); FertigButton.Click += new RoutedEventHandler (FertigButton_Click); RootGrid.Children.Add (BasicGrid); }
public AEAGLeisureDisplay () { InitializeComponent (); m_CVM = new CommonValues(); m_XAMLHandling = new XAMLHandling (m_CVM); }
public bool CreateLayoutAsWebPage (DataSet FormatierDataSet, System.Web.UI.Page PageObject, Object ParentObject, DateTime DayToDisplay, DataRow BlockRow, DataRow ContentRow, DataRow [] TextInBlocks, double OriginalWidth, double OriginalHeight) { m_CVM = new CommonValues (true); m_XAMLHandling = new XAMLHandling (m_CVM); System.Web.UI.WebControls.Panel ParentPanel = ParentObject as System.Web.UI.WebControls.Panel; Panel HeadLinePanel = new Panel (); ParentPanel.Controls.Add (HeadLinePanel); Panel TablePanel = new Panel (); ParentPanel.Controls.Add (TablePanel); Table ParentTable = new Table (); ParentTable.CssClass = "CSS_GlobalContentTable"; TablePanel.Controls.Add (ParentTable); Panel DescriptionPanel = new Panel (); ParentPanel.Controls.Add (DescriptionPanel); Table DescriptionTable = new Table (); DescriptionPanel.Controls.Add (DescriptionTable); if (TextInBlocks.Length != 1) { ParentTable.Caption = "Es war kein TextInBlocks Eintrag vorhanden"; return false; } DataSet LocalFormatierDataSet = WMB.Basics.GetDataSetFromRowContent (ContentRow); String DataBaseItem = TextInBlocks [0] ["DataBaseItem"].ToString (); String DataBaseItemContentName = TextInBlocks [0] ["DataBaseItem"].ToString (); if ((String.IsNullOrEmpty (DataBaseItemContentName)) || (ContentRow.Table.Columns [DataBaseItemContentName] == null)) { ParentTable.Caption = "AEAGWebLesisureDisplay.CreateLayoutAsWebPage" + "Das DataBase Item \"" + DataBaseItemContentName + "\" ist in der Table \"" + ContentRow.Table.TableName + "\" nicht enthalten"; return false; } String [] QuotedRessources = ContentRow [DataBaseItemContentName].ToString ().Split ('|'); int MaxNumberOfRows = 0; int TimingRowHeight = 0; int FirstColumnWidth = 0; if ((QuotedRessources [0].IndexOf ("Badminton") != -1) || (QuotedRessources [0].IndexOf ("Tennis") != -1)) { MaxNumberOfRows = 6; TimingRowHeight = 2; FirstColumnWidth = 5; } else { MaxNumberOfRows = 11; TimingRowHeight = 3; FirstColumnWidth = 10; } String AktualizingDateCheck = WMB.Basics.GetSelectFormattedDateTime (DayToDisplay.AddDays (-3).Date); DataRow [] LatestBookings = LocalFormatierDataSet.Tables ["Bookings"].Select (String.Format ("BookingDateTime > '{0}' and BookingStatus = 'B'", AktualizingDateCheck), "BookingDateTime Desc"); if (LatestBookings.Length == 0) return InsertNoActuallBookingsAvailable (ParentTable, FormatierDataSet, BlockRow, ContentRow, TextInBlocks, OriginalWidth, OriginalHeight, QuotedRessources); DateTime LatestBookingTime = DateTime.Parse (LatestBookings [0] ["BookingDateTime"].ToString ()); bool FirstRun = true; DataRow [] Associated = null; int RessourceIndex = 2; DateTime DayToSearchFor = DayToDisplay; int ColumnPercentage = 10; foreach (String QuotedRessource in QuotedRessources) { String Ressource = QuotedRessource.Trim (new char [] { '"', ' ' }); Associated = LocalFormatierDataSet.Tables ["FullBookableUnits"].Select ("RessourceNameID = '" + Ressource + "'", "DisplayInColumnOrder"); if (FirstRun) { FirstRun = false; int [] Rows = new int [MaxNumberOfRows]; int [] Columns = new int [Associated.Length + 1]; int FillIndex = 0; Rows [FillIndex++] = 2; Rows [FillIndex++] = TimingRowHeight; while (FillIndex < Rows.Length) Rows [FillIndex++] = 2; FillIndex = 0; Columns [FillIndex++] = FirstColumnWidth; while (FillIndex < Columns.Length) Columns [FillIndex++] = 2; if (Columns.Length > 8) ColumnPercentage = (80/(Columns.Length - 1)) * 15; else ColumnPercentage = (80 / (Columns.Length - 1)) * 8; FillTopHeader (HeadLinePanel, LatestBookingTime); TableRow HeadRow = new TableRow (); ParentTable.Rows.Add (HeadRow); HeadRow.CssClass = "CSS_TimeHeadRow"; //TableCell ColumnDescriptionCell = new TableCell (); //ColumnDescriptionCell.CssClass = "CSS_ColumnGroupCell"; //HeadRow.Cells.Add (ColumnDescriptionCell); FillDateHeader (HeadRow, DayToSearchFor, DayToDisplay); FillTimeHeadLine (HeadRow, Associated, ColumnPercentage); } TableRow UnitRow = new TableRow (); ParentTable.Rows.Add (UnitRow); UnitRow.CssClass = "CSS_TimeHeadRow"; FillRessourceNameColumn (UnitRow, Ressource, RessourceIndex); int TimeColumnIndex = 1; foreach (DataRow FullBookableUnitsRow in Associated) { FillOccupationEntry (UnitRow, LocalFormatierDataSet.Tables ["Bookings"], FullBookableUnitsRow, DayToSearchFor, RessourceIndex, TimeColumnIndex, ColumnPercentage); TimeColumnIndex++; } RessourceIndex++; } InsertDescriptiveText (DescriptionTable); return true; }
public WPMediaCentralServices () { m_CVM = new CommonValues (); m_XAMLHandling = new XAMLHandling (m_CVM); }
/* public void CreateGalleriePlayingData (String PictureElementsFileRootDirectory, String TableName, DataRow TableTableRow) { CVM.CommonValues m_CVM = new CVM.CommonValues (); XAMLHandling m_XAMLHandling = new XAMLHandling (m_CVM); LocalWPMediaRoot = CommonDataBase.DataBase.GetLocalWPMediaRoot (); String TableDirectory = Path.Combine (PictureElementsFileRootDirectory, TableName); List<FileInfo> ExistingFiles = WMB.Basics.GetFileInfoEntriesFromDirectory (TableDirectory, new string [] { ControlFileExtension }, 1); return; } */ public void CreateStandbildPlayingData (String WPMediaServerRootDirectory, String PackageFilesRootDirectory, String TableName, DataRow tableDefinitionRow) { if (WMB.Basics.IsTestRun) { int NumberOfFiles = WMB.Basics.GetFilesFromDirectory (Path.Combine(PackageFilesRootDirectory, TableName), new string[] { "*.pkg" }, 1).Count; WMB.Basics.ReportInformationToEventViewer("WPMediaCentralServices.CreateStandbildPlayingData", "PackageFilesRootDirectory =\r\n\"" + PackageFilesRootDirectory + "\" Tabelle =\r\n\"" + TableName + "\" " + Convert.ToString(NumberOfFiles) + " Files"); } DateTime DateTimeToHandle = DateTime.Now; CVM.CommonValues m_CVM = new CVM.CommonValues(); XAMLHandling m_XAMLHandling = new XAMLHandling (m_CVM); LocalWPMediaRoot = CommonDataBase.DataBase.GetLocalWPMediaRoot (); String TableDirectory = Path.Combine (PackageFilesRootDirectory, TableName); List<FileInfo> ExistingFiles = WMB.Basics.GetFileInfoEntriesFromDirectory (TableDirectory, new string [] { ControlFileExtension }, 1); if (ExistingFiles == null) return; WPMediaStandbildPlayingData Description = new WPMediaStandbildPlayingData(); //ToDo Checking for IsActive on this day - new Implementation List<MMUnitUsageData> PossibleDataFromDataBase = Data.DbServer3.WPMediaAddOnData.GetWPMediaAddOnDataStandBildUsagePerTabelle (TableName, Data.DbServer3.WPMediaAddOnData.Timings .GetPossiblyInvolvedConnectedIds(DateTimeToHandle)[TableName]); Dictionary<DateTime, List<MMUnitUsageData>> AvtiveThisDayParameter = new Dictionary<DateTime, List<MMUnitUsageData>>() { { DateTimeToHandle, GetDayMMUnitUsageData (PossibleDataFromDataBase, DateTimeToHandle) } }; //TODO //MMUnitUsageTreeEntry Root = MMUnitUsageTreeEntry.GetUsageTree (null, null, null, null); //int WeekDay = (int) DateTime.Now.DayOfWeek; //List<MMUnitUsageData> DownloadEntriesStandBildUsageData = Root.Childs[MMUnitUsageTreeEntry.ALL_ACTIVE_ENTRIES].ContentList; // MMUnitUsageTreeEntry RootsChilds = Root.Childs [MMUnitUsageTreeEntry.ALL_ACTIVE_ENTRIES]; //List<MMUnitUsageData> AllDayUsageData = RootsChilds.Childs[MMUnitUsageTreeEntry.ALL_DAY_ENTRIES].ContentList; //List<MMUnitUsageData> ThisWeekDayUsageData = RootsChilds.Childs[WMB.Basics.ShortWeekDayNames[WeekDay]].ContentList; //Description.NamesOfLocalToDownloadDescriptions = new List<string> (); //foreach (MMUnitUsageData UsageData in DownloadEntriesStandBildUsageData) // { // Description.NamesOfLocalToDownloadDescriptions.Add(UsageData.PackageFileNamePart); // } //foreach (MMUnitUsageData UsageData in AllDayUsageData) // { // Description.NamesOfTodayActiveDescriptions.Add(UsageData.PackageFileNamePart); // } //foreach (MMUnitUsageData UsageData in ThisWeekDayUsageData) // { // Description.NamesOfTodayActiveDescriptions.Add(UsageData.PackageFileNamePart); // } Description.NamesOfTodayActiveDescriptions = new List<string>(); foreach (MMUnitUsageData UsageData in AvtiveThisDayParameter[DateTimeToHandle]) { Description.NamesOfTodayActiveDescriptions.Add(UsageData.PackageFileNamePart); } foreach (String PackageFileName in Description.NamesOfTodayActiveDescriptions) { bool Found = false; foreach (FileInfo FInfo in ExistingFiles) { if (FInfo.Name.ToLower () == Path.GetFileName (PackageFileName).ToLower ()) Found = true; } if (!Found) { WMB.Basics.ReportErrorToEventViewer("WPMediaCentralService.CreateStandbildPlayingData", "Der PackageFile \"" + PackageFileName + "\" fehlt"); } } int SkipLength = PackageFilesRootDirectory.Length + 1 - "Source\\".Length; if (WMB.Basics.IsTestRun) WMB.Basics.ReportInformationToEventViewer ("WPMediaCentralServices.CreateStandbildPlayingData", "NamesOfLocalToDownloadDescriptions = " + Convert.ToString (Description.NamesOfLocalToDownloadDescriptions.Count) + "\r\nNamesOfTodayActiveDescriptions = " + Convert.ToString (Description.NamesOfTodayActiveDescriptions.Count)); String EntryTimingType = tableDefinitionRow[CVM.CommonValues.WPMEDIA_ENTRY_TIMING_TYPE].ToString(); String PlayingOrder = tableDefinitionRow [CVM.CommonValues.WPMEDIA_ENTRY_PLAYING_ORDER].ToString (); double EntryDuration = 8; if (tableDefinitionRow [CVM.CommonValues.WPMEDIA_ENTRY_ENTRY_DURATION] != null) { if (!String.IsNullOrEmpty (tableDefinitionRow [CVM.CommonValues.WPMEDIA_ENTRY_ENTRY_DURATION].ToString ())) EntryDuration = Convert.ToDouble (tableDefinitionRow [CVM.CommonValues.WPMEDIA_ENTRY_ENTRY_DURATION]); } double OutsideSetDuration = -1; if (tableDefinitionRow [CVM.CommonValues.WPMEDIA_OUTSIDE_SET_DURATION] != null) { if (!String.IsNullOrEmpty (tableDefinitionRow [CVM.CommonValues.WPMEDIA_OUTSIDE_SET_DURATION].ToString ())) OutsideSetDuration = Convert.ToDouble (tableDefinitionRow [CVM.CommonValues.WPMEDIA_OUTSIDE_SET_DURATION]); } String MeaningOfOutsideSetDuration = tableDefinitionRow [CVM.CommonValues.WPMEDIA_MEANING_OF_OUTSIDE_SET_DURATION].ToString (); Description.TableName = TableName; Description.TableDefinitionTable = tableDefinitionRow.Table.Clone (); DataRow TableDefinitionRow = Description.TableDefinitionTable.NewRow (); TableDefinitionRow.ItemArray = tableDefinitionRow.ItemArray; Description.TableDefinitionTable.Rows.Add (TableDefinitionRow); Description.NameOfProcessingModule = tableDefinitionRow ["Type"].ToString (); Description.NamesOfActiveDescriptions = new List<string> (); Description.SortFields = new List<string> (); Description.LastWriteTimesOfNamesOfActiveDescriptions = new List<DateTime> (); Description.PlayLengthOfEachDescription = new List<TimeSpan> (); Description.NumberOfPagesOfEachDescription = new List<int> (); Description.NameOfPlayingDataDescription = TableName; Description.OverallPlayLength = 0; int OverallNumberOfPictures = 0; String TableType = tableDefinitionRow [CVM.CommonValues.WPMEDIA_ENTRY_TYPE_OF_TABLE].ToString (); ManagedTimingsControl TimingsCheckerClass = new ManagedTimingsControl (); CVM.ITimingsInterface TimingsCheckerInterface = TimingsCheckerClass as ITimingsInterface; TimingsCheckerInterface.m_TimingsTypenDataSet = m_DataBase.GetCommonDataSet ("Select * from TimingTypen"); foreach (String PackageFileName in Description.NamesOfTodayActiveDescriptions) { FileInfo Entry = new FileInfo(Path.Combine(PackageFilesRootDirectory, PackageFileName)); String ID = Path.GetFileNameWithoutExtension (Entry.FullName); DataTable UsedTimings; if (TimingsCheckerInterface.IsActive (ID, out UsedTimings) == false) continue; int NumberOfPages = 0; String SortField = PlayingOrder; TimeSpan PlayLengthForThisEntry = TimeSpan.Zero; List <double> PageDurations = new List<double> (); GraphicsHandling GraphicsHandler = new GraphicsHandling (LocalWPMediaRoot); if (GraphicsHandler.GetInstatiatedPackage (Entry.FullName) == null) { WMB.Basics.ReportErrorToEventViewer("WPMediaCentralServices.CreateStandbildPlayingData", "Der File\r\n\"" + Entry.FullName + "\"\r\nkonnte nicht als gültiges Package aufgelöst werden.\r\n" + "In der Folge werden damit Fehler auftreten"); continue; } List<TimeSpan> DurationForEachPage = new List<TimeSpan> (); foreach (double PageDuration in GraphicsHandler.PageDurations) { PlayLengthForThisEntry += TimeSpan.FromSeconds(PageDuration); DurationForEachPage.Add(TimeSpan.FromSeconds(PageDuration)); } SortField = GraphicsHandler.GetFilledSortField (SortField); NumberOfPages = GraphicsHandler.PageDurations.Count; GraphicsHandler.Close (); Description.StandBildTVVersion = "PKG_Version"; Description.DurationOfEachPageInEachDescription.Add (DurationForEachPage); Description.FillTimingsForEachDescription (ID, UsedTimings); if ((NumberOfPages == 0) || (PlayLengthForThisEntry == TimeSpan.Zero)) { WMB.Basics.ReportErrorToEventViewer ("WPMediaCentralServices.CreateStandbildPlayingData", Entry.FullName + " in der Table \"" + TableName + "\" hat eine PlayLength von 0"); continue; } Description.NamesOfActiveDescriptions.Add (Entry.FullName.Substring (SkipLength)); if (String.IsNullOrEmpty(Description.SubDirectoryWhereTheDescriptionsAreLocated)) { Description.SubDirectoryWhereTheDescriptionsAreLocated = Path.GetDirectoryName (Entry.FullName.Substring (SkipLength)); } Description.LastWriteTimesOfNamesOfActiveDescriptions.Add (Entry.LastWriteTime); Description.SortFields.Add (SortField); Description.NumberOfPagesOfEachDescription.Add (NumberOfPages); OverallNumberOfPictures += NumberOfPages; Description.OverallPlayLength += PlayLengthForThisEntry.TotalSeconds; Description.PlayLengthOfEachDescription.Add (PlayLengthForThisEntry); } if (OutsideSetDuration > 0) { if (MeaningOfOutsideSetDuration == CVM.CommonValues.WPMEDIA_MEANING_OF_OUTSIDE_SET_DURATION_MAX) if (OutsideSetDuration < Description.OverallPlayLength) Description.OverallPlayLength = OutsideSetDuration; if (MeaningOfOutsideSetDuration == CVM.CommonValues.WPMEDIA_MEANING_OF_OUTSIDE_SET_DURATION_FIX) Description.OverallPlayLength = OutsideSetDuration; } Description.OverallNumberOfPicturesToShow = OverallNumberOfPictures; String ControlFileName = Description.TableName; if (tableDefinitionRow ["DefinitionNameToCreate"] != Convert.DBNull) if (!String.IsNullOrEmpty (tableDefinitionRow ["DefinitionNameToCreate"].ToString ())) ControlFileName = tableDefinitionRow ["DefinitionNameToCreate"].ToString (); //TODO String PlayingDataDirectory = Path.Combine(LocalWPMediaRoot, XML_SENDER_AUTO_CONTROL_DIRECTORY); String PlayingDataDirectory = Path.Combine(WPMediaServerRootDirectory, XML_SENDER_AUTO_CONTROL_DIRECTORY); if (!Directory.Exists (PlayingDataDirectory)) Directory.CreateDirectory (PlayingDataDirectory); String FileName = Path.Combine (PlayingDataDirectory, ControlFileName + AUTO_CONTROL_FILE_EXT_EXTENSION_SHORT); Description.FillIndexIndizess (); WPMediaStandbildPlayingData EarlierDescription = GetWPMediaStandbildPlayingDataFromAssembledFile (FileName); // EarlierDescription.ClearAllRandomElements(); if (PlayingDataObjectsAreEqual(EarlierDescription, Description)) return; MemoryStream ContentOfPlayingData = AssembleContentOfPlayingData(Description, Convert.ToString(Description.OverallPlayLength), Description.TableName, "StandbildTV"); bool CorrectDeleted = true; if (File.Exists (FileName)) { CorrectDeleted = CommonDataBase.CommonBasics.SecureFileDelete (FileName, null); } if (CorrectDeleted) { FileStream TargetFile = File.Open (FileName, FileMode.Create, FileAccess.Write); ContentOfPlayingData.WriteTo(TargetFile); TargetFile.Close (); } ContentOfPlayingData.Close (); }
private void SchedulingWindow_Loaded (object sender, RoutedEventArgs e) { m_ProgrammManagement = new WPMediaManagement.ManagedProgrammManagement (); CommonDataBase.CommonBasics.LoadWPMediaParameter (); m_CVM = new CVM.CommonValues (); m_XAMLHandling = new CVM.XAMLHandling (m_CVM); WMB.WPMediaApplicationState.Instance.Properties ["DataBase"] = DataBase; //CVM.LoginHandler.ApplicationName = "WPTV"; //String userName = String.Empty; //m_Rollen = CVM.LoginHandler.CheckUser (ref userName); //if (m_Rollen == null) // { // Close (); // return; // } Cursor = Cursors.Wait; m_IntelliSenseFactory = new IntelliSenseAutoCompletionFactoryRoutines (DataBase); m_ControlFactory.m_Factory = m_IntelliSenseFactory; //m_XAMLHandling.ShowGridLines = true; Width = 900; Height = 650; m_RootGrid = m_XAMLHandling.CreateGrid (new int [] { 100 }, new int [] { 55, 70, 40 }); this.Content = m_RootGrid; this.Background = SystemColors.ControlLightBrush; CreateAllGrids (); CreateAllControls (); FillSenderComboBox (); SetEventHandler (); Cursor = Cursors.Arrow; if (!ExternalControlServer.HookedInTheCommandProcessingChain ("SchedulingWindow")) { ExternalControlServer.MessageReceivedCall += new ExternalControlServer.MessageReceivedEvent (ExternalRequest_MessageReceivedCall); ExternalControlServer.HookeIntoTheCommandProcessingChain ("SchedulingWindow"); } // ExternalControlServer.StartListening (); }
public void SetParameter () { PageIndexToProcessAfterRestart = -1; if (WMB.Basics.IsTestRun) WMB.Basics.ReportInformationToEventViewer ("StandBildTV.SetParameter", "Mit folgenden Parametern:\r\n" + GetParameterString ()); SchedulingDefinedOverallTimeSpan = TimeSpan.MinValue; OutsideDefinedPictureDuration = TimeSpan.MinValue; if (!String.IsNullOrEmpty (WMB.Basics.GetCommandLineContent (m_Arguments, CVM.CommonValues.WPMEDIA_PICTURE_DURATION))) OutsideDefinedPictureDuration = TimeSpan.FromSeconds (Convert.ToDouble (WMB.Basics.GetCommandLineContent (m_Arguments, CVM.CommonValues.WPMEDIA_PICTURE_DURATION))); if (!String.IsNullOrEmpty (WMB.Basics.GetCommandLineContent (m_Arguments, CVM.CommonValues.WPMEDIA_DURATION_PARAMETER))) { SchedulingDefinedOverallTimeSpan = TimeSpan.FromSeconds (Convert.ToDouble (WMB.Basics.GetCommandLineContent (m_Arguments, CVM.CommonValues.WPMEDIA_DURATION_PARAMETER))); SchedulingDefinedStopDateTime = DateTime.Now + SchedulingDefinedOverallTimeSpan; } if (SchedulingDefinedOverallTimeSpan == TimeSpan.MinValue) if (!String.IsNullOrEmpty (WMB.Basics.GetCommandLineContent (m_Arguments, CVM.CommonValues.WPMEDIA_STOP_TIME_PARAMETER))) { SchedulingDefinedStopDateTime = DateTime.Parse (WMB.Basics.GetCommandLineContent (m_Arguments, CVM.CommonValues.WPMEDIA_STOP_TIME_PARAMETER)); SchedulingDefinedOverallTimeSpan = SchedulingDefinedStopDateTime - DateTime.Now; } if (WMB.Basics.IsTestRun) { WMB.Basics.ReportInformationToEventViewer (m_MessageDescriptionID + ".SetParameter", "Aufruf mit:\r\n" + GetParameterString ()); } TypeOfBeitrag = WMB.Basics.GetCommandLineContent (m_Arguments, CVM.CommonValues.WPMEDIA_TYPE_OF_BEITRAG); if (TypeOfBeitrag == WPMediaManagement.ManagedProgrammData.Type_UtilityDisplay) { ExtensionOfPrimaryControlFile = Path.GetExtension (m_Arguments [1]).ToUpper (); if (ExtensionOfPrimaryControlFile == ".EXT") { if (m_StandBildPlayingData == null) { m_StandBildPlayingData = m_HostCVM.DeSerializedDesriptionObject as CVM.WPMediaStandbildPlayingData; } if (m_StandBildPlayingData == null) { WMB.Basics.ReportErrorToEventViewer (m_MessageDescriptionID + ".SetParameter", "m_StandBildPlayingData == null-Deserialization hat nicht funktioniert"); return; } ProcessExtFileDisplay (m_Arguments [1], m_StandBildPlayingData); m_HostCVM.TimeToStop = DateTime.Now.AddSeconds (m_StandBildPlayingData.GetFullDuration ()); // return; } if (ExtensionOfPrimaryControlFile == ".SER") { ProcessSerFileDisplay (m_Arguments [1]); return; } if (ExtensionOfPrimaryControlFile == ".PKG") { m_StandBildPlayingData = new WPMediaStandbildPlayingData(); m_StandBildPlayingData.StandBildTVVersion = "PKG_Version"; m_StandBildPlayingData.FillDefaultsForSimpleUsages (m_Arguments[1]); m_StandBildPlayingData.TableName = WPMediaManagement.ManagedProgrammData.Type_MultipleTable; } else { if ((m_StandBildPlayingData == null) && (m_HostCVM.DeSerializedDesriptionObject != null)) { m_StandBildPlayingData = m_HostCVM.DeSerializedDesriptionObject as CVM.WPMediaStandbildPlayingData; } if (m_StandBildPlayingData == null) { WMB.Basics.ReportErrorToEventViewer(m_MessageDescriptionID + ".SetParameter", "m_StandBildPlayingData == null-Deserialization hat nicht funktioniert"); return; } } } else if (TypeOfBeitrag == WPMediaManagement.ManagedProgrammData.Type_MultipleTable) { if (m_StandBildPlayingData == null) { m_StandBildPlayingData = m_HostCVM.DeSerializedDesriptionObject as CVM.WPMediaStandbildPlayingData; } if (m_StandBildPlayingData == null) { WMB.Basics.ReportErrorToEventViewer (m_MessageDescriptionID + ".SetParameter", "m_StandBildPlayingData == null-Deserialization bei Type_MultipleTable hat nicht funktioniert"); return; } } else { if (m_StandBildPlayingData == null) { m_StandBildPlayingData = m_HostCVM.DeSerializedDesriptionObject as CVM.WPMediaStandbildPlayingData; } if (m_StandBildPlayingData == null) { WMB.Basics.ReportErrorToEventViewer (m_MessageDescriptionID + ".SetParameter", "m_StandBildPlayingData == null-Deserialization bei Type_UtilityDisplay hat nicht funktioniert"); return; } if ((SchedulingDefinedOverallTimeSpan != TimeSpan.MinValue) && (TimingTypeForAllEntries == CVM.CommonValues.WPMEDIA_ENTRY_TIMING_TYPE_APPROXIMATELY)) { if (((m_StandBildPlayingData.OverallPlayLength * (1 - (PercentageOfAllowedDefinedToAvailableDuration / 100))) < SchedulingDefinedOverallTimeSpan.TotalSeconds) && ((m_StandBildPlayingData.OverallPlayLength * (1 + (PercentageOfAllowedDefinedToAvailableDuration / 100))) > SchedulingDefinedOverallTimeSpan.TotalSeconds)) m_StandBildPlayingData.CorrectPagePlayingDurations (SchedulingDefinedOverallTimeSpan); } } StopHasBeenSet = false; m_MessageDescriptionID = "StandBildTV_" + m_StandBildPlayingData.TableName; if (m_XAML == null) m_XAML = new XAMLHandling (m_HostCVM); m_XAML.ShowGridLines = false; m_DirectoryToProcessIndex = m_HostCVM.DirectoryToProcessIndex; if (m_DirectoryToProcessIndex != 0) throw new Exception ("Mehr als ein Directory ist dzt. nicht implementiert"); FinalStopTime = m_HostCVM.TimeToStop; PageIndexToProcessAfterRestart = 0; SetParameterForFirstPlayableFile (m_StandBildPlayingData); }
/* private static void ReloadDefaultFormatDefinitions(WCFStandardsNS.WCFStandards DataBase, DataSet FormatierDataSet) { CommonValues m_CVM = new CommonValues (); XAMLHandling m_XAML = new XAMLHandling (m_CVM); m_XAML.CreateDefaultFormatDataSet (DataBase, FormatierDataSet, CommonDataBase.DataBase.GetLocalWPMediaRoot ()); } */ /* public static List<PositioningEntry> ShowIdentifiedFrames ( double DrawingWidth, Grid RootGridForAllDrawings, DataSet FormatierDataSet, String PageIDToProcess, String LocalWPMediaRoot, RedrawMeEvent RedrawMeEventCall) { Singleton SingletonInstance = Singleton.Instance; int LastSelectedIndex = DeleteExistingFrames (SingletonInstance.ListOfPositioningEntryInstances); double TargetPictureWidth = Convert.ToDouble (FormatierDataSet.Tables ["TableDefinitions"].Rows [0] ["TargetWidth"]); double TargetPictureHeight = Convert.ToDouble (FormatierDataSet.Tables ["TableDefinitions"].Rows [0] ["TargetHeight"]); double TargetAspectRatio = TargetPictureWidth / TargetPictureHeight; double ResizingFactor = TargetPictureWidth / DrawingWidth; TargetPictureWidth /= ResizingFactor; TargetPictureHeight /= ResizingFactor; int LocalRootGridLastIndexNotToDelete = RootGridForAllDrawings.Children.Count; if (SingletonInstance.ListOfPositioningEntryInstances == null) SingletonInstance.ListOfPositioningEntryInstances = new List<PositioningEntry> (); SingletonInstance.FormatierDataSet = FormatierDataSet; foreach (DataRow PictureRow in FormatierDataSet.Tables ["PictureDefinitions"].Select ("PageID = '" + PageIDToProcess + "'", "PicturePlayingOrder")) { PositioningEntry PictureWindow = new PositioningEntry (); PictureWindow.RootUIElement = RootGridForAllDrawings; PictureWindow.TypeOfPositioning = "Picture"; PictureWindow.ConnectedID = PictureRow ["ID"].ToString (); PictureWindow.PositionPercentageTop = Convert.ToDouble (PictureRow ["PositionTop"]); PictureWindow.PositionPercentageLeft = Convert.ToDouble (PictureRow ["PositionLeft"]); PictureWindow.PositionPercentageBottom = Convert.ToDouble (PictureRow ["PositionBottom"]); PictureWindow.PositionPercentageRight = Convert.ToDouble (PictureRow ["PositionRight"]); PictureWindow.AddOnText = PictureRow ["NameID"].ToString (); PictureWindow.OriginRow = PictureRow; SingletonInstance.ListOfPositioningEntryInstances.Add (PictureWindow); } foreach (DataRow TextBlockRow in FormatierDataSet.Tables ["BlockDefinitions"].Select ("PageID = '" + PageIDToProcess + "'", "BlockPlayingOrder")) { PositioningEntry TextWindow = new PositioningEntry (); TextWindow.RootUIElement = RootGridForAllDrawings; TextWindow.TypeOfPositioning = "Text"; TextWindow.ConnectedID = TextBlockRow ["ID"].ToString (); TextWindow.PositionPercentageTop = Convert.ToDouble (TextBlockRow ["MinPositionTop"]); TextWindow.PositionPercentageLeft = Convert.ToDouble (TextBlockRow ["MinPositionLeft"]); TextWindow.PositionPercentageBottom = Convert.ToDouble (TextBlockRow ["MaxPositionBottom"]); TextWindow.PositionPercentageRight = Convert.ToDouble (TextBlockRow ["MaxPositionRight"]); TextWindow.AddOnText = TextBlockRow ["NameID"].ToString (); TextWindow.OriginRow = TextBlockRow; TextWindow.BlockRotation = 0; if (!Convert.IsDBNull (TextBlockRow ["BlockRotation"])) TextWindow.BlockRotation = Convert.ToDouble (TextBlockRow ["BlockRotation"]); SingletonInstance.ListOfPositioningEntryInstances.Add (TextWindow); } CVM.CloseRequested PosWindow_CloseRequestedEntry = new CloseRequested (PosWindow_CloseRequestedCall); Canvas PositioningCanvas = new Canvas (); PositioningCanvas.MinWidth = TargetPictureWidth; PositioningCanvas.Width = TargetPictureWidth; PositioningCanvas.MinHeight = TargetPictureHeight; PositioningCanvas.Height = TargetPictureHeight; PositioningCanvas.AllowDrop = true; RootGridForAllDrawings.Children.Add (PositioningCanvas); int Index = 0; PositioningEntry PosWindowToSelect = null; foreach (PositioningEntry PosWindow in SingletonInstance.ListOfPositioningEntryInstances) { PosWindow.RootGrid = RootGridForAllDrawings; PosWindow.RootGridLastIndexNotToDelete = LocalRootGridLastIndexNotToDelete; PosWindow.AllFrames = SingletonInstance.ListOfPositioningEntryInstances; PosWindow.PositioningCanvas = PositioningCanvas; PosWindow.CloseRequestedCall += PosWindow_CloseRequestedEntry; PosWindow.TargetPictureWidth = TargetPictureWidth; PosWindow.TargetPictureHeight = TargetPictureHeight; PosWindow.TargetAspectRatio = TargetAspectRatio; PosWindow.ResizingFactor = ResizingFactor; PosWindow.FramingRectangle = PosWindow.ShowPositioningEntry (PosWindow.TypeOfPositioning, PosWindow.AddOnText); PositioningCanvas.Children.Add (PosWindow.FramingRectangle); Canvas.SetLeft (PosWindow.FramingRectangle, PosWindow.Left); Canvas.SetTop (PosWindow.FramingRectangle, PosWindow.Top); PosWindow.RedrawMeEventCall += RedrawMeEventCall; PosWindow.PageID = PageIDToProcess; if (Index == LastSelectedIndex) PosWindowToSelect = PosWindow; Index++; } if (PosWindowToSelect != null) { PosWindowToSelect.PositionableEntry_MouseDown (PosWindowToSelect.FramingRectangle, null); } return SingletonInstance.ListOfPositioningEntryInstances; } */ public static DrawingGroup InsertPageLayerFramingRectangles (XAMLHandling m_Xaml, DataSet FormatierDataSet, String LocalWPMediaRoot, DataRow ContentRow, String PageID, double OriginalWidth, double OriginalHeight) { DataRow [] PictureRows = FormatierDataSet.Tables ["PictureDefinitions"].Select ("PageID = '" + PageID + "'", "PicturePlayingOrder"); Image FullPicture = new Image (); Grid PageGrid = m_Xaml.CreateGrid (new int [] { 100, FramingAroundPercentage }, new int [] { 100, FramingAroundPercentage }); FullPicture.MinWidth = OriginalWidth * MaxFactor; FullPicture.MinHeight = OriginalHeight * MaxFactor; FullPicture.Width = OriginalWidth * MaxFactor; FullPicture.Height = OriginalHeight * MaxFactor; PageGrid.Children.Add (FullPicture); Grid.SetColumnSpan (FullPicture, 2); Grid.SetRowSpan (FullPicture, 2); Grid PictureGrid = new Grid (); PageGrid.Children.Add (PictureGrid); Image PageImage = new Image (); PictureGrid.Children.Add (PageImage); DrawingGroup FramingGroup = new DrawingGroup (); FramingGroup.ClipGeometry = new RectangleGeometry (new Rect (0, 0, OriginalWidth, OriginalHeight)); DrawingImage AllDrawingsImage = new DrawingImage (FramingGroup); PageImage.Source = AllDrawingsImage; //InsertDisposeableElement (PageImage); //InsertDisposeableElement (FullPicture); //InsertDisposeableElement (FramingGroup); //InsertDisposeableElement (AllDrawingsImage); PictureGrid.UpdateLayout (); foreach (DataRow PictureRow in PictureRows) { DataRow [] PhysicalPictureRows = FormatierDataSet.Tables ["ConnectPictures"] .Select ("PictureID = '" + PictureRow ["ID"].ToString () + "'"); foreach (DataRow PhysicalPictureRow in PhysicalPictureRows) { String NameID = PhysicalPictureRow ["PictureNameID"].ToString (); if ((NameID == "VideoOverlay") && (m_Xaml.ShowGridLines == false)) continue; if (!Path.IsPathRooted (PhysicalPictureRow ["PictureFileName"].ToString ())) PhysicalPictureRow ["PictureFileName"] = Path.Combine (LocalWPMediaRoot, PhysicalPictureRow ["PictureFileName"].ToString ()); //InsertPictureLayer (PictureRow, FramingGroup, PhysicalPictureRow, OriginalWidth, OriginalHeight); } } PictureGrid.UpdateLayout (); DataRow [] BlockRows = FormatierDataSet.Tables ["BlockDefinitions"].Select ("PageID = '" + PageID + "'", "BlockPlayingOrder"); Grid TextGrid = new Grid (); PageGrid.Children.Add (TextGrid); Grid.SetColumn (TextGrid, 0); Grid.SetColumnSpan (TextGrid, 2); Grid.SetRow (TextGrid, 0); Grid.SetRowSpan (TextGrid, 2); TextGrid.UpdateLayout (); foreach (DataRow BlockRow in BlockRows) { //InsertBlockLayer (FormatierDataSet, BlockRow, TextGrid, ContentRow, // OriginalWidth, OriginalHeight); } PageGrid.Arrange (new Rect (0, 0, OriginalWidth * MaxFactor, OriginalHeight * MaxFactor)); return FramingGroup; // PageGrid; }
public CreateStandbildTVUnits () { m_CVM = new CommonValues (); m_XAMLHandling = new XAMLHandling (m_CVM); DateTimeToCheck = DateTime.Now; }