示例#1
0
        public FormMain()
        {
            // Set the version of the build for everything
            const string versionNumberForTeamApplication = "v1.5.5.2";

            // Placeholder for the error handling
            var errorMessage = new StringBuilder();

            errorMessage.AppendLine("Error were detected:");
            errorMessage.AppendLine();
            var errorDetails = new StringBuilder();

            errorDetails.AppendLine();
            var errorCounter = 0;

            InitializeComponent();
            Text = "TEAM - Taxonomy for ETL Automation Metadata " + versionNumberForTeamApplication;

            // Make sure the application and custom location directories exist
            ClassEnvironmentConfiguration.InitialiseRootPath();

            // Set the root path, to be able to locate the customisable configuration file
            ClassEnvironmentConfiguration.LoadRootPathFile();

            // Make sure the configuration file is in memory
            ClassEnvironmentConfiguration.InitialiseConfigurationPath();

            // Load the available configuration file
            ClassEnvironmentConfiguration.LoadConfigurationFile(GlobalParameters.ConfigurationPath + GlobalParameters.ConfigfileName + '_' + GlobalParameters.WorkingEnvironment + GlobalParameters.FileExtension);

            //Startup information
            richTextBoxInformation.Text = "Application initialised - the Taxonomy of ETL Automation Metadata (TEAM). \r\n";
            richTextBoxInformation.AppendText("Version " + versionNumberForTeamApplication + "\r\n\r\n");
            //richTextBoxInformation.AppendText("Source code on Github: https://github.com/RoelantVos/TEAM \r\n\r\n");

            labelWorkingEnvironment.Text = "The working environment is: " + GlobalParameters.WorkingEnvironment;

            TestConnections();

            if (errorCounter > 0)
            {
                richTextBoxInformation.AppendText(errorMessage.ToString());
            }
        }
        public FormManageConfiguration(FormMain parent) : base(parent)
        {
            this.parentFormMain = parent;
            InitializeComponent();

            //Make sure the root directories exist, based on hard-coded (tool) parameters
            //Also create the initial file with the configuration if it doesn't exist already
            ClassEnvironmentConfiguration.InitialiseRootPath();

            // Set the core TEAM (path) file using the information retrieved from memory. These values were loaded into memory from the path file in the main form.
            //Dev or prod environment (working environment)
            RadioButton radioButtonWorkingEnvironment;

            if (GlobalParameters.WorkingEnvironment == "Development")
            {
                radioButtonWorkingEnvironment         = radioButtonDevelopment;
                radioButtonWorkingEnvironment.Checked = true;
            }
            else if (GlobalParameters.WorkingEnvironment == "Production")
            {
                radioButtonWorkingEnvironment         = radioButtonProduction;
                radioButtonWorkingEnvironment.Checked = true;
            }

            //Paths
            textBoxOutputPath.Text        = GlobalParameters.OutputPath;
            textBoxConfigurationPath.Text = GlobalParameters.ConfigurationPath;

            // Load the configuration file using the paths retrieved from the application root contents (configuration path)
            try
            {
                LocalInitialiseConnections(GlobalParameters.ConfigurationPath + GlobalParameters.ConfigfileName + '_' + GlobalParameters.WorkingEnvironment + GlobalParameters.FileExtension);
            }
            catch (Exception ex)
            {
                richTextBoxInformation.AppendText("Errors occured trying to load the configuration file, the message is " + ex + ". No default values were loaded. \r\n\r\n");
            }

            _formLoading = false;
        }