Пример #1
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            Win32Assembly assembly = null;

            if (context.Instance is IHeader)
            {
                assembly = (context.Instance as IHeader).ParentAssembly;
            }
            else if (context.Instance is DataDirectory)
            {
                assembly = (context.Instance as DataDirectory).Section.ParentAssembly;
            }

            OffsetEditorDlg dlg = new OffsetEditorDlg(value as Offset, assembly);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                value = dlg.Offset;
            }
            return(value);
        }
Пример #2
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            Win32Assembly assembly = null;
            if (context.Instance is IHeader)
                assembly = (context.Instance as IHeader).ParentAssembly;
            else if (context.Instance is DataDirectory)
                assembly = (context.Instance as DataDirectory).Section.ParentAssembly;

            OffsetEditorDlg dlg = new OffsetEditorDlg(value as Offset, assembly);
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                value = dlg.Offset;
            }
            return value;
        }