示例#1
0
        public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService svc = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            IEnumerable<StorageTypeAttribute> attrs = context.PropertyDescriptor.Attributes.OfType<StorageTypeAttribute>();

            if (attrs.Count<StorageTypeAttribute>() > 0 && svc != null)
            {
                using (ChooseRowFromDBForm form = new ChooseRowFromDBForm(attrs.First <StorageTypeAttribute>().type))
                {
                    form.Value = (int)value;
                    if (svc.ShowDialog(form) == DialogResult.OK)
                        value = form.Value;
                }
            }
            return value;
        }
        public override object EditValue(ITypeDescriptorContext context, System.IServiceProvider provider, object value)
        {
            IWindowsFormsEditorService         svc   = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
            IEnumerable <StorageTypeAttribute> attrs = context.PropertyDescriptor.Attributes.OfType <StorageTypeAttribute>();

            if (attrs.Count <StorageTypeAttribute>() > 0 && svc != null)
            {
                using (ChooseRowFromDBForm form = new ChooseRowFromDBForm(attrs.First <StorageTypeAttribute>().type))
                {
                    form.Value = (int)value;
                    if (svc.ShowDialog(form) == DialogResult.OK)
                    {
                        value = form.Value;
                    }
                }
            }
            return(value);
        }
示例#3
0
        void item_Click(object sender, EventArgs e)
        {
            ChooseRowFromDBForm db_window = new ChooseRowFromDBForm(((StorageType)((ToolStripMenuItem)sender).Tag));

            db_window.Show();
        }
示例#4
0
 void item_Click(object sender, EventArgs e)
 {
     ChooseRowFromDBForm db_window = new ChooseRowFromDBForm(((StorageType)((ToolStripMenuItem)sender).Tag));
     db_window.Show();
 }