public override object EditValue(
                ITypeDescriptorContext context,
                IServiceProvider provider,
                object value)
        {
            //use IWindowsFormsEditorService object to display a control in the dropdown area
            IWindowsFormsEditorService frmsvr = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            if (frmsvr == null)
                return null;

            object propertyConverter = null;
            if(context.Instance is object[])
                propertyConverter = ((object[])context.Instance)[0];
            else
                propertyConverter = context.Instance;

            PropertyGridConverters.SpritePropertyConverter prop = (PropertyGridConverters.SpritePropertyConverter)propertyConverter;

            CoronaObject obj = prop.GetObjectSelected();

            SpriteSequencePropertyEditor control = new SpriteSequencePropertyEditor(obj, frmsvr);
            frmsvr.DropDownControl(control);

            if (control.SelectedItem != null)
            {
                return  control.SelectedItem.ToString();
            }
            else return "DEFAULT";
        }
Example #2
0
        public override object EditValue(
            ITypeDescriptorContext context,
            IServiceProvider provider,
            object value)
        {
            //use IWindowsFormsEditorService object to display a control in the dropdown area
            IWindowsFormsEditorService frmsvr = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));

            if (frmsvr == null)
            {
                return(null);
            }



            object propertyConverter = null;

            if (context.Instance is object[])
            {
                propertyConverter = ((object[])context.Instance)[0];
            }
            else
            {
                propertyConverter = context.Instance;
            }

            PropertyGridConverters.SpritePropertyConverter prop = (PropertyGridConverters.SpritePropertyConverter)propertyConverter;

            CoronaObject obj = prop.GetObjectSelected();

            SpriteSequencePropertyEditor control = new SpriteSequencePropertyEditor(obj, frmsvr);

            frmsvr.DropDownControl(control);

            if (control.SelectedItem != null)
            {
                return(control.SelectedItem.ToString());
            }
            else
            {
                return("DEFAULT");
            }
        }