| | |
| | | namespace HStation.WinFrmUI |
| | | using DevExpress.Mvvm.Native; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | | public partial class MapViewProjectListContainer : UserControl, IMapViewProjectListContainer |
| | | { |
| | |
| | | } |
| | | |
| | | public event Action LoadCompletedEvent; |
| | | |
| | | public event Action LoadFailedEvent; |
| | | |
| | | public event Action<HandingError> HandingErrorEvent; |
| | | |
| | | public event Action<string> JumpSimulationEvent; |
| | | |
| | | public event Action<long> JumpDirectEvent; |
| | | |
| | | /// <summary> |
| | | /// 交互对象 |
| | |
| | | return _callBackObj; |
| | | } |
| | | } |
| | | |
| | | private MapViewProjectListCallBackObj _callBackObj; |
| | | |
| | | /// <summary> |
| | |
| | | return _isInitialized; |
| | | } |
| | | } |
| | | private bool _isInitialized; |
| | | |
| | | /// <summary> |
| | | /// 显示边框 |
| | | /// </summary> |
| | | [Browsable(true)] |
| | | public bool ShowBoder { get; set; } |
| | | private bool _isInitialized; |
| | | |
| | | /// <summary> |
| | | /// 初始话容器 |
| | |
| | | callBackObj.LoadCompletedEvent += CallBackObj_LoadCompletedEvent; |
| | | callBackObj.LoadFailedEvent += CallBackObj_LoadFailedEvent; |
| | | callBackObj.HandingErrorEvent += CallBackObj_HandingErrorEvent; |
| | | callBackObj.JumpSimulationEvent += CallBackObj_JumpSimulationEvent; |
| | | await this.webViewControl1.InitialWebBrower(MapViewProjectListUrlHelper.GetUrl(), callBackObj, true); |
| | | } |
| | | |
| | | //跳转方案 |
| | | private void CallBackObj_JumpSimulationEvent(string obj) |
| | | { |
| | | if (long.TryParse(obj, out long PrjID)) |
| | | { |
| | | JumpDirectEvent.Invoke(PrjID); |
| | | } |
| | | } |
| | | |
| | | //加载完成 |
| | |
| | | /// <summary> |
| | | /// 设置项目列表 |
| | | /// </summary> |
| | | public async Task<bool> SetProjectList(List<XhsProjectStdDto> allProjectList) |
| | | public async Task<bool> SetProjectList(List<XhsProjectVmo> allProjectList) |
| | | { |
| | | if (!_isInitialized) |
| | | { |
| | | return false; |
| | | } |
| | | var allProjectIds = allProjectList?.Select(x => x.ID).Distinct().ToList(); |
| | | var allMapInfoList = await new Yw.BLL.MapInfoStd().GetByObjectTypeAndObjectIdsOfKindPurpose |
| | | var allMapInfoList = await new Yw.BLL.MapInfo().GetByObjectTypeAndObjectIdsOfKindPurpose |
| | | (HStation.Xhs.DataType.XhsProject, allProjectIds, Yw.Map.Kind.Gaodei, Yw.Map.Purpose.Location); |
| | | var vmList = new List<MapProjectViewModel>(); |
| | | if (allMapInfoList != null && allMapInfoList.Count > 0) |
| | |
| | | { |
| | | return await this.webViewControl1.EvaluateScriptAsync<bool>("cancelSelectProject()"); |
| | | } |
| | | |
| | | //绘制边框 |
| | | protected override void OnPaint(PaintEventArgs e) |
| | | { |
| | | base.OnPaint(e); |
| | | if (this.ShowBoder) |
| | | { |
| | | this.DrawBorder(e, Color.LightGray); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |