Пример #1
0
        public void Save(IStream pstm, int fClearDirty)
        {
            StreamHelper helper = new StreamHelper(pstm);

            // Save the path to the zig file.
            //helper.writeString(config2.fileInfo.FullName);
        }
Пример #2
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);
        }
Пример #3
0
        public void Save(IStream pstm, int fClearDirty)
        {
            StreamHelper helper = new StreamHelper(pstm);

            // Save the Postgres schema name.
            helper.writeString(Name);

			// Paolo - Save connection properties (server, database, user, password, port)
			helper.writeString(m_wksName.ConnectionProperties.GetProperty("server").ToString());
			helper.writeString(m_wksName.ConnectionProperties.GetProperty("database").ToString());
			helper.writeString(m_wksName.ConnectionProperties.GetProperty("user").ToString());
			helper.writeString(m_wksName.ConnectionProperties.GetProperty("password").ToString());
			helper.writeString(m_wksName.ConnectionProperties.GetProperty("port").ToString());

            // Save the WorkspaceName.
            IWorkspaceName wksName = ((IDatasetName)this).WorkspaceName;
            ((IPersistStream)wksName).Save(pstm, fClearDirty);
        }
Пример #4
0
        public void Load(IStream pstm)
        {
            StreamHelper helper = new StreamHelper(pstm);

            // Restore the Postgres schema name.
            m_name = helper.readString();

            // Restore the WorkspaceName.
            m_wksName = new PostGisWorkspaceName();
            ((IPersistStream)m_wksName).Load(pstm);
        }
Пример #5
0
        void IPersistStream.Save(IStream pstm, int fClearDirty)
        {
            // First let ESRI do their thing.
            ((IPersistStream)featureLayer).Save(pstm, fClearDirty);

            // Write the FeatureClassId.
            StreamHelper helper = new StreamHelper(pstm);
            int id = ((IFeatureLayer)this).FeatureClass.FeatureClassID;
            helper.writeInt(id);
        }
Пример #6
0
        void IPersistStream.Load(IStream pstm)
        {
            // First let ESRI do their thing.
            ((IPersistStream)featureLayer).Load(pstm);

            // Load the FeatureClassId.
            StreamHelper helper = new StreamHelper(pstm);
            int id = helper.readInt();

            // Manually load the data.

            // I shouldn't have to do this because the FeatureLayerClass has
            // already called the Open() method on the DatasetName ... but
            // I can't figure out how to get at the opened PostGisFeatureDataset.
            PostGisDatasetName dsName = (PostGisDatasetName)((IDataset)this).FullName;
            PostGisFeatureDataset ds = (PostGisFeatureDataset)dsName.Open();
            ((IFeatureLayer)this).FeatureClass = new PostGisFeatureClass(ds, id);
        }