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

OnStartup() защищенный Метод

protected OnStartup ( ) : void
Результат void
        protected override void OnStartup()
        {
            ESRI.ArcGIS.ArcMap.IApplicationStatusEvents_Event appStatusEvents = ArcMap.Application as ESRI.ArcGIS.ArcMap.IApplicationStatusEvents_Event;
            appStatusEvents.Initialized += new ESRI.ArcGIS.ArcMap.IApplicationStatusEvents_InitializedEventHandler(appStatusEvents_Initialized);

            ArcMap.Events.NewDocument += ArcMap_NewOpenDocument;
            ArcMap.Events.OpenDocument += ArcMap_NewOpenDocument;
            ArcMap.Events.CloseDocument += ArcMap_CloseDocument;
            ReloadMonitor.reloadConfig += new ReloadEventHandler(reloadOccured);

            GetConfigSettings();
            if (!_enabledOnStart | AAState._dt == null)
            {
                AAState.PerformUpdates = false;
                AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_9a"));

            }
            IEditor _editor = Globals.getEditor(ArcMap.Application);

            //Wire editor events.
            AAState._editEvents = (IEditEvents_Event)_editor;
            AAState._editEvents.OnStartEditing += OnStartEditing;

            AAState._editEvents.OnStopEditing += OnStopEditing;
            AAState._editEvents2 = (IEditEvents2_Event)_editor;// SG Jan 2003-

            try
            {
                script = new MSScriptControl.ScriptControlClass();
                script.AllowUI = false;
                script.Language = "VBScript";
                script.UseSafeSubset = true;

                string strScript = "function iif(psdStr, trueStr, falseStr)" + System.Environment.NewLine +
                    "On Error Resume Next" + System.Environment.NewLine +
                    "if psdStr then" + System.Environment.NewLine +
                            "iif = trueStr" + System.Environment.NewLine +
                          "else " + System.Environment.NewLine +
                            "iif = falseStr" + System.Environment.NewLine +
                          "end if" + System.Environment.NewLine +
                        "end function" + System.Environment.NewLine;
                string strScript2 = "function TCase(strTextString)" + System.Environment.NewLine +
                    "Dim arrTextItem, strTextNew" + System.Environment.NewLine +
                    "strSplitText = \" '-\"" + System.Environment.NewLine +
                    "For y = 1 to len(strSplitText)" + System.Environment.NewLine +
                    "strSplitItem = Mid(strSplitText,y,1)" + System.Environment.NewLine +
                    "arrTextItem = Split(strTextString, strSplitItem)" + System.Environment.NewLine +
                    "For x = 0 to Ubound(arrTextItem)" + System.Environment.NewLine +
                    "If strSplitItem = \"'\" Then" + System.Environment.NewLine +
                    "If Mid(arrTextItem(x),2,1) = \" \" Then" + System.Environment.NewLine +
                    "strTextNew = strTextNew & strSplitItem & LCase(Left(arrTextItem(x),1)) & Right(arrTextItem(x),Len(arrTextItem(x))-1)" + System.Environment.NewLine +
                    "Else" + System.Environment.NewLine +
                    "strTextNew = strTextNew & strSplitItem & UCase(Left(arrTextItem(x),1)) & Right(arrTextItem(x),Len(arrTextItem(x))-1)" + System.Environment.NewLine +
                    "End If" + System.Environment.NewLine +
                    "Else" + System.Environment.NewLine +
                    "If strSplitItem = \"-\" Then" + System.Environment.NewLine +
                    "strTextNew = strTextNew & strSplitItem & UCase(Left(arrTextItem(x),1)) & Right(arrTextItem(x),Len(arrTextItem(x))-1)" + System.Environment.NewLine +
                    "Else" + System.Environment.NewLine +
                    "strTextNew = strTextNew & strSplitItem & UCase(Left(arrTextItem(x),1)) & LCase(Right(arrTextItem(x),Len(arrTextItem(x))-1))" + System.Environment.NewLine +
                    "End If" + System.Environment.NewLine +
                    "End If" + System.Environment.NewLine +
                    "Next" + System.Environment.NewLine +
                    "strTextString = Right(strTextNew,Len(strTextNew)-1)" + System.Environment.NewLine +
                    "strTextNew = \"\"" + System.Environment.NewLine +
                    "Next" + System.Environment.NewLine +
                    "TCase = strTextString" + System.Environment.NewLine +
                    "end function" + System.Environment.NewLine;
                string strScript3 = "function Ceil(number)" + System.Environment.NewLine +
                    "Ceil = Int(number)" + System.Environment.NewLine +
                    "if Ceil <> number then" + System.Environment.NewLine +
                    "Ceil = Ceil + 1" + System.Environment.NewLine +
                    "end if" + System.Environment.NewLine +
                    "end function" + System.Environment.NewLine;
                string strScript4 = "function Floor(number)" + System.Environment.NewLine +
                    "Floor = Int(number)" + System.Environment.NewLine +
                    "end function" + System.Environment.NewLine;

                script.AddCode(strScript);
                script.AddCode(strScript2);
                script.AddCode(strScript3);
                script.AddCode(strScript4);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);

            }
            AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_9b") + newValue);
        }