예제 #1
0
        public static Material_0007[] GetMaterials(Material_0007[] materials, out bool success)
        {
            MaterialEffectEditor eventEditor = new MaterialEffectEditor(materials);

            eventEditor.ShowDialog();

            success = eventEditor.OK;

            List <Material_0007> outMaterials = new List <Material_0007>();

            foreach (Material_0007 material in eventEditor.listBoxMaterials.Items)
            {
                outMaterials.Add(material);
            }

            return(outMaterials.ToArray());
        }
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            if (provider != null)
            {
                service = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            }

            if (service != null)
            {
                if (value is Material_0007[] materials)
                {
                    materials = MaterialEffectEditor.GetMaterials(materials);

                    if (materials != null)
                    {
                        value = materials;
                    }
                }
            }

            return(value);
        }