public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context != null
                && context.Instance != null
                && provider != null)
            {

                IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

                if (edSvc != null)
                {
                    SubMeshCollection subMeshes = value as SubMeshCollection;
                    if (subMeshes != null)
                    {
                        SubMeshDialog subMeshEditor = new SubMeshDialog(subMeshes);

                        if ( edSvc.ShowDialog(subMeshEditor) == DialogResult.OK ) {
                            return subMeshEditor.SubMeshCollection;
                        }
                    }
                }
            }

            return value;
        }
Exemplo n.º 2
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (context != null &&
                context.Instance != null &&
                provider != null)
            {
                IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

                if (edSvc != null)
                {
                    SubMeshCollection subMeshes = value as SubMeshCollection;
                    if (subMeshes != null)
                    {
                        SubMeshDialog subMeshEditor = new SubMeshDialog(subMeshes);

                        if (edSvc.ShowDialog(subMeshEditor) == DialogResult.OK)
                        {
                            return(subMeshEditor.SubMeshCollection);
                        }
                    }
                }
            }

            return(value);
        }