Esempio n. 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;
        }
Esempio n. 2
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);
        }
Esempio n. 3
0
        void item_Click(object sender, EventArgs e)
        {
            ChooseRowFromDBForm db_window = new ChooseRowFromDBForm(((StorageType)((ToolStripMenuItem)sender).Tag));

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