private void buttonBrowseRender_Click(object sender, EventArgs e) { #region Test sphere var testSphere = comboRender.SelectedItem as TestSphere; if (testSphere != null) { // Get a particle system preset file path string path; if (!FileSelectorDialog.TryGetPath("Textures", ".*", out path)) { return; } // Apply the new texture file testSphere.Texture = path; } #endregion else { #region Mesh var mesh = comboRender.SelectedItem as Mesh; if (mesh != null) { // Get a particle system preset file path string path; if (!FileSelectorDialog.TryGetPath("Meshes", ".x", out path)) { return; } // Apply the new mesh file mesh.Filename = path; } #endregion else { #region Particle system var particleSystem = comboRender.SelectedItem as ParticleSystem; if (particleSystem == null) { return; } // Get a particle system preset file path string path; if (!FileSelectorDialog.TryGetPath("Graphics" + Path.DirectorySeparatorChar + particleSystem.GetType().Name, ".xml", out path)) { return; } // Apply the new preset file particleSystem.Filename = path; #endregion } } OnChange(); OnUpdate(); }
//--------------------// #region Buttons private void buttonBrowse_Click(object sender, EventArgs e) { // Get a terrain texture file path string path; if (!FileSelectorDialog.TryGetPath("Textures/Terrain", ".*", out path)) { return; } // Apply the texture file TemplateList.SelectedEntry.Texture = path; OnChange(); OnUpdate(); }
protected override void Run() { var selector = new FileSelectorDialog("Open session"); string filename = null; try { var result = MessageService.RunCustomDialog(selector, MessageService.RootWindow); if (result == (int)Gtk.ResponseType.Cancel) { return; } filename = selector.Filename; } finally { selector.Destroy(); } AutoTestService.ReplaySessionFromFile(filename); }
protected override void Run() { if (AutoTestService.CurrentRecordSession == null) { AutoTestService.StartRecordingSession(); } else { var selector = new FileSelectorDialog("Save session as...", Gtk.FileChooserAction.Save); try { var result = MessageService.RunCustomDialog(selector, MessageService.RootWindow); if (result == (int)Gtk.ResponseType.Cancel) { return; } AutoTestService.StopRecordingSession(selector.Filename); } finally { selector.Destroy(); } } }