Example #1
0
        public bool Open()
        {
            db = new SxGeoDB(DatabasePath);
            db.DatabaseMode = DatabaseMode;
            if (!db.OpenDB())
            {
                ErrorMessage = db.ErrorMessage;
                return(false);
            }

            return(true);
        }
Example #2
0
        private void btnSxGeoInfo_Click(object sender, EventArgs e)
        {
            SxGeoDB tmpSxDB = new SxGeoDB(SxPath);

            if (!tmpSxDB.OpenDB())
            {
                lblMessage.ForeColor     = Color.Red;
                lblMessage.Text          = tmpSxDB.ErrorMessage;
                lblSxGeoStatus.Text      = "Ошибка.";
                lblSxGeoStatus.ForeColor = Color.Brown;
                return;
            }
            frmInfo fInfo = new frmInfo();

            fInfo.Header = tmpSxDB.GetHeader();
            fInfo.DBPath = SxPath;
            fInfo.ShowDialog();
            tmpSxDB.CloseDB();
        }
Example #3
0
        public bool IsValidSxGeoFile()
        {
            if (!File.Exists(DatabasePath))
            {
                ErrorMessage = "Файл данных SxGeo не найден.";
                return(false);
            }

            SxGeoDB tmpDB = new SxGeoDB(DatabasePath);

            tmpDB.DatabaseMode = SxGeoMode.FileMode;
            if (!tmpDB.OpenDB())
            {
                ErrorMessage = tmpDB.ErrorMessage;
                return(false);
            }

            tmpDB.CloseDB();
            return(true);
        }