示例#1
0
        private static void ProcessRecords(ExtractedValue recordsData)
        {
            /*Microsoft.VisualBasic.Interaction.MsgBox(String.Format("Database: {0}", recordsData.DBName));
             * foreach (int Mfn in recordsData.MfnList)
             *  Microsoft.VisualBasic.Interaction.MsgBox(String.Format("Mfn: {0}", Mfn));*/


            ShowScenarioFindReplaceDialog(recordsData);
        }
示例#2
0
        private static void ShowScenarioFindReplaceDialog(ExtractedValue recordsData)
        {
            FindReplaceScriptEditor find_replaceScriptEditor = new FindReplaceScriptEditor(recordsData);

            if (find_replaceScriptEditor.ShowDialog() == DialogResult.OK)
            {
                ScenarioFindReplaceResultsForm scenarioFindReplaceResultsForm = new ScenarioFindReplaceResultsForm(find_replaceScriptEditor);
                scenarioFindReplaceResultsForm.ShowDialog();
            }
            if (find_replaceScriptEditor.client != null)
            {
                find_replaceScriptEditor.client.Disconnect();
            }
        }
示例#3
0
        private static ExtractedValue ProcessTextStream(System.IO.StreamReader sr)
        {
            var values = new ExtractedValue();      //Create the extracted values placeholders

            string []  strMarkers = { "DBN:", "MFN:" };
            string     strValue;
            List <int> MfnList = new List <int>();

            //Read the text file
            using (sr)
            {
                while (sr.Peek() > -1)
                {
                    var currentLine = sr.ReadLine().Trim();

                    //Skip whitespaces
                    if (string.IsNullOrWhiteSpace(currentLine))
                    {
                        continue;
                    }

                    for (int index = 0; index < strMarkers.Length; index++)
                    {
                        string strMarker = strMarkers [index];
                        if (!currentLine.StartsWith(strMarker))
                        {
                            continue;
                        }

                        strValue = currentLine.Substring(strMarker.Length);
                        switch (index)
                        {
                        case 0:
                            values.DBName = strValue;
                            break;

                        case 1:
                            MfnList.Add(Convert.ToInt32(strValue));
                            break;
                        }
                    }
                }
            }
            MfnList.Sort();
            values.MfnList = MfnList.ToArray();
            return(values);      //Return the extracted values
        }
示例#4
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;
            }
        }