Skip to content
This repository has been archived by the owner on Dec 4, 2017. It is now read-only.

Commit

Permalink
fixed issue #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Haoliang Yu committed Feb 24, 2015
1 parent 505b5ae commit 6eea6bb
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 7 deletions.
Binary file modified ARES.suo
Binary file not shown.
14 changes: 8 additions & 6 deletions ARES/Editor/EditTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ public EditTool()

private INewEnvelopeFeedback newEnvelopeFeedback = null;

private ILayer activeLayer = null;

private Position maxIndex = null;

#endregion
Expand Down Expand Up @@ -113,13 +111,17 @@ protected override void OnActivate()
dockWindow.Show(true);
}

activeLayer = Editor.ActiveLayer;
IRasterLayer rasterLayer = (IRasterLayer)activeLayer;
if (Editor.ActiveLayer == null)
{
return;
}

IRasterLayer rasterLayer = (IRasterLayer)Editor.ActiveLayer;
IRasterProps rasterProp = (IRasterProps)rasterLayer.Raster;
maxIndex = new Position(rasterProp.Width - 1, rasterProp.Height - 1);

EditForm editForm = AddIn.FromID<EditForm.AddinImpl>(ThisAddIn.IDs.EditForm).UI;
editForm.SetLayer(activeLayer.Name);
editForm.SetLayer(Editor.ActiveLayer.Name);
System.Array noDataValue = (System.Array)rasterProp.NoDataValue;
editForm.RasterGridView.NoDataValue = Convert.ToDouble(noDataValue.GetValue(0));
editForm.SetNoDataValue(editForm.RasterGridView.NoDataValue);
Expand Down Expand Up @@ -227,7 +229,7 @@ protected override void OnMouseUp(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs
}
}

IRasterLayer rasterLayer = (IRasterLayer)activeLayer;
IRasterLayer rasterLayer = (IRasterLayer)Editor.ActiveLayer;
double[,] values = Raster.GetValues(tlCorner, brCorner, rasterLayer.Raster);
editForm.SetValues(tlCorner, brCorner, values);

Expand Down
6 changes: 5 additions & 1 deletion ARES/Editor/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static void StartEditing()

Editor.activeLayer = selectLayerForm.ReturnLayer;
}

Editor.IsEditing = true;
Editor.Edits.Clear();

Expand Down Expand Up @@ -166,6 +166,10 @@ public static void StopEditing()

ShowEditsButton showEditsButton = AddIn.FromID<ShowEditsButton>(ThisAddIn.IDs.ShowEditsButton);
showEditsButton.IsEnabled = false;

EditForm editForm = AddIn.FromID<EditForm.AddinImpl>(ThisAddIn.IDs.EditForm).UI;
editForm.ClearValues();
editForm.SetLayer("");
}

/// <summary>
Expand Down
Binary file modified ARES/bin/Debug/ARES.dll
Binary file not shown.
Binary file modified ARES/bin/Debug/ARES.esriAddIn
Binary file not shown.
Binary file modified ARES/bin/Debug/ARES.pdb
Binary file not shown.
Binary file modified ARES/obj/Debug/ARES.dll
Binary file not shown.
Binary file modified ARES/obj/Debug/ARES.pdb
Binary file not shown.
Binary file modified ARES/obj/Debug/DesignTimeResolveAssemblyReferences.cache
Binary file not shown.

0 comments on commit 6eea6bb

Please sign in to comment.