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); }
/* 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; }
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 (); }
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); }
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); }