private void FillFields(Game G) { GameNameTextbox.Text = G.Name; GenreTextbox.Text = G.Genre; DescriptionTextBox.Text = G.Description; DateTextbox.Value = G.Release; MetacriticLink.Text = G.MetacriticsCheckLink; CriticsTextbox.Text = G.MetacriticsCritics.ToString(); UserTextbox.Text = G.MetacriticsUserScore.ToString(); byte[] b = G.Poster.ToArray(); MemoryStream ms = new MemoryStream(b); PosterBox.BackgroundImage = Image.FromStream(ms); b = G.Icon.ToArray(); ms = new MemoryStream(b); IconBox.BackgroundImage = Image.FromStream(ms); ms = null; //images OSComboBox.SelectedItem = G.MinOS; OSArchitectureComboBox.SelectedItem = G.MinOSArchitecture.ToString(); MinFreeDiskTextbox.Text = G.MinDiskSpace.ToString(); MinRAMTextbox.Text = G.MinRAM.ToString(); MinCPUTextbox.Text = G.MinProcesorName; MinCPUCoresTextbox.Text = G.MinProcessorCores.ToString(); MinCPUThreadsTextbox.Text = G.MinProcessorThreads.ToString(); MinCPUSpeedTextbox.Text = G.MinProcessorClock.ToString(); MinGPUNameTextbox.Text = G.MinGPUName; MinGPUCoreClockTextbox.Text = G.MinGPUClock.ToString(); MinGPUMemoryClockTextbox.Text = G.MinGPUMemoryClock.ToString(); MinGPUMemoryCapacityTextbox.Text = G.MinGPUMemoryCapacity.ToString(); MinGPUBusWidthTextbox.Text = G.MinGPUBusWidth.ToString(); MinGPUMemoryTypeTextbox.Text = G.MinGPUMemoryType; MinGPUDirectXTextbox.Text = G.MinGPUDirectX; MinGPUShadersTextbox.Text = G.MinGPUShaderUnitCount.ToString(); MinGPUROPsTextbox.Text = G.MinGPUROPCount.ToString(); MinGPUTMUsTextbox.Text = G.MinGPUTMUCount.ToString(); if(!string.IsNullOrEmpty(G.RecProcesorName) || !string.IsNullOrEmpty(G.RecGPUName)) { RecRAMTextbox.Text = G.RecRAM.ToString(); RecCPUTextbox.Text = G.RecProcesorName; RecCPUCoresTextbox.Text = G.RecProcessorCores.ToString(); RecCPUThreadsTextbox.Text = G.RecProcessorThreads.ToString(); RecCPUSpeedTextbox.Text = G.RecProcessorClock.ToString(); RecGPUNameTextbox.Text = G.RecGPUName; RecGPUCoreClockTextbox.Text = G.RecGPUClock.ToString(); RecGPUMemoryClockTextbox.Text = G.RecGPUMemoryClock.ToString(); RecGPUMemoryCapacityTextbox.Text = G.RecGPUMemoryCapacity.ToString(); RecGPUBusWidthTextbox.Text = G.RecGPUBusWidth.ToString(); RecGPUMemoryTypeTextbox.Text = G.RecGPUMemoryType; RecGPUDirectXTextbox.Text = G.RecGPUDirectX; RecGPUShadersTextbox.Text = G.RecGPUShaderUnitCount.ToString(); RecGPUROPsTextbox.Text = G.RecGPUROPCount.ToString(); RecGPUTMUsTextbox.Text = G.RecGPUTMUCount.ToString(); } var query = from GameToPlatform in QuarableGTP where GameToPlatform.Game == G select GameToPlatform; foreach (GameToPlatform gtp in query) { ListboxPlatforms.SetSelected(gtp.PlatformId - 9, true); } }
private void ClearFields() { if (SelectedDatabase.SelectedItem.ToString() == "Games") { foreach (Control c in MainTableLayout.Controls) { if (c.GetType() == GameNameTextbox.GetType() || c.GetType() == DescriptionTextBox.GetType()) c.Text = ""; } DateTextbox.Value = DateTime.Today; DataChanged = false; PosterBox.BackgroundImage = null; IconBox.BackgroundImage = null; SelectedGame = null; for(int i = 0; i < ListboxPlatforms.Items.Count; i++) { ListboxPlatforms.SetSelected(i, false); } } if (SelectedDatabase.SelectedItem.ToString() == "Platforms") { foreach (Control c in PlatformTableLayout.Controls) { if (c.GetType() == PlatformNameTextbox.GetType()) c.Text = ""; } PlatformIconBox.BackgroundImage = null; SelectedPlatform = null; } }