ArcGIS4LocalGovernment.AttributeAssistantEditorExtension.sendEvent C# (CSharp) Метод

sendEvent() приватный Метод

private sendEvent ( IObject inObject, string mode ) : void
inObject IObject
mode string
Результат void
        private void sendEvent(IObject inObject, string mode)
        {
            if (AAState._Suspend == true)
            {
                AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantMess_1e"));

                return;
            }
            try
            {
                if (AAState.PerformUpdates == false)
                {
                    AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_12a"));

                    return;
                }
                AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_12b") + AAState._processCount);
                if (_LastOID == inObject.OID && _LastMode == mode && _LastFC == inObject.Class.AliasName && AAState._processCount > 0)
                {
                    AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_12c"));
                    _LastOID = -1;
                    _LastMode = "";
                    _LastFC = "";
                    return;
                }
                _LastOID = inObject.OID;
                _LastMode = mode;
                _LastFC = inObject.Class.AliasName;

                try
                {
                    AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14at"));

                    AAState.changeFeature -= OnChangeFeature;
                    AAState.changeGeoFeature -= OnChangeGeoFeature;
                    AAState.createFeature -= OnCreateFeature;
                    AAState.stopOperation -= OnBeforeStopOperation; // SG Jan 2013
                    if (AAState.Debug().ToUpper() == "TRUE")
                    {
                        if (AAState._sw == null && AAState._filePath != "")
                        {

                            AAState._sw = Globals.createTextFile(AAState._filePath, FileMode.Append);
                            Globals.LogLocations = AAState._filePath;

                        }
                        AAState.WriteLine("#######################################################");

                        AAState.WriteLine(inObject.Class.AliasName + " - " + mode.ToString());
                    }
                    List<IObject> newFeatureList = null;
                    List<IObject> changedFeatureList = null;
                    List<IObject> changedFeatureGeoList = null;
                    try
                    {
                        AAState._onStopOperationEvent = false; // SG Jan 2013 - on a real onchange event flag that it was not a stopoperation event from a source like A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorChain8")

                        AAState._processCount++;
                        //Set attributes based on the dynamic defaults configuration table
                        bool success = SetDynamicValues(inObject, mode, out changedFeatureList, out newFeatureList, out changedFeatureGeoList);
                        if (!success)
                        {

                            // MessageBox.Show(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorChain9"));
                            return;
                        }
                        else
                        {
                            if (changedFeatureList != null)
                            {
                                processFeatures(changedFeatureList, "ON_CHANGE");
                            }
                            if (changedFeatureGeoList != null)
                            {
                                processFeatures(changedFeatureGeoList, "ON_CHANGEGEO");
                            }
                            if (newFeatureList != null)
                            {
                                processFeatures(newFeatureList, "ON_CREATE");
                            }

                        }
                    }
                    catch
                    {

                    }
                    finally
                    {
                        AAState._processCount--;
                        try
                        {
                            if (changedFeatureList != null)
                            {
                                changedFeatureList.Clear();
                            }
                        }
                        catch
                        { }
                        changedFeatureList = null;
                        try
                        {
                            if (newFeatureList != null)
                            {
                                newFeatureList.Clear();
                            }
                        }
                        catch
                        { }
                        newFeatureList = null;

                        try
                        {
                            if (changedFeatureGeoList != null)
                            {
                                changedFeatureGeoList.Clear();
                            }
                        }
                        catch
                        { }
                        changedFeatureGeoList = null;
                        if (AAState._sw != null)
                        {
                            if (AAState._processCount == 0)
                            {
                                AAState.WriteLine("#######################################################");
                                AAState._sw.Flush();

                            }
                        }

                    }

                }
                finally
                {
                    AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14au"));
                    AAState.changeFeature += OnChangeFeature;
                    AAState.changeGeoFeature += OnChangeGeoFeature;
                    AAState.createFeature += OnCreateFeature;
                    AAState.stopOperation += OnBeforeStopOperation; // SG Jan 2013
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorError_12a") + ex.Message);

            }
        }