/// <summary> /// Refresh the list box item when a property changes /// </summary> /// <param name="s">The sender of the event</param> /// <param name="e">The event arguments</param> private void pgProps_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { lbContentEditors.Refresh(lbContentEditors.SelectedIndex); wasModified = true; }
private void mcPropertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { string sid = string.Empty; string value = string.Empty; System.ComponentModel.PropertyDescriptorCollection collection = null; if (e.ChangedItem.PropertyDescriptor != null) { if (e.ChangedItem.PropertyDescriptor.Name.Equals("DesigeCaption", StringComparison.OrdinalIgnoreCase) == true) { value = (e.ChangedItem.Value == null ? string.Empty : e.ChangedItem.Value.ToString()); if (string.IsNullOrWhiteSpace(value) == false) { sid = DesignSetMsgId(value); } else { sid = string.Empty; } foreach (object obj in this.SelectedObjects) { collection = System.ComponentModel.TypeDescriptor.GetProperties(obj); foreach (PropertyDescriptor v in collection) { if (v.Name.Equals("MessageCode", StringComparison.OrdinalIgnoreCase) == true) { v.SetValue(obj, sid); } } if (obj is XmlRow) { ((XmlRow)obj).MessageCode = sid; ((XmlRow)obj).RowView["MessageCode"] = sid; ((XmlRow)obj).RowView.EndEdit(); } else if (obj is KzxLookUpColumnInfo) { } } this.Refresh(); } else if (e.ChangedItem.PropertyDescriptor.Name.Equals("Caption", StringComparison.OrdinalIgnoreCase) == true) { value = (e.ChangedItem.Value == null ? string.Empty : e.ChangedItem.Value.ToString()); if (string.IsNullOrWhiteSpace(value) == false) { sid = DesignSetMsgId(value); } else { sid = string.Empty; } foreach (object obj in this.SelectedObjects) { collection = System.ComponentModel.TypeDescriptor.GetProperties(obj); foreach (PropertyDescriptor v in collection) { if (v.Name.Equals("MessageCode", StringComparison.OrdinalIgnoreCase) == true) { v.SetValue(obj, sid); } } } this.Refresh(); } } }
public void Modify(PropertyValueChangedEventArgs e) { string label = e.ChangedItem.Label; Tekla.Structures.Model.UI.ModelObjectSelector modelObjectSelector = new Tekla.Structures.Model.UI.ModelObjectSelector(); ModelObjectEnumerator modelObjectEnum = modelObjectSelector.GetSelectedObjects(); while (modelObjectEnum.MoveNext()) { if (modelObjectEnum.Current is BaseWeld) { BaseWeld weld = (BaseWeld)modelObjectEnum.Current; if (label == "SizeAbove") { weld.SizeAbove = double.Parse(sizeAbove); } if (label == "WeldTypeAbove") { if (weldTypeAbove == WeldType.WELD_TYPE_NONE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_NONE; } else if (weldTypeAbove == WeldType.WELD_TYPE_FILLET) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_FILLET; } else if (weldTypeAbove == WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT; } else if (weldTypeAbove == WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; } else if (weldTypeAbove == WeldType.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT; } else if (weldTypeAbove == WeldType.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE; } else if (weldTypeAbove == WeldType.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE; } else if (weldTypeAbove == WeldType.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT; } else if (weldTypeAbove == WeldType.WELD_TYPE_J_GROOVE_J_BUTT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_J_GROOVE_J_BUTT; } else if (weldTypeAbove == WeldType.WELD_TYPE_FLARE_V_GROOVE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_V_GROOVE; } else if (weldTypeAbove == WeldType.WELD_TYPE_FLARE_BEVEL_GROOVE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_BEVEL_GROOVE; } else if (weldTypeAbove == WeldType.WELD_TYPE_EDGE_FLANGE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE_FLANGE; } else if (weldTypeAbove == WeldType.WELD_TYPE_CORNER_FLANGE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_CORNER_FLANGE; } else if (weldTypeAbove == WeldType.WELD_TYPE_PLUG) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_PLUG; } else if (weldTypeAbove == WeldType.WELD_TYPE_BEVEL_BACKING) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_BACKING; } else if (weldTypeAbove == WeldType.WELD_TYPE_SPOT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SPOT; } else if (weldTypeAbove == WeldType.WELD_TYPE_SEAM) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SEAM; } else if (weldTypeAbove == WeldType.WELD_TYPE_SLOT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_SLOT; } else if (weldTypeAbove == WeldType.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET; } else if (weldTypeAbove == WeldType.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET; } else if (weldTypeAbove == WeldType.WELD_TYPE_MELT_THROUGH) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_MELT_THROUGH; } else if (weldTypeAbove == WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT; } else if (weldTypeAbove == WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) { weld.TypeAbove = BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; } else if (weldTypeAbove == WeldType.WELD_TYPE_EDGE) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE; } else if (weldTypeAbove == WeldType.WELD_TYPE_ISO_SURFACING) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_ISO_SURFACING; } else if (weldTypeAbove == WeldType.WELD_TYPE_FOLD) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_FOLD; } else if (weldTypeAbove == WeldType.WELD_TYPE_INCLINED) { weld.TypeAbove = BaseWeld.WeldTypeEnum.WELD_TYPE_INCLINED; } } if (label == "ContourTypeAbove") { if (contourTypeAbove == ContourType.None) { weld.ContourAbove = BaseWeld.WeldContourEnum.WELD_CONTOUR_NONE; } else if (contourTypeAbove == ContourType.Flush) { weld.ContourAbove = BaseWeld.WeldContourEnum.WELD_CONTOUR_FLUSH; } } if (label == "SizeBelow") { weld.SizeBelow = double.Parse(sizeBelow); } if (label == "WeldTypeBelow") { if (weldTypeBelow == WeldType.WELD_TYPE_NONE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_NONE; } else if (weldTypeBelow == WeldType.WELD_TYPE_FILLET) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_FILLET; } else if (weldTypeBelow == WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_V_BUTT; } else if (weldTypeBelow == WeldType.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; } else if (weldTypeBelow == WeldType.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SQUARE_GROOVE_SQUARE_BUTT; } else if (weldTypeBelow == WeldType.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_V_BUTT_WITH_BROAD_ROOT_FACE; } else if (weldTypeBelow == WeldType.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SINGLE_BEVEL_BUTT_WITH_BROAD_ROOT_FACE; } else if (weldTypeBelow == WeldType.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_U_GROOVE_SINGLE_U_BUTT; } else if (weldTypeBelow == WeldType.WELD_TYPE_J_GROOVE_J_BUTT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_J_GROOVE_J_BUTT; } else if (weldTypeBelow == WeldType.WELD_TYPE_FLARE_V_GROOVE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_V_GROOVE; } else if (weldTypeBelow == WeldType.WELD_TYPE_FLARE_BEVEL_GROOVE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_FLARE_BEVEL_GROOVE; } else if (weldTypeBelow == WeldType.WELD_TYPE_EDGE_FLANGE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE_FLANGE; } else if (weldTypeBelow == WeldType.WELD_TYPE_CORNER_FLANGE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_CORNER_FLANGE; } else if (weldTypeBelow == WeldType.WELD_TYPE_PLUG) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_PLUG; } else if (weldTypeBelow == WeldType.WELD_TYPE_BEVEL_BACKING) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_BEVEL_BACKING; } else if (weldTypeBelow == WeldType.WELD_TYPE_SPOT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SPOT; } else if (weldTypeBelow == WeldType.WELD_TYPE_SEAM) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SEAM; } else if (weldTypeBelow == WeldType.WELD_TYPE_SLOT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_SLOT; } else if (weldTypeBelow == WeldType.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SINGLE_BEVEL_BUTT_PLUS_FILLET; } else if (weldTypeBelow == WeldType.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_PARTIAL_PENETRATION_SQUARE_GROOVE_PLUS_FILLET; } else if (weldTypeBelow == WeldType.WELD_TYPE_MELT_THROUGH) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_MELT_THROUGH; } else if (weldTypeBelow == WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_V_BUTT; } else if (weldTypeBelow == WeldType.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT) { weld.TypeBelow = BaseWeld.WeldTypeEnum.STEEP_FLANKED_BEVEL_GROOVE_SINGLE_BEVEL_BUTT; } else if (weldTypeBelow == WeldType.WELD_TYPE_EDGE) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_EDGE; } else if (weldTypeBelow == WeldType.WELD_TYPE_ISO_SURFACING) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_ISO_SURFACING; } else if (weldTypeBelow == WeldType.WELD_TYPE_FOLD) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_FOLD; } else if (weldTypeBelow == WeldType.WELD_TYPE_INCLINED) { weld.TypeBelow = BaseWeld.WeldTypeEnum.WELD_TYPE_INCLINED; } } if (label == "ContourTypeBelow") { if (contourTypeBelow == ContourType.None) { weld.ContourBelow = BaseWeld.WeldContourEnum.WELD_CONTOUR_NONE; } else if (contourTypeBelow == ContourType.Flush) { weld.ContourBelow = BaseWeld.WeldContourEnum.WELD_CONTOUR_FLUSH; } } if (label == "RefText") { weld.ReferenceText = refText; } if (label == "Around") { if (around == Bool.True) { weld.AroundWeld = true; } else { weld.AroundWeld = false; } } weld.Modify(); } } }
void propertyGrid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { collectionEditorControl.Refresh(); }
private void propGridInput_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { btnApply.Enabled = true; }
private void grid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { Save(); }
private void pgTheme_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { UpdateThemeControls(); ApplySelectedTheme(); }
/// <summary> /// PropertyGrid属性变化时,动态改变单元格的属性 /// </summary> private void pgrdCellProperty_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { object obj = pgrdCellProperty.SelectedObject; if (obj != null) { if (obj.GetType() == typeof(DataGridViewTextBoxCellEx)) { bool readOnly = ((DataGridViewTextBoxCellEx)obj).CellEditType != (ComboBoxSourceHelper.CellType)Enum.Parse(typeof(ComboBoxSourceHelper.CellType), "0"); bool deailReadOnly = ((DataGridViewTextBoxCellEx)obj).CellEditType != (ComboBoxSourceHelper.CellType)Enum.Parse(typeof(ComboBoxSourceHelper.CellType), "2"); if (readOnly) { ((DataGridViewTextBoxCellEx)obj).CellContent = (ComboBoxSourceHelper.CellContent)Enum.Parse(typeof(ComboBoxSourceHelper.CellContent), "0"); } //固定单元格时显示内容选项 PropertyDescriptorCollection props = TypeDescriptor.GetProperties(obj); foreach (PropertyDescriptor pd in props) { if (pd.Name == "LeftTopRightBottom" || pd.Name == "CellContent" || pd.Name == "LeftBottomRightTop") { SetPropertyReadOnly(obj, pd.Name, readOnly); } if (pd.Name == "SerialStep" || pd.Name == "SpaceRows") { SetPropertyReadOnly(obj, pd.Name, deailReadOnly); } } #region 如果设置了宽度,默认给设置颜色值 Color color = ((DataGridViewTextBoxCellEx)obj).TopBorderColor; int width = ((DataGridViewTextBoxCellEx)obj).TopBorderWidth; if (e.ChangedItem.Label == "上边框宽度") { if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0)) && width > 0) { ((DataGridViewTextBoxCellEx)obj).TopBorderColor = Color.Black; } else if (width == 0) { ((DataGridViewTextBoxCellEx)obj).TopBorderColor = Color.Empty; } } if (e.ChangedItem.Label == "下边框宽度") { color = ((DataGridViewTextBoxCellEx)obj).BottomBorderColor; width = ((DataGridViewTextBoxCellEx)obj).BottomBorderWidth; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0)) && width > 0) { ((DataGridViewTextBoxCellEx)obj).BottomBorderColor = Color.Black; } else if (width == 0) { ((DataGridViewTextBoxCellEx)obj).BottomBorderColor = Color.Empty; } } if (e.ChangedItem.Label == "左边框宽度") { color = ((DataGridViewTextBoxCellEx)obj).LeftBorderColor; width = ((DataGridViewTextBoxCellEx)obj).LeftBorderWidth; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0)) && width > 0) { ((DataGridViewTextBoxCellEx)obj).LeftBorderColor = Color.Black; } else if (width == 0) { ((DataGridViewTextBoxCellEx)obj).LeftBorderColor = Color.Empty; } } if (e.ChangedItem.Label == "右边框宽度") { color = ((DataGridViewTextBoxCellEx)obj).RightBorderColor; width = ((DataGridViewTextBoxCellEx)obj).RightBorderWidth; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0)) && width > 0) { ((DataGridViewTextBoxCellEx)obj).RightBorderColor = Color.Black; } else if (width == 0) { ((DataGridViewTextBoxCellEx)obj).RightBorderColor = Color.Empty; } } #endregion #region 如果设置了线条样式,默认设置颜色和宽度 if (e.ChangedItem.Label == "上边框线条样式") { color = ((DataGridViewTextBoxCellEx)obj).TopBorderColor; width = ((DataGridViewTextBoxCellEx)obj).TopBorderWidth; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0))) { ((DataGridViewTextBoxCellEx)obj).TopBorderColor = Color.Black; } if (width == 0) { ((DataGridViewTextBoxCellEx)obj).TopBorderWidth = 1; } } if (e.ChangedItem.Label == "下边框线条样式") { color = ((DataGridViewTextBoxCellEx)obj).BottomBorderColor; width = ((DataGridViewTextBoxCellEx)obj).BottomBorderWidth; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0))) { ((DataGridViewTextBoxCellEx)obj).BottomBorderColor = Color.Black; } if (width == 0) { ((DataGridViewTextBoxCellEx)obj).BottomBorderWidth = 1; } } if (e.ChangedItem.Label == "左边框线条样式") { color = ((DataGridViewTextBoxCellEx)obj).LeftBorderColor; width = ((DataGridViewTextBoxCellEx)obj).LeftBorderWidth; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0))) { ((DataGridViewTextBoxCellEx)obj).LeftBorderColor = Color.Black; } if (width == 0) { ((DataGridViewTextBoxCellEx)obj).LeftBorderWidth = 1; } } if (e.ChangedItem.Label == "右边框线条样式") { color = ((DataGridViewTextBoxCellEx)obj).RightBorderColor; width = ((DataGridViewTextBoxCellEx)obj).RightBorderWidth; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0))) { ((DataGridViewTextBoxCellEx)obj).RightBorderColor = Color.Black; } if (width == 0) { ((DataGridViewTextBoxCellEx)obj).RightBorderWidth = 1; } } #endregion #region 如果设置了颜色,默认给宽度设置值 color = ((DataGridViewTextBoxCellEx)obj).TopBorderColor; width = ((DataGridViewTextBoxCellEx)obj).TopBorderWidth; if (color != Color.Empty && width == 0) { ((DataGridViewTextBoxCellEx)obj).TopBorderWidth = 1; } else if (color.IsEmpty) { ((DataGridViewTextBoxCellEx)obj).TopBorderWidth = 0; } color = ((DataGridViewTextBoxCellEx)obj).LeftBorderColor; width = ((DataGridViewTextBoxCellEx)obj).LeftBorderWidth; if (color != Color.Empty && width == 0) { ((DataGridViewTextBoxCellEx)obj).LeftBorderWidth = 1; } else if (color.IsEmpty) { ((DataGridViewTextBoxCellEx)obj).LeftBorderWidth = 0; } color = ((DataGridViewTextBoxCellEx)obj).RightBorderColor; width = ((DataGridViewTextBoxCellEx)obj).RightBorderWidth; if (color != Color.Empty && width == 0) { ((DataGridViewTextBoxCellEx)obj).RightBorderWidth = 1; } else if (color.IsEmpty) { ((DataGridViewTextBoxCellEx)obj).RightBorderWidth = 0; } color = ((DataGridViewTextBoxCellEx)obj).BottomBorderColor; width = ((DataGridViewTextBoxCellEx)obj).BottomBorderWidth; if (color != Color.Empty && width == 0) { ((DataGridViewTextBoxCellEx)obj).BottomBorderWidth = 1; } else if (color.IsEmpty) { ((DataGridViewTextBoxCellEx)obj).BottomBorderWidth = 0; } color = ((DataGridViewTextBoxCellEx)obj).AllBorderColor; width = ((DataGridViewTextBoxCellEx)obj).AllBorderWidth; System.Drawing.Drawing2D.DashStyle dashstyle = ((DataGridViewTextBoxCellEx)obj).AllBorderStyle; //if (color != Color.Empty && color != Color.FromArgb(0,0,0,0) && width == 0) //{ // ((DataGridViewTextBoxCellEx)obj).AllBorderWidth = 1; // ((DataGridViewTextBoxCellEx)obj).AllBorderColor = Color.Empty; // ((DataGridViewTextBoxCellEx)obj).AllBorderStyle = System.Drawing.Drawing2D.DashStyle.Solid; // color = Color.Empty; // width = 1; // dashstyle = System.Drawing.Drawing2D.DashStyle.Solid; //} //else if (color.IsEmpty || color == Color.FromArgb(0, 0, 0, 0)) //{ // if (width > 0) // { // ((DataGridViewTextBoxCellEx)obj).AllBorderColor = Color.Black; // color = Color.Black; // } // else // { // ((DataGridViewTextBoxCellEx)obj).AllBorderWidth = 0; // width = 0; // } //} if (e.ChangedItem.PropertyDescriptor.Category == "全边框") { if (e.OldValue.GetType() == typeof(Color) && (Color)e.OldValue != color) { ((DataGridViewTextBoxCellEx)obj).TopBorderColor = color; ((DataGridViewTextBoxCellEx)obj).LeftBorderColor = color; ((DataGridViewTextBoxCellEx)obj).RightBorderColor = color; ((DataGridViewTextBoxCellEx)obj).BottomBorderColor = color; if (color != Color.Empty && width == 0) { ((DataGridViewTextBoxCellEx)obj).TopBorderWidth = 1; } else if (color.IsEmpty) { ((DataGridViewTextBoxCellEx)obj).TopBorderWidth = 0; } if (color != Color.Empty && width == 0) { ((DataGridViewTextBoxCellEx)obj).LeftBorderWidth = 1; } else if (color.IsEmpty) { ((DataGridViewTextBoxCellEx)obj).LeftBorderWidth = 0; } if (color != Color.Empty && width == 0) { ((DataGridViewTextBoxCellEx)obj).RightBorderWidth = 1; } else if (color.IsEmpty) { ((DataGridViewTextBoxCellEx)obj).RightBorderWidth = 0; } if (color != Color.Empty && width == 0) { ((DataGridViewTextBoxCellEx)obj).BottomBorderWidth = 1; } else if (color.IsEmpty) { ((DataGridViewTextBoxCellEx)obj).BottomBorderWidth = 0; } if (color != Color.Empty && width == 0) { ((DataGridViewTextBoxCellEx)obj).AllBorderWidth = 1; } else if (color.IsEmpty) { ((DataGridViewTextBoxCellEx)obj).AllBorderWidth = 0; } } if (e.OldValue.GetType() == typeof(int) && (int)e.OldValue != width) { ((DataGridViewTextBoxCellEx)obj).TopBorderWidth = width; ((DataGridViewTextBoxCellEx)obj).LeftBorderWidth = width; ((DataGridViewTextBoxCellEx)obj).RightBorderWidth = width; ((DataGridViewTextBoxCellEx)obj).BottomBorderWidth = width; color = ((DataGridViewTextBoxCellEx)obj).TopBorderColor; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0))) { ((DataGridViewTextBoxCellEx)obj).TopBorderColor = Color.Black; } if (width == 0) { ((DataGridViewTextBoxCellEx)obj).TopBorderColor = Color.Empty; ((DataGridViewTextBoxCellEx)obj).TopBorderWidth = 1; } color = ((DataGridViewTextBoxCellEx)obj).BottomBorderColor; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0))) { ((DataGridViewTextBoxCellEx)obj).BottomBorderColor = Color.Black; } if (width == 0) { ((DataGridViewTextBoxCellEx)obj).BottomBorderColor = Color.Empty; ((DataGridViewTextBoxCellEx)obj).BottomBorderWidth = 1; } color = ((DataGridViewTextBoxCellEx)obj).LeftBorderColor; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0))) { ((DataGridViewTextBoxCellEx)obj).LeftBorderColor = Color.Black; } if (width == 0) { ((DataGridViewTextBoxCellEx)obj).LeftBorderColor = Color.Empty; ((DataGridViewTextBoxCellEx)obj).LeftBorderWidth = 1; } color = ((DataGridViewTextBoxCellEx)obj).RightBorderColor; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0))) { ((DataGridViewTextBoxCellEx)obj).RightBorderColor = Color.Black; } if (width == 0) { ((DataGridViewTextBoxCellEx)obj).RightBorderColor = Color.Empty; ((DataGridViewTextBoxCellEx)obj).RightBorderWidth = 1; } color = ((DataGridViewTextBoxCellEx)obj).AllBorderColor; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0))) { ((DataGridViewTextBoxCellEx)obj).AllBorderColor = Color.Black; } if (width == 0) { ((DataGridViewTextBoxCellEx)obj).AllBorderColor = Color.Empty; ((DataGridViewTextBoxCellEx)obj).AllBorderWidth = 1; } } if (e.OldValue.GetType() == typeof(System.Drawing.Drawing2D.DashStyle) && (System.Drawing.Drawing2D.DashStyle)e.OldValue != dashstyle) { ((DataGridViewTextBoxCellEx)obj).TopBorderStyle = dashstyle; ((DataGridViewTextBoxCellEx)obj).LeftBorderStyle = dashstyle; ((DataGridViewTextBoxCellEx)obj).RightBorderStyle = dashstyle; ((DataGridViewTextBoxCellEx)obj).BottomBorderStyle = dashstyle; color = ((DataGridViewTextBoxCellEx)obj).TopBorderColor; width = ((DataGridViewTextBoxCellEx)obj).TopBorderWidth; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0))) { ((DataGridViewTextBoxCellEx)obj).TopBorderColor = Color.Black; } if (width == 0) { ((DataGridViewTextBoxCellEx)obj).TopBorderWidth = 1; } color = ((DataGridViewTextBoxCellEx)obj).BottomBorderColor; width = ((DataGridViewTextBoxCellEx)obj).BottomBorderWidth; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0))) { ((DataGridViewTextBoxCellEx)obj).BottomBorderColor = Color.Black; } if (width == 0) { ((DataGridViewTextBoxCellEx)obj).BottomBorderWidth = 1; } color = ((DataGridViewTextBoxCellEx)obj).LeftBorderColor; width = ((DataGridViewTextBoxCellEx)obj).LeftBorderWidth; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0))) { ((DataGridViewTextBoxCellEx)obj).LeftBorderColor = Color.Black; } if (width == 0) { ((DataGridViewTextBoxCellEx)obj).LeftBorderWidth = 1; } color = ((DataGridViewTextBoxCellEx)obj).RightBorderColor; width = ((DataGridViewTextBoxCellEx)obj).RightBorderWidth; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0))) { ((DataGridViewTextBoxCellEx)obj).RightBorderColor = Color.Black; } if (width == 0) { ((DataGridViewTextBoxCellEx)obj).RightBorderWidth = 1; } color = ((DataGridViewTextBoxCellEx)obj).AllBorderColor; width = ((DataGridViewTextBoxCellEx)obj).AllBorderWidth; if ((color == Color.Empty || color == Color.FromArgb(0, 0, 0, 0))) { ((DataGridViewTextBoxCellEx)obj).AllBorderColor = Color.Black; } if (width == 0) { ((DataGridViewTextBoxCellEx)obj).AllBorderWidth = 1; } } } #endregion } else if (obj.GetType() == typeof(DataGridViewCustomerCellStyle)) { PropertyDescriptorCollection props = TypeDescriptor.GetProperties(obj); foreach (PropertyDescriptor pd in props) { if (pd.Name == "CardName") { SetPropertyVisibility(obj, pd.Name, true); } } } pgrdCellProperty.SelectedObject = obj; } ////如果当前事件不为空,则注销该事件,防止多次注册事件 //if (this.InvokePropertyEvent != null) //{ // this.InvokePropertyEvent = null; //} //注册事件,并传入当前窗体的委托 if (this.InvokePropertyEvent == null) { this.InvokePropertyEvent += new DelegateProperty(CurrentForm.SetPropertyEvent); } else { this.InvokePropertyEvent = null; //this.InvokePropertyEvent -= new DelegateProperty(CurrentForm.SetPropertyEvent); this.InvokePropertyEvent += new DelegateProperty(CurrentForm.SetPropertyEvent); } OnSetPropertyEvent(pgrdCellProperty.SelectedObject); }
private void propertyGridCommand_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { Command cmd = this.propertyGridCommand.SelectedObject as Command; RefreshCommandList(cmd); }
void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { this.Refresh(); }
private void propertyGridFile_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { DeviceFile file = this.propertyGridFile.SelectedObject as DeviceFile; RefreshFileList(file); }
private void peripheralPropertyGrid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { this.pendingChanges = true; }
void Grid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { if (s == ModelGrid) { TreeViewEditorHelper.CheckPropertyValue(Model, e); if (e.ChangedItem.PropertyDescriptor.Name == "SourceGUID") { if (Model.SourceGUID == e.OldValue.ToString()) { return; } DialogResult result = DialogResult.Yes; if (Model.Elements.Count > 0 || Model.Restrictions.Count > 0 || Model.AggregateRestrictions.Count > 0) { result = MessageBox.Show("All the elements and restrictions defined will be lost. Do you want to continue ?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); } if (result == DialogResult.Yes) { if (Model.IsSQLModel) { Model.RefreshMetaTable(true); } initTreeView(); Model.Elements.Clear(); Model.Restrictions.Clear(); Model.AggregateRestrictions.Clear(); Model.InitEditor(); Model.Restriction = ""; Model.AggregateRestrictions.Clear(); Model.AggregateRestriction = ""; if (Model.IsLINQ) { Model.LINQSubModels.Clear(); Model.LINQSubTables.Clear(); } MainForm.UpdateModelNode(); ElementsToPanels(); } else { Model.SourceGUID = e.OldValue.ToString(); return; } } } else if (s == RestrictionGrid) { //Redraw restriction text if (((ReportRestriction)RestrictionGrid.SelectedObject).PivotPosition == PivotPosition.Data) { aggregateRestrictionsPanel.UpdateRestrictionText(); } else { restrictionsPanel.UpdateRestrictionText(); } } else if (s == ElementGrid) { //Redraw current buttons redrawButtons(); } string propertyName = e.ChangedItem.PropertyDescriptor.Name; //Disable rendering, except for display properties... if (propertyName != "CellCss" && propertyName != "DisplayNameEl" && propertyName != "Format" && propertyName != "NumericStandardFormat" && propertyName != "DateTimeStandardFormat" && propertyName != "DateTimeStandardFormatRe" && propertyName != "NumericStandardFormatRe" && propertyName != "FormatRe" && propertyName != "OperatorLabel") { MainForm.CannotRenderAnymore(); } MainForm.IsModified = true; }
void OnStrategySelectedViewModelChanged(object sender, PropertyValueChangedEventArgs<object> e) { SelectedViewModel = e.NewValue; SelectedViewModelChangedCommand.If(x => x.CanExecute(e)).Do(x => x.Execute(e)); if(e.OldValue != null) ActualViewInjectionManager.RaiseNavigatedAwayEvent(e.OldValue); if(e.NewValue != null) ActualViewInjectionManager.RaiseNavigatedEvent(e.NewValue); }
private void Campos_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { TextCampoLlave.Text = ((SIPV.Datos.ARTICULO)TablaBase).Articulo; }
void ElementReferencePathChanged(object sender, PropertyValueChangedEventArgs<string> args) { this.mergeElement.ConfigurationNodePath = args.Value; }
void ShapePropertiesPropertyChanged(object sender, PropertyValueChangedEventArgs e) { _svgMainFiles.PropertyChanged(e.ChangedItem, e.OldValue); }
protected virtual void RaiseOnPropertyChanged(PropertyValueChangedEventArgs e) { PropertyChanged?.Invoke(_senderSelf ? this : e.Source, e); }
private void OnPropertyValueChanged(object s, PropertyValueChangedEventArgs e) { ((Control)_pGrid.SelectedObject).Refresh(); Refresh(); }
private void propGridNaming_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { _previewForm?.UpdatePreview(); enableButtonConvert(); }
/// <summary>The property grid db connection_ property value changed.</summary> /// <param name="s">The s.</param> /// <param name="e">The e.</param> private void propertyGridDbConnection_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { SetDirty(); }
private void VariablePropertyGrid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { SetVariableLogic.Self.PropertyValueChanged(s, e); }
private void PropertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { //panel1.Refresh(); }
private void propertyGrid1_PropertyValueChanged_1(object s, PropertyValueChangedEventArgs e) { prntForm.frmBlueprints.UpdateTreeViewCreatures(); prntForm.frmBlueprints.UpdateTreeViewItems(); prntForm.frmBlueprints.UpdateTreeViewProps(); prntForm.frmBlueprints.UpdateTreeViewTriggers(); //e.ChangedItem.PropertyDescriptor.Name //brightburn if (prntForm.mod.wp_selectedProp != null && prntForm.mod.wp_selectedProp.ImageFileName != "none") { if (prntForm.mod.wp_selectedProp.WayPointList.Count > 1) { foreach (WayPoint wp in prntForm.mod.wp_selectedProp.WayPointList) { if (wp.departureTime == null) { return; } if (wp.departureTime.Contains("time") || wp.departureTime.Contains("Time") || wp.departureTime.Contains("TIME")) { return; } } if (prntForm.mod.wp_selectedProp.MoverType == "daily" || prntForm.mod.wp_selectedProp.MoverType == "weekly" || prntForm.mod.wp_selectedProp.MoverType == "monthly" || prntForm.mod.wp_selectedProp.MoverType == "yearly") { List <WayPoint> newList = new List <WayPoint>(); for (int i = prntForm.mod.wp_selectedProp.WayPointList.Count - 1; i >= 0; i--) { List <string> timeUnitsList = new List <string>(); int currentTimeInInterval = 0; //convert the string from the toolset for departure time into separate ints, filtering out ":" and blanks //format in toolset is number:number:number //with these ranges [0 to 336]:[0 to 23]:[0 to 59] //actually it's 1 to 336 for intuitive feeling, but below code treats zero and 1 the same way //think: 1 equals monday, 2 equals tuesday and so forth timeUnitsList = prntForm.mod.wp_selectedProp.WayPointList[i].departureTime.Split(':').Select(x => x.Trim()).ToList(); int dayCounter = Convert.ToInt32(timeUnitsList[0]); int hourCounter = Convert.ToInt32(timeUnitsList[1]); int minuteCounter = Convert.ToInt32(timeUnitsList[2]); //catch entries of zero //counter is reduced by one to make below calculation work the same for day/minutes/hours if ((dayCounter == 0) || (dayCounter == 1)) { dayCounter = 0; } else { dayCounter = (dayCounter - 1); } //turn the the three counters into one number for departure time (in minutes) int convertedDepartureTime = dayCounter * 1440 + hourCounter * 60 + minuteCounter; bool wasInserted = false; //foreach (WayPoint wp2 in newList) for (int j = newList.Count - 1; j >= 0; j--) { //departure time determine List <string> timeUnitsList2 = new List <string>(); int currentTimeInInterval2 = 0; //convert the string from the toolset for departure time into separate ints, filtering out ":" and blanks //format in toolset is number:number:number //with these ranges [0 to 336]:[0 to 23]:[0 to 59] //actually it's 1 to 336 for intuitive feeling, but below code treats zero and 1 the same way //think: 1 equals monday, 2 equals tuesday and so forth timeUnitsList2 = newList[j].departureTime.Split(':').Select(x => x.Trim()).ToList(); int dayCounter2 = Convert.ToInt32(timeUnitsList2[0]); int hourCounter2 = Convert.ToInt32(timeUnitsList2[1]); int minuteCounter2 = Convert.ToInt32(timeUnitsList2[2]); //catch entries of zero //counter is reduced by one to make below calculation work the same for day/minutes/hours if ((dayCounter2 == 0) || (dayCounter2 == 1)) { dayCounter2 = 0; } else { dayCounter2 = (dayCounter2 - 1); } //turn the the three counters into one number for departure time (in minutes) int convertedDepartureTime2 = dayCounter2 * 1440 + hourCounter2 * 60 + minuteCounter2; //if waypoint org earlier/smaller, nothing //if waypoint org later/higher, insert at+1 if (convertedDepartureTime > convertedDepartureTime2) { newList.Insert(j + 1, prntForm.mod.wp_selectedProp.WayPointList[i].DeepCopy()); wasInserted = true; break; } //when through whole lsot and never larger, place at zero } if (!wasInserted) { newList.Insert(0, prntForm.mod.wp_selectedProp.WayPointList[i].DeepCopy()); } } newList[0].departureTime = "1:0:1"; newList[newList.Count - 1].X = newList[0].X; newList[newList.Count - 1].Y = newList[0].Y; //int relevantTimePerStep = 0; if (prntForm.mod.wp_selectedProp.MoverType == "daily") { newList[newList.Count - 1].departureTime = "1:23:59"; } if (prntForm.mod.wp_selectedProp.MoverType == "weekly") { newList[newList.Count - 1].departureTime = "7:23:59"; } if (prntForm.mod.wp_selectedProp.MoverType == "monthly") { newList[newList.Count - 1].departureTime = "28:23:59"; } if (prntForm.mod.wp_selectedProp.MoverType == "yearly") { newList[newList.Count - 1].departureTime = "336:23:59"; } prntForm.mod.wp_selectedProp.WayPointList.Clear(); foreach (WayPoint wp in newList) { prntForm.mod.wp_selectedProp.WayPointList.Add(wp.DeepCopy()); } try { if (prntForm.mod.wp_selectedProp.WayPointList.Count > prntForm.mod.currentlySelectedWayPointIndex) { prntForm.frmIceBlinkProperties.propertyGrid1.SelectedObject = prntForm.mod.wp_selectedProp.WayPointList[prntForm.mod.currentlySelectedWayPointIndex]; } } catch { } } } } }
private void rulingspanPropertyGrid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { RefreshAndPaintGrid(); }
void PropertyGridPropertyValueChanged(object sender, PropertyValueChangedEventArgs e) { editor.AttributeChanged(); packageFilesTreeView.RefreshSelectedElement(); }
private void connStrProps_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { connectionString.Text = builder.ConnectionString; }
private void propertyGrid_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { btnSave.Enabled = true; }
private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { ForceMapChanged(); }
void ElementViewModelReferencePathChanged(object sender, PropertyValueChangedEventArgs<string> args) { environmentOverridenElementData.UpdateElementPath(args.Value); }
private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { appX1.Write(e.ChangedItem.Label); UpdatedSelectedNodeText(); }
void ReferenceNameChanged(object sender, PropertyValueChangedEventArgs<string> args) { string referenceName = args.Value; base.Value = referenceName; }
protected virtual void OnPropertyChanged(PropertyValueChangedEventArgs e) { PropertyChanged?.Invoke(this, e); }
void EditorDialog_PropertyChanged(object source, PropertyValueChangedEventArgs e) { PropertyDescriptor desc; PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(this.component); this.SetProperty(component, properties, e.PropertyName, e.PropertyValue, out desc); SetMapPreview(); base.OnPropertyChanged(EventArgs.Empty); this.RecreateChildControls(); }
private void pgSettings_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { UpdatePreview(); }