| | |
| | | using DevExpress.XtraBars; |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraEditors.Repository; |
| | | using DevExpress.XtraLayout.Utils; |
| | | using DevExpress.XtraVerticalGrid.Events; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | | |
| | | public partial class HomeXhsProjectPropertyCtrl : XtraUserControl |
| | | { |
| | | public HomeXhsProjectPropertyCtrl() |
| | | { |
| | | InitializeComponent(); |
| | | this.layoutControl1.SetupLayoutControl(); |
| | | SetDescriptionVisible(true);//默认设置属性描述面板显示 |
| | | SetDescriptionVisible(false);//默认设置属性描述面板不显示 |
| | | this.barBtnDirect.Visibility = BarItemVisibility.Never; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 跳转事件 |
| | | /// </summary> |
| | | public event Action<long> JumpDirectEvent; |
| | | |
| | | /// <summary> |
| | | /// 绑定对象 |
| | |
| | | { |
| | | if (this.SelectedObject == null) |
| | | { |
| | | |
| | | this.barBtnDirect.Visibility = BarItemVisibility.Never; |
| | | } |
| | | else |
| | | { |
| | | |
| | | this.barBtnDirect.Visibility = BarItemVisibility.Always; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 属性显示名称和描述 |
| | | |
| | | #region bool |
| | | |
| | |
| | | e.RepositoryItem = ckEdit; |
| | | } |
| | | |
| | | #endregion |
| | | #endregion bool |
| | | |
| | | #region 富文本 |
| | | |
| | |
| | | e.RepositoryItem = memoEdit; |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 富文本 |
| | | |
| | | #region 图片 |
| | | |
| | |
| | | e.Row.Expanded = true; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion 图片 |
| | | } |
| | | |
| | | //属性值正在改变 |
| | | void propertyGridControl1_CellValueChanging(object sender, DevExpress.XtraVerticalGrid.Events.CellValueChangedEventArgs e) |
| | | private void propertyGridControl1_CellValueChanging(object sender, DevExpress.XtraVerticalGrid.Events.CellValueChangedEventArgs e) |
| | | { |
| | | |
| | | } |
| | | |
| | | //属性值改变,更新地图和JsonModel对象 |
| | | void propertyGridControl1_CellValueChanged(object sender, DevExpress.XtraVerticalGrid.Events.CellValueChangedEventArgs e) |
| | | private void propertyGridControl1_CellValueChanged(object sender, DevExpress.XtraVerticalGrid.Events.CellValueChangedEventArgs e) |
| | | { |
| | | var fieldName = e.Row.Properties.FieldName.Split(new char[] { '.' }).Last(); |
| | | var descriptor = this.propertyGridControl1.GetPropertyDescriptor(e.Row); |
| | |
| | | { |
| | | this.propertyGridControl1.CollapseAllRows(); |
| | | } |
| | | |
| | | //跳转 |
| | | private void barBtnDirect_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | if (this.SelectedObject == null) |
| | | { |
| | | return; |
| | | } |
| | | JumpDirectEvent?.Invoke(this.SelectedObject.Project.ID); |
| | | } |
| | | } |
| | | } |
| | | } |