/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here { int Wall = TagsSingleton.TAG_Wall.ID; GraphicsSingleton gfx = GraphicsSingleton.Instance; } base.Initialize(); SceneGameStart gameStart = new SceneGameStart(); Scene = gameStart; }
public static List<PositioningEntry> ShowFrameGeometry (double DrawingWidth, GraphicsHandling GraphicsHandler, CVM.RedrawInformation RedrawData, Grid RootGridForAllDrawings, String PageIDToProcess, RedrawMeEvent RedrawMeEventCall, GraphicsSingleton.DoThisAfterContextProcessingEvent DoThisAfterContextProcessingCall, SetUIElementsEnabelingToEvent SetUIElementsEnabelingToEventHandlerParameter, CVM.ActivatePageIDEvent ActivatePageIDEventHandler, CVM.GetBeitragsDatenFromBeitragsIDEvent GetBeitragsDatenFromBeitragsIDParameter, WMB.CloseRequested PosWindow_CloseRequestedEntry, RedrawFrameGeometryEvent RedrawFrameGeometryCall) { RedrawMeEventHandler = RedrawMeEventCall; DoThisAfterContextProcessingEventHandler = DoThisAfterContextProcessingCall; SetUIElementsEnabelingToEventHandler = SetUIElementsEnabelingToEventHandlerParameter; GetBeitragsDatenFromBeitragsIDHandler = GetBeitragsDatenFromBeitragsIDParameter; GraphicsSingleton SingletonInstance = GraphicsSingleton.Instance; SingletonInstance.SetDoThisAfterContextProcessingCall (DoThisAfterContextProcessingCall); SingletonInstance.RedrawData = RedrawData; //DeleteExistingFrames (SingletonInstance.ListOfPositioningEntryInstances); TargetAspectRatio = GraphicsHandler.TargetPictureWidth / GraphicsHandler.TargetPictureHeight; ResizingFactor = GraphicsHandler.TargetPictureWidth / DrawingWidth; TargetPictureWidth = GraphicsHandler.TargetPictureWidth / ResizingFactor; TargetPictureHeight = GraphicsHandler.TargetPictureHeight / ResizingFactor; PositioningEntry.TargetPictureWidth = TargetPictureWidth; PositioningEntry.TargetPictureHeight = TargetPictureHeight; PositioningEntry.TargetAspectRatio = TargetAspectRatio; PositioningEntry.ResizingFactor = ResizingFactor; int LocalRootGridLastIndexNotToDelete = RootGridForAllDrawings.Children.Count; if (SingletonInstance.ListOfPositioningEntryInstances == null) SingletonInstance.ListOfPositioningEntryInstances = new List<PositioningEntry> (); // by sac SingletonInstance.GraphicsHandler.ClearRootCanvas (); SingletonInstance.GraphicsHandler.RootCanvasForDrawingActivities.MinWidth = TargetPictureWidth; SingletonInstance.GraphicsHandler.RootCanvasForDrawingActivities.Width = TargetPictureWidth; SingletonInstance.GraphicsHandler.RootCanvasForDrawingActivities.MinHeight = TargetPictureHeight; SingletonInstance.GraphicsHandler.RootCanvasForDrawingActivities.Height = TargetPictureHeight; SingletonInstance.GraphicsHandler.RootCanvasForDrawingActivities.AllowDrop = true; int DuplicationID = RedrawData.PageIndex; Image TargetImage = RedrawData.TargetImage; DataRow PageRow = GraphicsHandler.FrameDataDataSetReader.Tables ["Pages"] .Select ("ID = '" + RedrawData.PageID + "'") [0]; DataRow [] FrameContentRows = GraphicsHandler.FrameDataDataSetReader.Tables ["FrameContent"] .Select ("PageID = '" + RedrawData.PageID + "'", "FrameOrder"); foreach (DataRow FrameContentRow in FrameContentRows) { if (DuplicationID != -1) if ((Convert.ToInt32 (FrameContentRow ["MultiPageIndex"]) != -1) && (Convert.ToInt32 (FrameContentRow ["MultiPageIndex"]) != DuplicationID)) continue; if (!String.IsNullOrEmpty (FrameContentRow ["ItemName"].ToString ())) if (GraphicsHandler.ActuallReadableContentRow.Table.Columns [FrameContentRow ["ItemName"].ToString ()] == null) continue; DataRow [] FrameRows = GraphicsHandler.FrameDataDataSetReader.Tables ["Frames"] .Select ("ID = '" + FrameContentRow ["FrameID"].ToString () + "'"); if (FrameRows.Length != 1) { Basics.ReportErrorToEventViewer ("GraphicsHandling.ShowFrameGeometry", "Fehler in der Frame und FrameContent Kombination:\r\n" + "FrameContentID = \"" + FrameContentRow ["ID"].ToString () + "\" NameID = \"" + FrameContentRow ["NameID"].ToString () + "\r\nFrameID = \"" + FrameContentRow ["FrameID"].ToString () + "\""); MessageBox.Show ("Fehler in der Frame und FrameContent Kombination:\r\n" + "FrameContentID = \"" + FrameContentRow ["ID"].ToString () + "\" NameID = \"" + FrameContentRow ["NameID"].ToString () + "\r\nFrameID = \"" + FrameContentRow ["FrameID"].ToString () + "\""); continue; } bool Found = false; String FrameID = FrameContentRow ["FrameID"].ToString (); foreach (PositioningEntry ExistingPositioningEntryInstance in SingletonInstance.ListOfPositioningEntryInstances) { if (ExistingPositioningEntryInstance.FrameID == FrameID) { ExistingPositioningEntryInstance.FillMeFromDataBase (); Found = true; break; } } if (Found == false) { PositioningEntry NewPositioningEntryInstance = new PositioningEntry (); NewPositioningEntryInstance.FrameRow = FrameRows [0]; NewPositioningEntryInstance.FrameID = FrameID; NewPositioningEntryInstance.FrameContentRow = FrameContentRow; PositioningEntry.SetUIElementsEnabelingToEventHandler = SetUIElementsEnabelingToEventHandler; PositioningEntry.ActivatePageIDEventHandler = ActivatePageIDEventHandler; NewPositioningEntryInstance.RootUIElement = RootGridForAllDrawings; NewPositioningEntryInstance.RedrawMeEventCall += RedrawMeEventCall; NewPositioningEntryInstance.RedrawFrameGeometryCall += RedrawFrameGeometryCall; NewPositioningEntryInstance.PageID = PageIDToProcess; NewPositioningEntryInstance.RootGrid = RootGridForAllDrawings; NewPositioningEntryInstance.RootGridLastIndexNotToDelete = LocalRootGridLastIndexNotToDelete; // NewPositioningEntryInstance.AllFrames = SingletonInstance.ListOfPositioningEntryInstances; NewPositioningEntryInstance.CloseRequestedCall += PosWindow_CloseRequestedEntry; NewPositioningEntryInstance.FillMeFromDataBase (); SingletonInstance.ListOfPositioningEntryInstances.Add (NewPositioningEntryInstance); } } int Index = 0; PositioningEntry PosWindowToSelect = null; foreach (PositioningEntry PosEntry in SingletonInstance.ListOfPositioningEntryInstances) { if (SingletonInstance.GraphicsHandler.RootCanvasForDrawingActivities .Children.Contains (PosEntry.FramingRectangle) == false) SingletonInstance.GraphicsHandler.RootCanvasForDrawingActivities.Children.Add (PosEntry.FramingRectangle); Canvas.SetLeft (PosEntry.FramingRectangle, PosEntry.Left); Canvas.SetTop (PosEntry.FramingRectangle, PosEntry.Top); if (Index == LastSelectedIndex) PosWindowToSelect = PosEntry; Index++; } //if (PosWindowToSelect != null) // { // PosWindowToSelect.PositionableEntry_MouseDown (PosWindowToSelect.FramingRectangle, null); // } if (Basics.IsTestRun) Basics.ReportInformationToEventViewer ("PositioningEntry.ShowFrameGeometry (static)", "SingletonInstance.ListOfPositioningEntryInstances mit " + Convert.ToString (SingletonInstance.ListOfPositioningEntryInstances.Count) + " returned"); return SingletonInstance.ListOfPositioningEntryInstances; }