private static void RunDemo(SqlConnection connection) { Console.WriteLine("Kjører MetadataSelect.GetAllTables():"); var metadataSelect = new MetadataSelect(); var tables = metadataSelect.GetAllTables(connection); foreach (var table in tables) { Console.WriteLine(table); } }
private void field_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.D) { if (sender is Control) { Cursor = Cursors.WaitCursor; BaseEdit ctrl = sender as BaseEdit; string propertyName; if (ctrl != null) { propertyName = ctrl.DataBindings[0].BindingMemberInfo.BindingMember; } else { propertyName = (string)(sender as Control).Tag; } MetadataSelect mdSelect = null; PropertyTypeEnum propType = PropertyTypeEnum.String; if (sender is SpinEdit) { propType = PropertyTypeEnum.Number; } else if (sender is PictureBox) { propType = PropertyTypeEnum.Image; } else if (sender is DateEdit) { propType = PropertyTypeEnum.Date; } else if (sender is ListBoxControl) { propType = PropertyTypeEnum.List; } mdSelect = new MetadataSelect(_dvdTitle, propertyName, propType); if (mdSelect.ShowDialog() == DialogResult.OK) { TitleChanges(null, EventArgs.Empty); } if (ctrl != null) { (ctrl.BindingManager as CurrencyManager).Refresh(); } if (sender is ListBoxControl) { TogglePeople(rgPeople.SelectedIndex); } Cursor = Cursors.Default; } } }
private void updateFromMetadataToolStripMenuItem1_Click(object sender, EventArgs e) { PictureBox pb = contextImage.Tag as PictureBox; Cursor = Cursors.WaitCursor; string propertyName = pb.DataBindings[0].BindingMemberInfo.BindingMember; MetadataSelect mdSelect = new MetadataSelect(_dvdTitle, propertyName, PropertyTypeEnum.Image); if (mdSelect.ShowDialog() == DialogResult.OK) { TitleChanges(null, EventArgs.Empty); } PropertyInfo pInfo = _dvdTitle.GetType().GetProperty(propertyName); pb.ImageLocation = (string)pInfo.GetValue(_dvdTitle, null); Cursor = Cursors.Default; }
private void updateFromMetadataToolStripMenuItem1_Click(object sender, EventArgs e) { PictureBox pb = contextImage.Tag as PictureBox; Cursor = Cursors.WaitCursor; string propertyName = pb.DataBindings[0].BindingMemberInfo.BindingMember; MetadataSelect mdSelect = new MetadataSelect(_dvdTitle, propertyName, PropertyTypeEnum.Image); if (mdSelect.ShowDialog() == DialogResult.OK) TitleChanges(null, EventArgs.Empty); PropertyInfo pInfo = _dvdTitle.GetType().GetProperty(propertyName); pb.ImageLocation = (string)pInfo.GetValue(_dvdTitle, null); Cursor = Cursors.Default; }
private void field_KeyDown(object sender, KeyEventArgs e) { if (e.Control && e.KeyCode == Keys.D) { if (sender is Control) { Cursor = Cursors.WaitCursor; BaseEdit ctrl = sender as BaseEdit; string propertyName; if (ctrl != null) propertyName = ctrl.DataBindings[0].BindingMemberInfo.BindingMember; else propertyName = (string)(sender as Control).Tag; MetadataSelect mdSelect = null; PropertyTypeEnum propType = PropertyTypeEnum.String; if (sender is SpinEdit) propType = PropertyTypeEnum.Number; else if (sender is PictureBox) propType = PropertyTypeEnum.Image; else if (sender is DateEdit) propType = PropertyTypeEnum.Date; else if (sender is ListBoxControl) propType = PropertyTypeEnum.List; mdSelect = new MetadataSelect(_dvdTitle, propertyName, propType); if (mdSelect.ShowDialog() == DialogResult.OK) TitleChanges(null, EventArgs.Empty); if (ctrl != null) (ctrl.BindingManager as CurrencyManager).Refresh(); if (sender is ListBoxControl) TogglePeople(rgPeople.SelectedIndex); Cursor = Cursors.Default; } } }