/// <summary> /// Shows a PropertyGrid Dialog and uses the specified object as the edit copy. /// </summary> /// <param name="editCopy"></param> public void ShowDialog(object editCopy) { _frmDialog = new PropertyDialog(); _frmDialog.PropertyGrid.SelectedObject = editCopy; _frmDialog.ChangesApplied += frmDialog_ChangesApplied; _frmDialog.ShowDialog(); }
/// <summary> /// Shows a PropertyGrid Dialog and uses the specified object as the edit copy. /// </summary> /// <param name="editCopy"></param> public void ShowDialog(object editCopy) { _frmDialog = new PropertyDialog(); _frmDialog.PropertyGrid.SelectedObject = editCopy; _frmDialog.ChangesApplied += frmDialog_ChangesApplied; _frmDialog.ShowDialog(); }
private void Image_PropertiesClicked(object sender, ImageLayerEventArgs e) { using (PropertyDialog dlg = new PropertyDialog()) { dlg.PropertyGrid.SelectedObject = e.ImageLayer.Copy(); dlg.OriginalObject = e.ImageLayer; dlg.ShowDialog(Owner); } }
private void Image_PropertiesClicked(object sender, ImageLayerEventArgs e) { using (PropertyDialog dlg = new PropertyDialog()) { dlg.PropertyGrid.SelectedObject = e.ImageLayer.Copy(); dlg.OriginalObject = e.ImageLayer; dlg.ShowDialog(Owner); } }
/// <summary> /// Show the properties of an image layer in the legend. /// </summary> /// <param name="e"></param> public void ShowProperties(IImageLayer e) { using (var dlg = new PropertyDialog()) { dlg.PropertyGrid.SelectedObject = e.Copy(); dlg.OriginalObject = e; ShowDialog(dlg); } }
/// <summary> /// Show the properties of an image layer in the legend. /// </summary> /// <param name="e"></param> public void ShowProperties(IImageLayer e) { using (var dlg = new PropertyDialog()) { dlg.PropertyGrid.SelectedObject = e.Copy(); dlg.OriginalObject = e; ShowDialog(dlg); } }
/// <summary> /// Shows a PropertyGrid Dialog and uses the specified object as the edit copy. /// </summary> /// <param name="editCopy">Object that should be used as edit copy.</param> public void ShowDialog(object editCopy) { _frmDialog = new PropertyDialog { PropertyGrid = { SelectedObject = editCopy } }; _frmDialog.ChangesApplied += FrmDialogChangesApplied; _frmDialog.ShowDialog(); }
/// <summary> /// This should launch an open file dialog instead of the usual thing. /// </summary> /// <param name="context">ITypeDescriptorContext</param> /// <param name="provider">IServiceProvider</param> /// <param name="value">The object being displayed</param> /// <returns>A new version of the object if the dialog was ok.</returns> public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { ICloneable parent = value as ICloneable; object backup = parent != null ? parent.Clone() : value; IWindowsFormsEditorService dialogProvider = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); PropertyDialog frm = new PropertyDialog(); frm.PropertyGrid.SelectedObject = value; return dialogProvider.ShowDialog(frm) == DialogResult.OK ? value : backup; }
/// <summary> /// This should launch an open file dialog instead of the usual thing. /// </summary> /// <param name="context">ITypeDescriptorContext</param> /// <param name="provider">IServiceProvider</param> /// <param name="value">The object being displayed</param> /// <returns>A new version of the object if the dialog was ok.</returns> public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { ICloneable parent = value as ICloneable; object backup = parent != null?parent.Clone() : value; IWindowsFormsEditorService dialogProvider = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); PropertyDialog frm = new PropertyDialog(); frm.PropertyGrid.SelectedObject = value; return(dialogProvider.ShowDialog(frm) == DialogResult.OK ? value : backup); }
private void Configure() { _elevationQuickPick = new ContextMenuStrip(); _elevationQuickPick.Items.Add("Z Feet | XY Lat Long").Click += SetElevationFeetLatLong; _elevationQuickPick.Items.Add("Z Feet | XY Meters").Click += SetElevationFeetMeters; _elevationQuickPick.Items.Add("Z Feet | XY Feet").Click += SetElevationSameUnits; _elevationQuickPick.Items.Add("Z Meters | XY Lat Long").Click += SetElevationMetersLatLong; _elevationQuickPick.Items.Add("Z Meters | XY Meters").Click += SetElevationSameUnits; _elevationQuickPick.Items.Add("Z Meters | XY Feet").Click += SetElevationMetersFeet; dgvCategories.CellFormatting += DgvCategoriesCellFormatting; dgvCategories.CellDoubleClick += DgvCategoriesCellDoubleClick; dgvCategories.SelectionChanged += DgvCategoriesSelectionChanged; dgvCategories.CellValidated += DgvCategoriesCellValidated; dgvCategories.MouseDown += DgvCategoriesMouseDown; foreach (var enumValue in Enum.GetValues(typeof(IntervalMethod))) { cmbInterval.Items.Add(enumValue); } cmbInterval.SelectedItem = IntervalMethod.EqualInterval; breakSliderGraph1.SliderSelected += BreakSliderGraph1SliderSelected; _quickSchemes = new ContextMenuStrip(); string[] names = Enum.GetNames(typeof(ColorSchemeType)); foreach (string name in names) { _quickSchemes.Items.Add(name); ToolStripMenuItem mi = new(name); mi.Click += QuickSchemeClicked; _quickSchemes.Items.Add(mi); } cmbIntervalSnapping.Items.Clear(); foreach (var item in Enum.GetValues(typeof(IntervalSnapMethod))) { cmbIntervalSnapping.Items.Add(item); } cmbIntervalSnapping.SelectedItem = IntervalSnapMethod.DataValue; _cleanupTimer = new Timer { Interval = 10 }; _cleanupTimer.Tick += CleanupTimerTick; // Allows shaded Relief to be edited _shadedReliefDialog = new PropertyDialog(); _shadedReliefDialog.ChangesApplied += PropertyDialogChangesApplied; }
private void Configure() { _elevationQuickPick = new ContextMenu(); _elevationQuickPick.MenuItems.Add("Z Feet | XY Lat Long", SetElevationFeetLatLong); _elevationQuickPick.MenuItems.Add("Z Feet | XY Meters", SetElevationFeetMeters); _elevationQuickPick.MenuItems.Add("Z Feet | XY Feet", SetElevationSameUnits); _elevationQuickPick.MenuItems.Add("Z Meters | XY Lat Long", SetElevationMetersLatLong); _elevationQuickPick.MenuItems.Add("Z Meters | XY Meters", SetElevationSameUnits); _elevationQuickPick.MenuItems.Add("Z Meters | XY Feet", SetElevationMetersFeet); dgvCategories.CellFormatting += DgvCategoriesCellFormatting; dgvCategories.CellDoubleClick += DgvCategoriesCellDoubleClick; dgvCategories.SelectionChanged += DgvCategoriesSelectionChanged; dgvCategories.CellValidated += DgvCategoriesCellValidated; dgvCategories.MouseDown += DgvCategoriesMouseDown; cmbInterval.SelectedItem = "EqualInterval"; breakSliderGraph1.SliderSelected += BreakSliderGraph1SliderSelected; _quickSchemes = new ContextMenu(); string[] names = Enum.GetNames(typeof(ColorSchemeType)); foreach (string name in names) { MenuItem mi = new MenuItem(name, QuickSchemeClicked); _quickSchemes.MenuItems.Add(mi); } cmbIntervalSnapping.Items.Clear(); var result = Enum.GetValues(typeof(IntervalSnapMethod)); foreach (var item in result) { cmbIntervalSnapping.Items.Add(item); } cmbIntervalSnapping.SelectedItem = IntervalSnapMethod.Rounding; _cleanupTimer = new Timer(); _cleanupTimer.Interval = 10; _cleanupTimer.Tick += CleanupTimerTick; // Allows shaded Relief to be edited _shadedReliefDialog = new PropertyDialog(); _shadedReliefDialog.ChangesApplied += PropertyDialogChangesApplied; }
private void Configure() { _elevationQuickPick = new ContextMenu(); _elevationQuickPick.MenuItems.Add("Z Feet | XY Lat Long", SetElevationFeetLatLong); _elevationQuickPick.MenuItems.Add("Z Feet | XY Meters", SetElevationFeetMeters); _elevationQuickPick.MenuItems.Add("Z Feet | XY Feet", SetElevationSameUnits); _elevationQuickPick.MenuItems.Add("Z Meters | XY Lat Long", SetElevationMetersLatLong); _elevationQuickPick.MenuItems.Add("Z Meters | XY Meters", SetElevationSameUnits); _elevationQuickPick.MenuItems.Add("Z Meters | XY Feet", SetElevationMetersFeet); dgvCategories.CellFormatting += DgvCategoriesCellFormatting; dgvCategories.CellDoubleClick += DgvCategoriesCellDoubleClick; dgvCategories.SelectionChanged += DgvCategoriesSelectionChanged; dgvCategories.CellValidated += DgvCategoriesCellValidated; dgvCategories.MouseDown += DgvCategoriesMouseDown; cmbInterval.SelectedItem = "EqualInterval"; breakSliderGraph1.SliderSelected += BreakSliderGraph1SliderSelected; _quickSchemes = new ContextMenu(); string[] names = Enum.GetNames(typeof(ColorSchemeType)); foreach (string name in names) { MenuItem mi = new MenuItem(name, QuickSchemeClicked); _quickSchemes.MenuItems.Add(mi); } cmbIntervalSnapping.Items.Clear(); var result = Enum.GetValues(typeof(IntervalSnapMethod)); foreach (var item in result) { cmbIntervalSnapping.Items.Add(item); } cmbIntervalSnapping.SelectedItem = IntervalSnapMethod.Rounding; _cleanupTimer = new Timer(); _cleanupTimer.Interval = 10; _cleanupTimer.Tick += CleanupTimerTick; // Allows shaded Relief to be edited _shadedReliefDialog = new PropertyDialog(); _shadedReliefDialog.ChangesApplied += PropertyDialogChangesApplied; }