private void closeMapServer()
        {
            if (m_pMapServer == null)
            {
                return;
            }

            try
            {
                IMapServerInit pMSInit  = m_pMapServer as IMapServerInit;
                string         filename = pMSInit.FilePath;
                pMSInit.Stop();
                Utils.DeleteMSDfile(filename);
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show("Error stopping MapServer" + Environment.NewLine + ex.Message);
            }
        }
示例#2
0
        /// <summary>
        /// construct() is called only once, when the SOE is created, after IServerObjectExtension.init() is called. This
        /// method hands back the configuration properties for the SOE as a property set. You should include any expensive
        /// initialization logic for your SOE within your implementation of construct().
        /// </summary>
        /// <param name="props">object propertySet</param>
        public void Construct(IPropertySet props)
        {
            AutoTimer timer = new AutoTimer();

            this.LogInfoSimple(this.soeName + ": il costruttore è stato avviato.", MethodBase.GetCurrentMethod().Name);

            try
            {
                this.configProps = props;
                if (this.configProps.GetProperty("workspaceId") is string)
                {
                    this.workspaceId = this.configProps.GetProperty("workspaceId") as string;
                }

                if (this.configProps.GetProperty("connectionString") is string)
                {
                    this.workspace = Helper.OpenFileGdbWorkspace(this.configProps.GetProperty("connectionString") as string);
                }

                IMapServer3    mapServer     = this.serverObjectHelper.ServerObject as IMapServer3;
                IMapServerInit mapServerInit = mapServer as IMapServerInit;

                string hostnameWebAdaptor = string.Empty;
                if (this.configProps.GetProperty("rootWebAdaptor") is string)
                {
                    hostnameWebAdaptor = this.configProps.GetProperty("rootWebAdaptor") as string;
                }

                this.pathOutputVirtualAGS = Helper.CombineUri(hostnameWebAdaptor, mapServerInit.VirtualOutputDirectory);

                // c'è il replace perchè se il nome del servizio è in una cartella ags il percorso restituito ha '/' nel path tra folder ags e nome servizio
                this.pathOutputAGS = mapServerInit.PhysicalOutputDirectory.Replace('/', '\\');
            }
            catch (Exception ex)
            {
                this.LogError(this.soeName + ": " + ex.Message, MethodBase.GetCurrentMethod().Name);
            }

            this.LogInfoSimple(this.soeName + ": il costruttore ha concluso", MethodBase.GetCurrentMethod().Name, timer.Elapsed);
        }