Exemple #1
0
        private void About_Load(object sender, EventArgs e)
        {
            try
            {
                // to check the state of the extension, get the extension
                log.Debug("Retrieving a reference to the extension object to check state.");
                GoogleMapsEngineToolsExtensionForArcGIS ext = GoogleMapsEngineToolsExtensionForArcGIS.GetExtension();

                // fetch the about_dialog_html resource
                log.Debug("fetch the about_dialog_html resource");
                string buildinfotxt = Properties.Resources.about_dialog_html;

                // replace, if exists, the {addinname}
                log.Debug("replace, if exists, the {addinname}");
                buildinfotxt = buildinfotxt.Replace("{addinname}", ext.getAddinName());

                // replace, if exists, the {addindescription}
                log.Debug("replace, if exists, the {addindescription}");
                buildinfotxt = buildinfotxt.Replace("{addindescription}", ext.getAddinDescription());

                // replace, if exists, the {addindate}
                log.Debug("replace, if exists, the {addindate}");
                buildinfotxt = buildinfotxt.Replace("{addindate}", ext.getAddinDate());

                // replace, if exists, the {addinbuildversion}
                log.Debug("replace, if exists, the {addinbuildversion}");
                buildinfotxt = buildinfotxt.Replace("{addinbuildversion}", ext.getAddinVersion());

                // replace, if exists, the {assemblyversion}
                log.Debug("replace, if exists, the {assemblyversion}");
                buildinfotxt = buildinfotxt.Replace("{assemblyversion}", Assembly.GetExecutingAssembly().GetName().Version.ToString());

                // set the build information
                log.Debug("Setting the HTML to the web browser on the dialog.");
                this.wblegal.DocumentText = buildinfotxt;

                // add a script manager to the browser
                // in order to capture select events
                this.wblegal.ObjectForScripting = new BrowerScriptManager(this);
            }
            catch (System.Exception ex)
            {
                // an error occured, log and write standard text
                log.Error(ex);
                this.wblegal.DocumentText = "Google Maps Engine Add-in for ArcGIS Desktop.";
            }
        }