?? selecttool.cs
字號:
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;
using ESRI.ArcGIS.ADF.Web.UI.WebControls.Tools;
using ESRI.ArcGIS.ADF.Web.UI.WebControls;
using ESRI.ArcGIS.ADF.Web.DataSources;
using ESRI.ArcGIS.ADF.Web.DataSources.Graphics;
using ESRI.ArcGIS.ADF.Web.Display.Graphics;
namespace SelectToolTask
{
class SelectTool : IMapServerToolAction, IToolbarItemSetup
{
#region IToolbarItemSetup Members
ToolbarItemInfo toolbarItemInfo;
public void Initialize(ToolbarItemInfo info)
{
// information on the tool, including task that rendered it,
// is passed in automatically by implementing IToolbarItemSetup
toolbarItemInfo = info;
}
public void Unload(ToolbarItemInfo info)
{
}
#endregion
#region IMapServerToolAction Members
public void ServerAction(ToolEventArgs args)
{
// Get task via hierarchy used during task rendering: Toolbar.Cell.Row.Table.Task
SelectToolTask gsTask =
toolbarItemInfo.Toolbar.Parent as SelectToolTask;
Map mapCtrl = args.Control as Map;
if (gsTask != null)
{
// Convert the screen coordinates to map geometry - need to
// save it in map coordinates so we can re-run the task
ESRI.ArcGIS.ADF.Web.Geometry.Geometry selectGeometry =
Utilities.ToAdfGeometry(args, mapCtrl,
gsTask.PointSelectionTolerance);
// Call Task method to save the geometry - Task also then performs
// callback to itself to execute the task
gsTask.SetSelectionGeometry(selectGeometry);
}
else
mapCtrl.CallbackResults.Add(null, "javascript", new string[] {
"運行任務出錯. 請聯系網站管理員.\n"+
"(技術細節: SelectTool.ServerAction 沒有找到任務對象.)"});
return;
}
#endregion
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -