void Search_btnClick(object sender, EventArgs e) { if (search_textBox.Text != "") { LoadingForm load_frm = new LoadingForm(); load_frm.StartPosition = FormStartPosition.CenterScreen; load_frm.Show(); load_frm.Update(); WebClient webClient = new WebClient(); Debug.WriteLine(String.Format("https://www.googleapis.com/customsearch/v1?key={0}&cx={1}&q={2}&alt=json", apiKey, cx, search_textBox.Text)); load_frm.Update(); string result = webClient.DownloadString(String.Format("https://www.googleapis.com/customsearch/v1?key={0}&cx={1}&q={2}&alt=json", apiKey, cx, search_textBox.Text)); load_frm.Update(); var jsonData = JObject.Parse(result); load_frm.Update(); //logger_richTextBox.AppendText(jsonData["items"].ToString()); load_frm.Update(); logger_richTextBox.Clear(); load_frm.Update(); int link_counter = 1; foreach (JObject obj in (JArray)jsonData["items"]) { load_frm.Update(); logger_richTextBox.AppendText("لينك" + link_counter + ": " + obj["link"].ToString() + Environment.NewLine); link_counter++; load_frm.Update(); } load_frm.Update(); load_frm.Close(); } }
private async Task Guardar() { if (IsValid()) { var loading = new LoadingForm(); BeginInvoke((Action)(() => loading.ShowDialog())); var entity = new Puesto() { PuestoId = idSelected, Nombre = txtNombre.Text, Cupo = (int)txtCupo.Value, NivelMinimoSalario = txtSalarioMin.Value, NivelMaximoSalario = txtSalarioMax.Value, NivelRiesgo = txtRiesgo.Text, Estado = true }; db.Puestos.AddOrUpdate(entity); await db.SaveChangesAsync(); Clean(); LoadEntities(); idSelected = 0; loading.Close(); } }
private void bg_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { // Закрыть loading form и это окно. loadingForm.WorkEnded = true; loadingForm.Close(); this.DialogResult = true; }
private async void OnPull(object sender, EventArgs e) { LoadingForm loadingForm = new LoadingForm(); loadingForm.Show(ActiveCanvas.FindForm()); await Task.Run(() => PullRepository()); loadingForm.Close(); }
private async void OnPush(object sender, EventArgs e) { LoadingForm loadingForm = new LoadingForm(); loadingForm.Show(ActiveCanvas.FindForm()); await Task.Run(() => DocumentPush()); loadingForm.Close(); }
public void endTutorial() { // post del tour if (countStep == 0) { new PopupNotification("Error", "Debe agregar al menos un paso."); } else { loadingForm = new LoadingForm(); loadingForm.Show(); var tourController = new TourController(); tour.user_id = Constants.user._id; var tourResponse = tourController.PostAsync(tour).Result; // post de los audios var allAudioResponse = true; for (int i = 0; i < countStep; i++) { var nameTourWithoutSpace = tour.name.Replace(" ", ""); var audioName = "/Audio" + nameTourWithoutSpace + i + ".wav"; var filename = Constants.audioPath + audioName; if (File.Exists(filename)) { allAudioResponse = allAudioResponse && tourController.PostAudio(filename, tourResponse._id, tourResponse.steps[i]._id).Result; } } loadingForm.Close(); webBrowser.Refresh(); if (tourResponse._id != null && allAudioResponse) { new PopupNotification("Fin del tutorial", "Tutorial Terminado! Se guardaron " + countStep.ToString() + " pasos"); } else { new PopupNotification("Error", "Un error ha ocurrido tratando de conectar al servidor."); } formBar.Hide(); stepsBar.Hide(); tourBar.Hide(); if (!(textPopup == null)) { textPopup.Hide(); } Constants.tours = tourController.GetAllToursAsync().Result; asistimeAppBar.Show(); } }
private async void PerformEncode() { //==================================== LoadingForm loadingform = new LoadingForm("Encoding File into Base64"); this.Enabled = false; loadingform.Show(this); //==================================== this._EncodedValue = await TestController.EncodeBase64Async(this.txtParameterValue.Text); //==================================== loadingform.Close(); this.Enabled = true; this.Focus(); }
private async void MerchantItemsControl_Load(object sender, EventArgs e) { var loading = new LoadingForm { ProgressText = { Text = @"Loading: Items" } }; loading.Show(); _items = await _itemService.GetItems(); loading.Close(); }
public void PlayTour(Tour tour) { //Mostrar la barra de tour this.actualTour = tour; this.Show(); tourBar = new AsistimeTourBar() { Parent = this }; tourBar.Location = new System.Drawing.Point(0, 0); tourBar.StepCount = 0; this.Controls.Add(tourBar); tourBar.Show(); this.asistimeAppBar.Hide(); loadingForm = new LoadingForm(); loadingForm.Show(); //Instanciar el controller para el tour var tourController = new TourController(); tour = tourController.GetTourAsync(tour._id).Result; // GET AUDIO var audioResult = true; createDirectory(); for (int i = 0; i < tour.steps.Count; i++) { if (tour.steps[i].audio != null) { audioResult = audioResult && tourController.GetAudio(tour._id, tour.steps[i]._id).Result; } } tourLoad = tour; countLoad = 0; tourBar.TourInititated(tour); loadingForm.Close(); //Reproducir el paso 0 var firstStep = tour.steps[0]; webBrowser.Navigate(firstStep.url); actualURL = ""; //Mostrar mensaje de confirmación new PopupNotification("Inicio Tour", "Comienza el tour"); }
private void BgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (loadingForm != null) { loadingForm.Close(); loadingForm = null; } if (!finishCallback.Equals(String.Empty)) { Type type = obj.GetType(); MethodInfo theMethod = type.GetMethod(finishCallback); theMethod.Invoke(obj, null); } }
private async Task Save() { var loading = new LoadingForm { ProgressText = { Text = @"Saving list" } }; loading.Show(); var templateId = await _merchantItemService.Save(_merchantItems, txtItemListId.Text); loading.Close(); LoadItems(templateId); }
private void OnClone(object sender, EventArgs e) { DoubleInput cloneForm = new DoubleInput(); cloneForm.Text = "Clone remote repository"; cloneForm.label1.Text = "Remote Url"; cloneForm.label2.Text = "Local Path"; cloneForm.input2.Cursor = Cursors.Hand; cloneForm.input2.Text = "Click me !"; cloneForm.input2.ReadOnly = true; cloneForm.input2.Click += (ed, eg) => { if (cloneForm.input1.Text == "") { MessageBox.Show("No remote url found"); return; } FolderBrowserDialog folder = new FolderBrowserDialog(); DialogResult res = folder.ShowDialog(); if (res == DialogResult.OK || res == DialogResult.Yes) { Uri uri = new Uri(cloneForm.input1.Text); string name = uri.Segments[uri.Segments.Length - 1].TrimEnd('/').Split('.')[0]; cloneForm.input2.Text = Path.Combine(@folder.SelectedPath, name); } }; cloneForm.Show(); cloneForm.ConfirmEvent += async(sd, url, path) => { LoadingForm loadingForm = new LoadingForm(); loadingForm.Show(ActiveCanvas.FindForm()); await Task.Run(() => CloneRepository(url, path)); loadingForm.Close(); cloneForm.Close(); Uri uri = new Uri(url); string name = uri.Segments[uri.Segments.Length - 1].TrimEnd('/').Split('.')[0]; MessageBox.Show(string.Format("{0} is Cloned to {1}", name, path)); }; }
public form1() { InitializeComponent(); // doWork(); dataSourceManager = new DataSourceManager(); LoadingForm loadingForm = new LoadingForm(); loadingForm.Show(); var getBeaconMacTask = dataSourceManager.upDateBeaconQue(); var getPhoneMacTask = dataSourceManager.upDatePhoneMac(); Task.WaitAll(getBeaconMacTask, getPhoneMacTask); loadingForm.Close(); this.WindowState = FormWindowState.Maximized; Console.WriteLine("Done"); //initForm(); }
private async void LootTemplateControl_VisibleChanged(object sender, EventArgs e) { if (!Visible) { return; } var loading = new LoadingForm { ProgressText = { Text = @"Loading: Mobs" } }; loading.Show(); BindingService.ToggleEnabled(this); _items = await _itemService.GetItems(); _mobs = await Task.Run(() => DatabaseManager.Database.SelectAllObjects <Mob>().ToList()); BindingService.ToggleEnabled(this); loading.Close(); }
private async void LootTemplateControl_VisibleChanged(object sender, EventArgs e) { if (!Visible) { return; } var loading = new LoadingForm { ProgressText = { Text = @"Loading: Mobs" } }; loading.Show(); BindingService.ToggleEnabled(this); _items = await _itemService.GetItems(); _mobs = await _mobService.GetMobs(); BindingService.ToggleEnabled(this); loading.Close(); }
private async Task Guardar() { if (IsValid()) { var loading = new LoadingForm(); BeginInvoke((Action)(() => loading.ShowDialog())); var entity = new Competencia() { CompetenciaId = idSelected, Descripcion = txtNombre.Text, Estado = comboBox1.SelectedItem.Equals("Activo") }; db.Competencias.AddOrUpdate(entity); await db.SaveChangesAsync(); Clean(); LoadEntities(); idSelected = 0; loading.Close(); } }
private async Task Guardar() { if (IsValid()) { var loading = new LoadingForm(); BeginInvoke((Action)(() => loading.ShowDialog())); var entity = new Idioma() { IdiomaId = idSelected, Nombre = txtNombre.Text, Estado = true }; db.Idiomas.AddOrUpdate(entity); await db.SaveChangesAsync(); Clean(); LoadEntities(); idSelected = 0; loading.Close(); } }
public static void CloseLoading() { loadingForm.Close(); }
static void Main(string[] args) { if (args == null || (args.Length != 1 && args.Length != 10)) { return; } ReportFileType fileType = ReportFileType.Report; DataSet dsDataset = null; if (args.Length == 1) { string filename = args[0]; if (filename.IndexOf("\n") > 0) { args = filename.Split("\n".ToCharArray()); if (args.Length != 10) { return; } } else if (filename.EndsWith(".wmks")) { wmksFileManager.WriteFile(filename); return; } else if (filename.EndsWith(".repx")) { string Inwfilename = filename.Replace(".repx", ".inw"); args = InwManager.ReadInwFile(Inwfilename); fileType = ReportFileType.InwFile; if (args == null) { args = ConfigFileManager.ReadDataConfig(filename); fileType = ReportFileType.BaseXmlFile; } } else if (filename.EndsWith(".repw")) { string Inwfilename = filename.Replace(".repw", ".inw"); args = InwManager.ReadInwFile(Inwfilename); fileType = ReportFileType.InwFile; if (args == null) { args = ConfigFileManager.ReadDataConfig(filename); fileType = ReportFileType.BaseXmlFile; } } else if (filename.EndsWith(".inw")) { args = InwManager.ReadInwFile(filename); fileType = ReportFileType.InwFile; } else if (filename.EndsWith(".wrdf")) { WrdfFileManager.ReadDataConfig(filename, out dsDataset, out args); fileType = ReportFileType.WebbDataFile; } else { return; } if (args == null) { return; } } if (args[3] == "DBConn:" && args[8] == @"Files:") { return; } Webb.Utility.CurReportMode = 1; //set browser mode ThreadStart ts = new ThreadStart(LoadingThreadProc); Thread thread = new Thread(ts); thread.Start(); CommandManager m_CmdManager = new CommandManager(args); //Calculate data source if (thread.IsAlive) { LoadingForm.MessageText = "Loading Data Source..."; } DBSourceConfig m_Config = m_CmdManager.CreateDBConfig(); if (m_Config.Templates.Count == 0) { if (thread.IsAlive) { LoadingForm.Close(); thread.Abort(); } Webb.Utilities.TopMostMessageBox.ShowMessage("Invalid template report name!", MessageBoxButtons.OK); Environment.Exit(0); } if (m_CmdManager.PrintDirectly) { if (PrinterSettings.InstalledPrinters.Count == 0) { if (thread.IsAlive) { LoadingForm.Close(); thread.Abort(); } Webb.Utilities.TopMostMessageBox.ShowMessage("No printer driver is installed!", MessageBoxButtons.OK); Environment.Exit(0); } } WebbDataProvider m_DBProvider = new WebbDataProvider(m_Config); WebbDataSource m_DBSource = new WebbDataSource(); if (fileType == ReportFileType.WebbDataFile && dsDataset == null) { m_DBSource.DataSource = dsDataset.Copy(); } else { m_DBProvider.GetDataSource(m_Config, m_DBSource); } ArrayList m_Fields = new ArrayList(); foreach (System.Data.DataColumn m_col in m_DBSource.DataSource.Tables[0].Columns) { if (m_col.Caption == "{EXTENDCOLUMNS}" && m_col.ColumnName.StartsWith("C_")) { continue; } m_Fields.Add(m_col.ColumnName); } Webb.Reports.DataProvider.VideoPlayBackManager.PublicDBProvider = m_DBProvider; Webb.Data.PublicDBFieldConverter.SetAvailableFields(m_Fields); Webb.Reports.DataProvider.VideoPlayBackManager.LoadAdvScFilters(); //Modified at 2009-1-19 13:48:30@Scott Webb.Reports.DataProvider.VideoPlayBackManager.ReadPictureDirFromRegistry(); m_DBProvider.UpdateEFFDataSource(m_DBSource); Webb.Reports.DataProvider.VideoPlayBackManager.DataSource = m_DBSource.DataSource; //Set dataset for click event //Loading report template if (thread.IsAlive) { LoadingForm.MessageText = "Loading Report Template..."; } #region Modified Area ArrayList printedReports = new ArrayList(); ArrayList invalidateReports = new ArrayList(); bool unionprint = m_CmdManager.UnionPrint; #endregion //End Modify at 2008-10-10 14:29:49@Simon FilterInfoCollection filterInfos = m_DBSource.Filters; //2009-7-1 11:09:08@Simon Add this Code For Union Print if (filterInfos == null) { filterInfos = new FilterInfoCollection(); } string printerName = m_CmdManager.PrinterName; foreach (string strTemplate in m_Config.Templates) { string strTemplateName = m_CmdManager.GetTemplateName(strTemplate, '@'); //Modified at 2009-2-3 9:17:34@Scott WebbReport m_Report = null; try { m_Report = m_CmdManager.CreateReport(Application.ExecutablePath, strTemplateName); //1 //create report with template //09-01-2011@Scott if (m_Config.WebbDBType == WebbDBTypes.WebbPlaybook) { SetReportHeader(m_Config, m_Report, m_Config.HeaderName); //Add this code at 2011-7-28 16:23:41@simon } else { string strHeader = m_CmdManager.GetAttachedHeader(strTemplate, '@'); SetReportHeader(m_Config, m_Report, strHeader); } //End } catch (Exception ex) { Webb.Utilities.TopMostMessageBox.ShowMessage("Error", "Can't load report template!\r\n" + ex.Message, MessageBoxButtons.OK); m_Report = new WebbReport(); } bool Canopen = CheckedUserRight(m_Report.LicenseLevel, m_Config.WebbDBType); string filename = System.IO.Path.GetFileNameWithoutExtension(strTemplateName); if (!Canopen) { invalidateReports.Add(filename); } else { //Add attached filter here #region Modified Area m_DBSource.Filters = filterInfos.Copy(); //2009-7-1 11:09:04@Simon Add this Code For Union Print string strFilterName = m_CmdManager.GetAttachedFilter(strTemplate, '@'); if (strFilterName != string.Empty) //2009-7-1 11:09:04@Simon For display Filternames In GameListInfo { if (!m_DBProvider.DBSourceConfig.Filters.Contains(strFilterName)) { FilterInfo filterInfo = new FilterInfo(); filterInfo.FilterName = strFilterName; m_DBSource.Filters.Add(filterInfo); } } ScAFilter scaFilter = Webb.Reports.DataProvider.VideoPlayBackManager.AdvReportFilters.GetFilter(strFilterName); //Modified at 2009-1-19 14:25:30@Scott AdvFilterConvertor convertor = new AdvFilterConvertor(); DBFilter AdvFilter = convertor.GetReportFilter(scaFilter).Filter; if (AdvFilter != null || AdvFilter.Count > 0) //2009-5-6 9:38:37@Simon Add this Code { AdvFilter.Add(m_Report.Template.Filter); m_Report.Template.Filter = AdvFilter; } SectionFilterCollection sectionFilter = m_Report.Template.SectionFilters.Copy(); if (m_Report.Template.ReportScType == ReportScType.Custom) { m_Report.Template.SectionFilters = AdvFilterConvertor.GetCustomFilters(Webb.Reports.DataProvider.VideoPlayBackManager.AdvReportFilters, sectionFilter); } #endregion //Modify at 2008-11-24 16:04:05@Scott //Set data source if (thread.IsAlive) { LoadingForm.MessageText = "Set Data Source..."; LoadingForm.ProcessText = Webb.Utility.GetCurFileName(); } m_Report.LoadAdvSectionFilters(m_Config.UserFolder); m_Report.SetWatermark(m_Config.WartermarkImagePath); //06-19-2008@Scott m_Report.SetDataSource(m_DBSource); } if (m_CmdManager.PrintDirectly) { if (!Canopen) { if (!unionprint) { Webb.Utilities.TopMostMessageBox.ShowMessage("LicenseLevel Error", "This report is not designed for your Webb application!" + "", MessageBoxButtons.OK); } continue; } else { printedReports.Add(m_Report); } #region Modified Area if (unionprint) { continue; //Modified at 2008-10-10 10:04:37@Simon } //Print if (Webb.Utility.CancelPrint) { if (thread.IsAlive) { LoadingForm.Close(); thread.Join(); } return; } if (thread.IsAlive) { LoadingForm.MessageText = "Printing..."; } if (printerName != string.Empty) { if (!PrinterExist(printerName)) { Webb.Utilities.TopMostMessageBox.ShowMessage("Failed to Print", "WRB Cann't Find The Printer '" + printerName + "' in you system,please check the printer setting!", MessageBoxButtons.OK); Environment.Exit(-1); } m_Report.Print(printerName); } else { m_Report.Print(); } #endregion //End Modify at 2008-10-9 16:54:58@Simon } else { //Browser //Create report if (thread.IsAlive) { LoadingForm.MessageText = "Creating Report Browser..."; } WebbRepBrowser m_Browser = new WebbRepBrowser(); //m_Browser.LoadReport(new WebbReport[]{m_Report,m_Report}); //multiply report if (m_Config.WebbDBType.ToString().ToLower().StartsWith("webbvictory")) { m_Browser.TopMost = true; } else { m_Browser.TopMost = false; } if (Canopen) { m_Browser.LoadReport(m_Report); } if (thread.IsAlive) { LoadingForm.Close(); thread.Join(); } Webb.Reports.DataProvider.VideoPlayBackManager.PublicBrowser = m_Browser; //05-04-2008@Scott if (!Canopen) { m_Browser.ReportName = filename; m_Browser.InvertZorder(); // Webb.Utilities.TopMostMessageBox.ShowMessage("LicenseLevel Error", "This report is not designed for your Webb application!\n So it would not open" + "", MessageBoxButtons.OK); } Application.Run(m_Browser); } } //add these codes for join all reports to print in only one document #region Modified Area WebbReport[] AllReportsToPrint = new WebbReport[printedReports.Count]; for (int i = 0; i < printedReports.Count; i++) { AllReportsToPrint[i] = printedReports[i] as WebbReport; } if (m_CmdManager.PrintDirectly && unionprint) { if (AllReportsToPrint.Length == 0) { Webb.Utilities.TopMostMessageBox.ShowMessage("No document", "No document could be print!", MessageBoxButtons.OK); } else { if (thread.IsAlive) { LoadingForm.MessageText = "Printing..."; LoadingForm.ProcessText = "Union Printing Documents"; } if (invalidateReports.Count > 0) { Webb.Utilities.AutoClosedMessageBox.ShowMessage(invalidateReports); } if (printerName != string.Empty) { if (!PrinterExist(printerName)) { Webb.Utilities.TopMostMessageBox.ShowMessage("Failed to Print", "WRB Cann'i Find The Printer '" + printerName + "' in you system,\nplease check the printer setting!", MessageBoxButtons.OK); Environment.Exit(-1); } WebbReport.Print(printerName, AllReportsToPrint); } else { WebbReport.Print(AllReportsToPrint); } } } #endregion //End Modify at 2008-10-10 9:42:07@Simon if (thread.IsAlive) { LoadingForm.Close(); thread.Join(); } }
private void bgWorkerLoading_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { loadform.Close(); }
private async void button1_Click(object sender, EventArgs e) { if (!IsValid()) { return; } if (!ValidaCedula(txtCedula.Text.Replace("-", ""))) { return; } var loading = new LoadingForm(); BeginInvoke((Action)(() => loading.ShowDialog())); candidato = new Candidato() { CadidatoId = currentId, Cedula = txtCedula.Text, Departamento = comboBox2.Text, Estado = "Activo", Recomendado = txtRecomendado.Text, Nombre = txtNombre.Text, PuestoId1 = puestos.FirstOrDefault(x => x.Nombre == comboBox1.SelectedItem.ToString()).PuestoId, Salario = decimal.Parse(txtSalario.Text), Telefono = txtTel.Text, Direccion = txtDir.Text }; db.Candidatos.AddOrUpdate(candidato); try { await db.SaveChangesAsync(); } catch (Exception ex) { loading.Close(); MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (checkedListBox1.CheckedItems.Count > 0) { foreach (var item in checkedListBox1.CheckedItems) { var cmpTmp = competencias.FirstOrDefault(x => x.Descripcion == item.ToString()); var tmp = new CompetenciasCandidato() { CandidatoId = candidato.CadidatoId, CompetenciaId = cmpTmp.CompetenciaId }; db.CompetenciasCandidatos.Add(tmp); } } //if (checkedListBox2.CheckedItems.Count > 0) //{ // foreach (var item in checkedListBox2.CheckedItems) // { // var cmpTmp = capacitaciones.FirstOrDefault(x => x.Descripcion == item.ToString()); // var tmp = new CapacitacionesCandidato() // { // CandidatoId = candidato.CadidatoId, // CapacitacionId = cmpTmp.CapacitacionId // }; // db.CapacitacionesCandidatos.Add(tmp); // } //} if (checkedListBox3.CheckedItems.Count > 0) { foreach (var item in checkedListBox3.CheckedItems) { var cmpTmp = idiomas.FirstOrDefault(x => x.Nombre == item.ToString()); var tmp = new IdiomasCandidato() { CandidatoId = candidato.CadidatoId, IdiomaId = cmpTmp.IdiomaId }; db.IdiomasCandidatos.Add(tmp); } } if (Experiencias != null && Experiencias.Count() > 0) { foreach (var item in Experiencias) { item.CandidatoId = candidato.CadidatoId; db.ExperienciasLaborales.Add(item); } } await db.SaveChangesAsync(); loading.Close(); this.Close(); }
void Search_btnClick(object sender, EventArgs e) { if(search_textBox.Text != "") { LoadingForm load_frm = new LoadingForm(); load_frm.StartPosition = FormStartPosition.CenterScreen; load_frm.Show(); load_frm.Update(); WebClient webClient = new WebClient(); Debug.WriteLine(String.Format("https://www.googleapis.com/customsearch/v1?key={0}&cx={1}&q={2}&alt=json", apiKey, cx, search_textBox.Text)); load_frm.Update(); string result = webClient.DownloadString(String.Format("https://www.googleapis.com/customsearch/v1?key={0}&cx={1}&q={2}&alt=json", apiKey, cx, search_textBox.Text)); load_frm.Update(); var jsonData = JObject.Parse(result); load_frm.Update(); //logger_richTextBox.AppendText(jsonData["items"].ToString()); load_frm.Update(); logger_richTextBox.Clear(); load_frm.Update(); int link_counter = 1; foreach(JObject obj in (JArray)jsonData["items"]) { load_frm.Update(); logger_richTextBox.AppendText("لينك" + link_counter + ": " + obj["link"].ToString() + Environment.NewLine); link_counter++; load_frm.Update(); } load_frm.Update(); load_frm.Close(); } }
public void regenerateTextureList() { using (LoadingForm form = new LoadingForm()) { form.Show(); //GraphicsManager.DeleteTextures(); int i = 0; //form.loadingBar.Maximum = this.GMXObjects.Count; form.loadingBar.Maximum = this.GmsResourceObjectList.Count; form.loadingBar.Value = 0; GraphicsManager.LoadTexture(GmsResource.undefined, new Bitmap(Manager.MainWindow.imageListObjects.Images[GmsResource.undefined])); //foreach (string file in RegisteredResources) // LOAD ONLY SPRITES ASSIGNED TO OBJECTS, SKIP ELSE //List<string> objects = renderItemsList("objects"); foreach (GmsObject gmobject in this.GmsResourceObjectList) { //GMSpriteData itm = this.GMXSprites.Find(item => item.Name == file); //GMSpriteData itm = this.GMXObjects.Find(item => item.Name == gmobject).sprite; GmsSprite itm = gmobject.sprite_index; if (itm != null) { // prevent adding duplicates if (!GraphicsManager.Sprites.ContainsKey(itm.name)) { if (File.Exists(itm.image)) { GraphicsManager.LoadTexture(itm.name, new Bitmap(itm.image)); } else// if (itm.name == null) { GraphicsManager.LoadTexture(itm.name, new Bitmap(Manager.MainWindow.imageListObjects.Images[GmsResource.undefined])); } } if (!Manager.MainWindow.imageListObjects.Images.ContainsKey(itm.name)) { if (File.Exists(itm.image)) { Manager.MainWindow.imageListObjects.Images.Add(itm.name, new Bitmap(itm.image)); } } } //Manager.MainWindow.tsProgress.Value++; form.loadingBar.Value++; if (i % 10 == 0 || i == form.loadingBar.Maximum - 1) { form.Refresh(); } i++; } foreach (GmsRoom r in this.GmsResourceRoomList) { if (r.background != null && r.background.image != null) { string imgName = "@bg:" + r.background.name; if (!GraphicsManager.Sprites.ContainsKey(imgName)) { if (File.Exists(r.background.image)) { GraphicsManager.LoadTexture(imgName, new Bitmap(r.background.image)); } } } } //foreach (PlaceableElement elem in PlaceableList) //{ // elem.textureId = elem.Sprite; //} form.Close(); } /*using (LoadingForm form = new LoadingForm()) * { * form.Show(); * * List<string> objects = renderItemsList("objects"); * * foreach (string gmobject in objects) * { * //GMSpriteData itm = this.GMXSprites.Find(item => item.Name == file); * GMSpriteData itm = this.GMXObjects.Find(item => item.Name == gmobject).sprite; * * if (itm != null) * { * // prevent adding duplicates * //if (!GraphicsManager.Sprites.ContainsKey(itm.Name)) * * } * } * * form.Close(); * }*/ }
static private void CloseFormInternal() { LoadingForm.Close(); }