示例#1
0
        public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
        {
            var svc   = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            var codes = value as string;

            if (svc != null && codes != null)
            {
                DrawableObject obj   = context.Instance as DrawableObject;
                DrawingSheet   sheet = obj.OwnerDraw.OwnerSheet;

                using (var form = new EditOutput(VariableCollection.GetOutputsDictionary(sheet), value as string))
                {
                    if (svc.ShowDialog(form) == DialogResult.OK)
                    {
                        value = form.Tag.ToString() == "" ? null : form.Tag;
                    }
                }
            }
            return(value);
        }