Ejemplo n.º 1
0
        public void Load(IStream pstm)
        {
            StreamHelper helper = new StreamHelper(pstm);

			/* Paolo : we don't use zig file anymore
            // Load the zig file.
            string path = helper.readString();
            loadConfig(path);
			 */

			// Paolo - Restore Connection properties
			IPropertySet ps = new PropertySetClass();
			ps.SetProperty("server", helper.readString());
			ps.SetProperty("database", helper.readString());
			ps.SetProperty("user", helper.readString());
			ps.SetProperty("password", helper.readString());
			ps.SetProperty("port", helper.readString());

			m_cfg = new Config(ps);
        }
Ejemplo n.º 2
0
		/*
		 * old constructor from Abe
		/// <summary>
		/// PostGisWorkspaceName constructor from zigFile
		/// </summary>
		/// <param name="PostGisWorkspaceFactory"></param>
		/// <param name="zigFileName"></param>
        public PostGisWorkspaceName(PostGisWorkspaceFactory PostGisWorkspaceFactory, string zigFileName)
        {
            m_factory = PostGisWorkspaceFactory;
            loadConfig(zigFileName);
        }
		*/

        private void loadConfig(string filePath)
        {
            // Todo - error on file DNE.
            FileInfo fileInfo = new FileInfo(filePath);
            m_cfg = new Config(fileInfo);
        }
Ejemplo n.º 3
0
		/// <summary>
		/// Open a PostGIS workspace from a zig file
		/// </summary>
		/// <param name="FileName"></param>
		/// <param name="hWnd"></param>
		/// <returns></returns>
        public IWorkspace OpenFromFile(string FileName, int hWnd)
        {            
            IWorkspace retVal = null;
            try
            {
                // Grab the configuration and immediately setup logging.
                FileInfo fi = new FileInfo(FileName);
                //Abe
				//m_config = new Config(fi);
				m_config = new Config(fi);
                if (config.loggingConfigInfo != null)
                    log4net.Config.XmlConfigurator.Configure(config.loggingConfigInfo);

                // Log stuff.
                log.enterFunc("OpenFromFile");
                if (log.IsDebugEnabled)
                {
                    log.Debug("Logging now setup.");
                    log.Debug(FileName + "," + hWnd.ToString());
                }
                
                PostGisWorkspaceName wksName = new PostGisWorkspaceName(this, config);
                retVal = new PostGisFeatureWorkspace(wksName);
            }
            finally
            {
                log.leaveFunc();
            }
            return retVal;
        }
Ejemplo n.º 4
0
		/// <summary>
		/// PostGisWorkspaceName constructor from Config (both for zig file and PropertySet)
		/// (Paolo Corti, january 2007)
		/// </summary>
		/// <param name="PostGisWorkspaceFactory"></param>
		/// <param name="connectionProperties"></param>
		public PostGisWorkspaceName(PostGisWorkspaceFactory PostGisWorkspaceFactory, Config conf)
		{
			m_factory = PostGisWorkspaceFactory;
			//loadConfig(zigFileName);
			m_cfg = conf;
		}
Ejemplo n.º 5
0
		/// <summary>
		/// Open a PostGIS workspace from ConnectionProperties
		/// (Paolo Corti, january 2007)
		/// </summary>
		/// <param name="ConnectionProperties"></param>
		/// <param name="hWnd"></param>
		/// <returns></returns>
        public IWorkspace Open(IPropertySet ConnectionProperties, int hWnd)
        {
			IWorkspace retVal = null;
			try
			{
				m_config = new Config(ConnectionProperties);
				// immediately setup logging.
				if (config.loggingConfigInfo != null)
					log4net.Config.XmlConfigurator.Configure(config.loggingConfigInfo);

				// Log stuff.
				log.enterFunc("OpenFromConnectionProperties");
				if (log.IsDebugEnabled)
				{
					log.Debug("Logging now setup.");
					log.Debug(hWnd.ToString());
				}

				PostGisWorkspaceName wksName = new PostGisWorkspaceName(this, config);
				retVal = new PostGisFeatureWorkspace(wksName);
			
			}
			finally
			{
				log.leaveFunc();
			}
			return retVal;
        }