Ejemplo n.º 1
0
        public FindReplaceScriptEditor(ExtractedValue recordsData)
        {
            this.recordsData = recordsData;
            config           = null;
            string exeConfigPath = this.GetType().Assembly.Location;

            try
            {
                config = ConfigurationManager.OpenExeConfiguration(exeConfigPath);

                if (config != null)
                {
                    activeTabIndex = Convert.ToByte(GetAppSetting(config, "activeTabIndex"));
                    string connectionString = GetAppSetting(config, "connection-string");
                    client = new ManagedClient64();
                    client.ParseConnectionString(connectionString);
                    try
                    {
                        client.Connect();

                        if (!String.IsNullOrEmpty(recordsData.DBName))
                        {
                            client.Database = recordsData.DBName;
                        }

                        curDatabase = client.IrbisDatabases.dataBases[client.IrbisDatabases.SelectedIndex];
                    }
                    catch
                    {
                        client.Shutdown();
                    }

                    InitializeComponent();
                    cmbTemplateType.SelectedIndex = 1;
                }
            }
            catch (Exception ex)
            {
                //handle errror here.. means DLL has no sattelite configuration file.
                MessageBox.Show(ex.Message);
                return;
            }
        }