public static void unInitEditing()
        {
            try
            {
                if (AAState._sw != null)
                {
                    AAState.WriteLine("**************************************");
                    AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_4a") + DateTime.Now.ToString());
                    AAState._sw.Flush();
                    AAState._sw.Close();
                    AAState._sw = null;

                }
                AAState._filePath = "";
                // Globals.LogLocations = AAState._filePath;
            }
            catch { }
            try
            {

                _editEvents.OnChangeFeature -= FeatureChange;
                _editEvents.OnCreateFeature -= FeatureCreate;
                _editEvents2.BeforeStopOperation -= StopOperation; // SG Jan 2013
                _currentUserInfo = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorError_4a") + ex.Message);

            }
        }
 public static bool reInitExt()
 {
     AAState.indent = "";
     bool blState = AAState.initTable();
     AAState.createLastValuePropertySet();
     _currentUserInfo = new CurrentUserInfo(AAState._editor);
     return blState;
 }
コード例 #3
0
        public static void unInitEditing()
        {
            try
            {
                if (AAState._sw != null)
                {
                    AAState._sw.Flush();
                    AAState._sw.Close();
                    AAState._sw = null;
                }
                AAState._filePath = "";

            }
            catch { }
            try
            {

                //lastValueProperties = null;

                _editEvents.OnChangeFeature -= FeatureChange;
                _editEvents.OnCreateFeature -= FeatureCreate;

                _currentUserInfo = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error on the Stop Editing: " + ex.Message);

            }
        }
        public static void unInitEditing()
        {
            try
            {
                if (AAState._sw != null)
                {
                    AAState.WriteLine("**************************************");
                    AAState.WriteLine("Closing Log File " + DateTime.Now.ToString());
                    AAState._sw.Flush();
                    AAState._sw.Close();
                    AAState._sw = null;

                }
                AAState._filePath = "";
                // Globals.LogLocations = AAState._filePath;
            }
            catch { }
            try
            {

                _editEvents.OnChangeFeature -= FeatureChange;
                _editEvents.OnCreateFeature -= FeatureCreate;
                _editEvents2.BeforeStopOperation -= StopOperation; // SG Jan 2013
                _currentUserInfo = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error on the Stop Editing: " + ex.Message);

            }
        }
コード例 #5
0
        public static void initEditing()
        {
            if (AAState._PerformUpdates == false)
                return;

            // wire events
            if (reInitExt() == false)
            {
                AAState._PerformUpdates = false;
                //AAState.setIcon();
                //return;
            }
            if (AAState._editor.EditWorkspace != null)
            {
                if (AAState._editor.EditWorkspace.Type == esriWorkspaceType.esriFileSystemWorkspace)
                {
                    AAState._PerformUpdates = false;
                    //AAState.setIcon();
                }
            }
            if (AAState._PerformUpdates)
            {
                if (_Debug.ToUpper() == "TRUE")
                {
                    AAState._filePath = Globals.PromptForSave();
                    if (AAState._filePath != "")
                    {
                        AAState._sw = Globals.createTextFile(AAState._filePath, FileMode.Create);
                    }
                }
                else
                {
                    AAState._sw = null;

                }

                // Get user Info
                _currentUserInfo = new CurrentUserInfo(AAState._editor);

                reInitExt();

                //obtain rotation calculator
                AAState.rCalc = new RotationCalculator(ArcMap.Application);

                //Create WGS_84 SR
                ISpatialReferenceFactory srFactory = new SpatialReferenceEnvironmentClass();
                IGeographicCoordinateSystem gcs = srFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);
                _sr1 = gcs;

                // Action[] handlers = _editEvents.OnChangeFeature.GetInvocationList();

                _editEvents.OnChangeFeature += FeatureChange;
                _editEvents.OnCreateFeature += FeatureCreate;
                // get configuration table

            }
            else
            {
                //MessageBox.Show("The Attribute Assistant is turned on, but the Dynamic Value table is missing, please add the table and toggle the extension on");

                // WriteLine("Dynamic Value Table is missing - Name in Config:" + AAState._defaultsTableName);

                AAState._PerformUpdates = false;
                AAState.setIcon();// ExecuteToggleAACommands();
                _editEvents.OnChangeFeature -= FeatureChange;
                _editEvents.OnCreateFeature -= FeatureCreate;
                MessageBox.Show("AA Extension has been turned off");

                // get configuration table

            }

            ArcMap.Application.StatusBar.set_Message(0, "Editor Extension Initialized");
        }