/// <summary> /// Called when we want to edit the value of a property. /// </summary> /// <param name="context"></param> /// <param name="provider"></param> /// <param name="value"></param> /// <returns></returns> public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value) { edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc != null) { GUIControl control = context.Instance as GUIControl; if (control != null) { TextureManagerForm form = new TextureManagerForm(control.Scene, true); form.SelectedTexture = control.Scene.GetTextureInfo((int)value); if (form.ShowDialog() == DialogResult.OK) { return (form.SelectedTexture != null ? form.SelectedTexture.ID : -1); } return (int)value; } } return value; }
/// <summary> /// Brings up the scene's texture manager /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void mTexturesToolStripMenuItem_Click(object sender, EventArgs e) { SceneView view = mDockPanel.ActiveDocument as SceneView; if (view == null || view.Scene == null) return; TextureManagerForm textureManagerForm = new TextureManagerForm(view.Scene, false); textureManagerForm.ShowDialog(); SceneView sceneView = mDockPanel.ActiveDocument as SceneView; if (sceneView != null) sceneView.RefreshRenderPanel(); }