ArcGIS Pro 删除记录时提示
protected override void OnClick() { QueuedTask.Run(() => { Table table = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().FirstOrDefault().GetTable(); RowDeletedEvent.Subscribe(OnRowDeletedEvent, table); }); } private static Guid _lastEdit = Guid.Empty; private static void OnRowDeletedEvent1(RowChangedEventArgs obj) { if (_lastEdit != obj.Guid) { //cancel with dialog // Note - feature edits on Hosted and Standard Feature Services cannot be cancelled. obj.CancelEdit("Delete Event\nAre you sure", true); _lastEdit = obj.Guid; } } public static long CurrentlyDeletingOID = 0; protected static void OnRowDeletedEvent(RowChangedEventArgs args) { try { long _deletingOID = args.Row.GetObjectID(); if (CurrentlyDeletingOID != _deletingOID) { MessageBoxResult mbr = ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show( "Are you sure you want to Delete this Feature?", "Confirm Delete", MessageBoxButton.YesNo, MessageBoxImage.Warning); if (mbr == MessageBoxResult.Yes) { //PROCEED with the delete args.CancelEdit(() => Task.FromResult(true)); //Need to set this so that the code doesn't get stuck in loop, no need to reset CurrentlyDeletingOID = _deletingOID; } else { //CANCEL the Delete args.CancelEdit(() => Task.FromResult(false)); } //cancel with dialog using ESRI commands //args.CancelEdit("Delete Event\nAre you sure", true); } } catch (Exception e) { //logError("onRowDeleteEvent", e); } }
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
2015-03-22 C# 图片识别(支持21种语言)转
2013-03-22 方框内打勾(钩)的符号(word和excel)
2012-03-22 ae 10修改字体大小和名称
2010-03-22 ArcGIS Engine自定义工具类,实现添加图名,比例尺
2010-03-22 2007年度遥感平台软件测评大纲