示例#1
0
        private void btnCheckPath_Click(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            bool   hasInsertedPath = true;
            string selectedPath    = String.Empty;
            string insertedPath    = txtImportFolder.Text;

            if (insertedPath == null || insertedPath == "")
            {
                Tools.UserInfoHandler.ShowError("Please insert or select a folder.");
                this.Cursor = Cursors.Default;
                return;
            }

            if (CountryAdministrator.ConsiderOldAddOnFileStructure(_fromAddOn))
            {
                _importCountry = ImportExportAdministrator.GetImportAddOn_OldStyle(out selectedPath, hasInsertedPath, insertedPath);
            }
            else
            {
                _importCountry = ImportExportAdministrator.GetImportCountry(out selectedPath, _fromAddOn, hasInsertedPath, insertedPath);
            }
            if (_importCountry == null)
            {
                this.Cursor = Cursors.Default;
                return;
            }


            displayCountrySystems();
            this.Cursor = Cursors.Default;
        }
示例#2
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (txtImportFolder.Text == string.Empty)
            {
                UserInfoHandler.ShowError("Please select a version to compare with."); return;
            }

            Cursor = Cursors.WaitCursor;
            bool   hasInsertedPath = true;
            string insertedPath    = txtImportFolder.Text;
            string selectedPath    = String.Empty;

            if (CountryAdministrator.ConsiderOldAddOnFileStructure(_fromAddOn))
            {
                _importCountry = ImportExportAdministrator.GetImportAddOn_OldStyle(out selectedPath, hasInsertedPath, insertedPath);
            }
            else
            {
                _importCountry = ImportExportAdministrator.GetImportCountry(out selectedPath, _fromAddOn, hasInsertedPath, insertedPath);
            }
            if (_importCountry == null)
            {
                Cursor = Cursors.Default;
                return;
            }

            DialogResult = DialogResult.OK;
            Close();
        }
示例#3
0
        private void btnSelectImportFolder_Click(object sender, EventArgs e)
        {
            string path = String.Empty;

            if (CountryAdministrator.ConsiderOldAddOnFileStructure(_fromAddOn))
            {
                ImportExportAdministrator.GetImportAddOnPath_OldStyle(out string addOnPath, out string addOnShortName, out string fileName);
                path = fileName;
            }
            else
            {
                ImportExportAdministrator.GetImportCountryPath(_fromAddOn, out string importPath, out string countryShortName);
                path = importPath;
            }

            txtImportFolder.Text = path;
        }
示例#4
0
        void btnSelectImportFolder_Click(object sender, EventArgs e)
        {
            string path = string.Empty;

            if (CountryAdministrator.ConsiderOldAddOnFileStructure(_fromAddOn))
            {
                _importCountry = ImportExportAdministrator.GetImportAddOn_OldStyle(out path);
            }
            else
            {
                _importCountry = ImportExportAdministrator.GetImportCountry(out path, _fromAddOn);
            }
            if (_importCountry == null)
            {
                return;
            }

            txtImportFolder.Text = path;
            displayCountrySystems();
        }
示例#5
0
        void btnSelectVersion_Click(object sender, EventArgs e)
        {
            string shortName_varFileName, path, textToDisplay;

            if (_getVariablesChoices)
            {
                if (!GetImportVariablesPath(out path, out shortName_varFileName))
                {
                    return;
                }
                textToDisplay = EMPath.AddSlash(path) + shortName_varFileName;
            }
            else
            {
                bool oldStyle = CountryAdministrator.ConsiderOldAddOnFileStructure(_isAddOn);
                if (!(oldStyle ? ImportExportAdministrator.GetImportAddOnPath_OldStyle(out path, out shortName_varFileName, out string fileNameNew)
                           : ImportExportAdministrator.GetImportCountryPath(_isAddOn, out path, out shortName_varFileName)))
                {
                    return;
                }
                textToDisplay = !oldStyle ? path : EMPath.AddSlash(path) + Country.GetCountryXMLFileName(shortName_varFileName);
            }

            if (sender == btnSelectRemoteVersion)
            {
                txtRemoteVersion.Text = textToDisplay;
                _pathRemoteVersion    = path;
                _nameRemoteVersion    = shortName_varFileName;
            }
            else
            {
                txtParentVersion.Text = textToDisplay;
                _pathParentVersion    = path;
                _nameParentVersion    = shortName_varFileName;
            }
        }