NullReferenceException while extending PanMapAction class.
上次发布: April 3, 2018ArcGIS Runtime for Windows Mobile
漏洞 ID 编号
NIM046947
已提交
July 21, 2009
上次修改时间
April 28, 2025
适用范围
ArcGIS Runtime for Windows Mobile
找到的版本
9.3.1
编程语言
C#
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
On July 1, 2017 Esri retired the ArcGIS for Windows Mobile product and we encourage customers to migrate mobile field editing projects to Collector for ArcGIS app or another ArcGIS App available at http://www.esri.com/software/apps.
解决办法
1) Extend MapAction class instead.
The following supresses the exception:
2) Override the OnActiveChanging function for the PanMapAction class. In MyPan.cs, enter the following piece of code (or uncomment the block):
protected override void OnActiveChanging(bool active)
{
try
{
//base.OnActiveChanging(active);
}
catch (Exception ex)
{
System.Diagnostics.Debug.Write(ex.StackTrace.ToString());
}
}
Note: Uncommenting the line:
base.OnActiveChanging(active);
will cause similar exception:
A first chance exception of type 'System.NullReferenceException' occurred in System.Windows.Forms.dll
at System.Windows.Forms.Cursor..ctor(Stream stream)
at ESRI.ArcGIS.Mobile.MapActions.PanMapAction.OnActiveChanging(Boolean active)