POST
|
The problem is, that by documentation ItemAdded is event, but actually in object browser ItemAdded is method.
... View more
09-01-2011
05:51 AM
|
0
|
0
|
156
|
POST
|
Documentation: IActiveViewEvents.ItemAdded Event [C#] public event ItemAddedEventHandler ItemAdded Reality: // Summary: // Provides access to events that occur when the state of the active view changes. [Guid("E79C5940-52DD-11D0-98BE-00805F7CED21")] [InterfaceType(1)] [TypeLibType(256)] public interface IActiveViewEvents { ... // // Summary: // Fired when an item is added to the view. void ItemAdded(object Item); ... } And how I'm supposed to use IActiveViewEvents?
... View more
09-01-2011
01:54 AM
|
0
|
3
|
608
|
POST
|
Dubravko Antoni�?, thank you a lot. IRowChanges solved almost all my problems. Do you know if there is a good way of aborting edit operation or there is only a way of restoring field data?
... View more
08-09-2011
03:48 AM
|
0
|
0
|
377
|
POST
|
Maybe faster way is on the DB side. http://www.mssqltips.com/tip.asp?tip=2124 Yes it will help with ArcSDE users, but I need to check local shape and gdb file changes. The problem is not to allow changes, which are made by mistake.
... View more
08-09-2011
02:20 AM
|
0
|
0
|
377
|
POST
|
Hi, I have a task to lock fields editing for specific users. I started to check IEditEvents_Event with it's OnChangeFeature event, but I can't understand what exactly was changed and what was the original value. Also I failed all my attempts to undo changes. If I use IEditor.AbortOperation() it breaks ArcMap, if I use throw new COMException(msg, (int)0x80004005L) it does nothing. As workaround for detecting field changes I came up with: [PHP] private void FeatureChanged(IObject feature) { var editor = _editor as IEditor; if (editor != null) { var workspaceEdit = (editor.EditWorkspace as IWorkspaceEdit2); var changes = workspaceEdit.get_EditDataChanges(esriEditDataChangesType.esriEditDataChangesWithinOperation); var classes = changes.ModifiedClasses; var @class = classes.Next(); var cursor = changes.ExtractEx(@class, esriDifferenceType.esriDifferenceTypeUpdateNoChange); // Prepare the output parameters. int featureID = -1; IRow sourceRow = null; IRow differenceRow = null; ILongArray fieldIndexes = null; // Iterate through the cursor. cursor.Next(out featureID, out sourceRow, out differenceRow, out fieldIndexes); while (featureID != -1) { for (int i = 0; i < fieldIndexes.Count; i++) { var index = fieldIndexes.get_Element(i); if (index >= 3) // Stub { } } cursor.Next(out featureID, out sourceRow, out differenceRow, out fieldIndexes); } } } [/PHP] But the logic is very disgusting as I don't work with feature which came in handler. So the question is - how to detect feature attribute changes for concrete columns, and undo it in some cases correctly?
... View more
08-09-2011
12:58 AM
|
0
|
5
|
1515
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|