public GeneralUtilities() { string applicationDirectory = null; string xmlSettingsFile = null; PDX.BTS.DataMaintenance.MaintTools.XMLSetttingsFileManager xmlFileManager = null; try { // Set the Name of the XML Settings File for this Application. applicationDirectory = System.Reflection.Assembly.GetExecutingAssembly().Location.ToString(); while (applicationDirectory.EndsWith(@"\") == false) { // Drop the right-most character from the string. applicationDirectory = applicationDirectory.Substring(0, (applicationDirectory.Length - 1)); } xmlSettingsFile = applicationDirectory + @"DataMaintenanceUtilitiesSettings.xml"; // Initialize the XML File Manager. xmlFileManager = new PDX.BTS.DataMaintenance.MaintTools.XMLSetttingsFileManager(); xmlFileManager.XMLFile(xmlSettingsFile); if (!System.IO.File.Exists(xmlSettingsFile)) { // Let the user know that the Parameter Table could not be initialized. if (ErrorMessage != null) { ErrorMessage(" Could not find the XML Settings File! Initialization Failed!"); } // Exit this process. return; } // Get the connection parameters for the Monitor Database from the XML Settings File. _monitorDatabaseServerName = xmlFileManager.ReadUserSetting("DatabaseDefinitions", "MonitorDatabaseServer"); _monitorDatabaseName = xmlFileManager.ReadUserSetting("DatabaseDefinitions", "MonitorDatabase"); // Get the Name of the Load Monitor Table in the Monitor Database. _monitorTableName = xmlFileManager.ReadUserSetting("DatabaseDefinitions", "MonitorTableName"); // Set the Connection String that will be used to Connect to the Import Monitor Database. _importMonitorDatabaseConnectionString = "Data Source=" + _monitorDatabaseServerName + ";" + "Initial Catalog=" + _monitorDatabaseName + ";" + "Integrated Security=SSPI"; // Exit this process. return; } catch { // Exit this method. return; } }
/// <summary> /// Class Constructor. /// </summary> public FeatureClassUtilities() { PDX.BTS.DataMaintenance.MaintTools.XMLSetttingsFileManager xmlFileManager = null; PDX.BTS.DataMaintenance.MaintTools.EncryptionManager encryptionManager = null; try { // Set the Name of the XML Settings File for this Application. string applicationDirectory = System.Reflection.Assembly.GetExecutingAssembly().Location.ToString(); while (applicationDirectory.EndsWith(@"\") == false) { // Drop the right-most character from the string. applicationDirectory = applicationDirectory.Substring(0, (applicationDirectory.Length - 1)); } string xmlSettingsFile = applicationDirectory + @"DataMaintenanceUtilitiesSettings.xml"; // Initialize the XML File Manager. xmlFileManager = new PDX.BTS.DataMaintenance.MaintTools.XMLSetttingsFileManager(); xmlFileManager.XMLFile(xmlSettingsFile); if (!System.IO.File.Exists(xmlSettingsFile)) { // Let the user know that the Parameter Table could not be initialized. if (ErrorMessage != null) { ErrorMessage(" Could not find the XML Settings File! Initialization Failed!"); } // Exit this process. return; } // Get the connection parameters for the Monitor Database from the XML Settings File. _monitorDatabaseServerName = xmlFileManager.ReadUserSetting("DatabaseDefinitions", "MonitorDatabaseServer"); _monitorDatabaseName = xmlFileManager.ReadUserSetting("DatabaseDefinitions", "MonitorDatabase"); // Get the Name of the Load Monitor Table in the Monitor Database. _parameterTableName = xmlFileManager.ReadUserSetting("DatabaseDefinitions", "LoadParemetersTableName"); // Set the Connection String that will be used to Connect to the Parameter Database. _parameterDatabaseConnectionString = "Data Source=" + _monitorDatabaseServerName +";" + "Initial Catalog=" + _monitorDatabaseName + ";" + "Integrated Security=SSPI"; // Instantiate the Component that will hold the Managed Resources used by this method. _component = new System.ComponentModel.Component(); // Populate the Shapefile Extension Array. _shapefileExtensions = new System.Collections.ArrayList(); _shapefileExtensions.Add("aih"); _shapefileExtensions.Add("ain"); _shapefileExtensions.Add("cpg"); _shapefileExtensions.Add("dbf"); _shapefileExtensions.Add("gcd"); _shapefileExtensions.Add("ixs"); _shapefileExtensions.Add("mxs"); _shapefileExtensions.Add("prj"); _shapefileExtensions.Add("sbn"); _shapefileExtensions.Add("sbx"); _shapefileExtensions.Add("shp"); _shapefileExtensions.Add("shp.xml"); _shapefileExtensions.Add("shx"); _shapefileExtensions.Add("xml"); // Populate the Array of Shapefile Extensions that are necessary to have a valid Shapefile. _shapefileNecessaryExtensions = new System.Collections.ArrayList(); _shapefileNecessaryExtensions.Add("shp"); _shapefileNecessaryExtensions.Add("shx"); _shapefileNecessaryExtensions.Add("dbf"); } catch { // Exit this method. return; } finally { // If the CGIS Data Maintenance Encryption Manager Object was instantiated, close it. if (encryptionManager != null) { encryptionManager = null; } // If the CGIS Data Maintenance XML File Manager Object was instantiated, close it. if (xmlFileManager != null) { xmlFileManager = null; } } }
// Constructor Method. public LoadInformation() { string applicationDirectory = null; string xmlSettingsFile = null; PDX.BTS.DataMaintenance.MaintTools.XMLSetttingsFileManager xmlFileManager = null; // Set the Name of the XML Settings File for this Application. applicationDirectory = System.Reflection.Assembly.GetExecutingAssembly().Location.ToString(); while (applicationDirectory.EndsWith(@"\") == false) { // Drop the right-most character from the string. applicationDirectory = applicationDirectory.Substring(0, (applicationDirectory.Length - 1)); } xmlSettingsFile = applicationDirectory + @"DataMaintenanceUtilitiesSettings.xml"; // Initialize the XML File Manager. xmlFileManager = new PDX.BTS.DataMaintenance.MaintTools.XMLSetttingsFileManager(); xmlFileManager.XMLFile(xmlSettingsFile); if (!System.IO.File.Exists(xmlSettingsFile)) { // Let the user know that the Parameter Table could not be initialized. if (ErrorMessage != null) { ErrorMessage(" Could not find the XML Settings File! Initialization Failed!"); } // Exit this process. return; } // Get the connection parameters for the Monitor Database from the XML Settings File. _monitorDatabaseServerName = xmlFileManager.ReadUserSetting("DatabaseDefinitions", "MonitorDatabaseServer"); _monitorDatabaseName = xmlFileManager.ReadUserSetting("DatabaseDefinitions", "MonitorDatabase"); // Get the Name of the Load Monitor Table in the Monitor Database. _monitorTableName = xmlFileManager.ReadUserSetting("DatabaseDefinitions", "MonitorTableName"); // Set the Connection String that will be used to Connect to the Import Monitor Database. _importMonitorDatabaseConnectionString = "Data Source=" + _monitorDatabaseServerName + ";" + "Initial Catalog=" + _monitorDatabaseName + ";" + "Integrated Security=SSPI"; // Get the Name of the Load Monitor Table in the Monitor Database. _parameterTableName = xmlFileManager.ReadUserSetting("DatabaseDefinitions", "LoadParemetersTableName"); // Set the Connection String that will be used to Connect to the Parameter Database. _parameterDatabaseConnectionString = "Data Source=" + _monitorDatabaseServerName + ";" + "Initial Catalog=" + _monitorDatabaseName + ";" + "Integrated Security=SSPI"; // Exit this process. return; } // LoadInformation