Esempio n. 1
0
        public void DoParse(SourceInfo sourceInfo, ParserInfo parseInfo, DataTable tbLog)
        {
            m_regexDivider  = parseInfo.RegexForDivider;
            m_regexContents = parseInfo.RegexForContents;

            Thread thread = new Thread(new ParameterizedThreadStart(WorkerMakeTable));

            thread.Start(new object[] { sourceInfo, tbLog, m_regexDivider, m_regexContents });
        }
Esempio n. 2
0
        public void DoParse_Old(string sFullFilename, ParserInfo info, DataTable tbLog)
        {
            m_regexDivider  = info.RegexForDivider;
            m_regexContents = info.RegexForContents;

            m_tbLog = tbLog;
            if (m_tbLog == null)
            {
                ClearSources();
                BuildupLogTable();
            }
            else
            {
                m_tbLog = tbLog.Copy();
            }

            SourceInfo sourceInfo = new SourceInfo(sFullFilename);

            AllSources.Add(sourceInfo);

            Thread thread = new Thread(new ParameterizedThreadStart(WorkerMakeTable));

            thread.Start(new object[] { sourceInfo, m_tbLog, m_regexDivider, m_regexContents });
        }
Esempio n. 3
0
        private void Load()
        {
            m_aryParserInfos.Clear();

            if (!File.Exists("ParseInfos.xml"))
            {
                return;
            }

            using (StreamReader reader = new StreamReader("ParseInfos.xml"))
            {
                XmlDocument doc = new XmlDocument();
                doc.Load(reader);

                XmlNodeList parseInfoNodes = doc.SelectNodes("//ParseInfos/ParseInfo");
                foreach (XmlNode node in parseInfoNodes)
                {
                    ParserInfo info = new ParserInfo();
                    if (info.Load(node))
                    {
                        m_aryParserInfos.Add(info);
                    }
                }

                XmlNodeList structInfoNodes = doc.SelectNodes("//Structure/Colomn");
                foreach (XmlNode node in structInfoNodes)
                {
                    StructInfo info = new StructInfo();
                    if (info.Load(node))
                    {
                        m_aryStructInfos.Add(info);
                    }
                }
                m_aryStructInfos.Sort((m, n) => m.DisplayOrder - n.DisplayOrder);

                StructInfo foundInfo;
                foundInfo = m_aryStructInfos.Find(m => "source".Equals(m.Name));
                if (foundInfo == null)
                {
                    StructInfo info = new StructInfo();
                    info.Caption   = "Source";
                    info.Name      = "source";
                    info.GridWidth = 50;
                    m_aryStructInfos.Insert(0, info);
                }

                foundInfo = m_aryStructInfos.Find(m => "line".Equals(m.Name));
                if (foundInfo == null)
                {
                    StructInfo info = new StructInfo();
                    info.Caption   = "Line";
                    info.Name      = "line";
                    info.GridWidth = 35;
                    m_aryStructInfos.Insert(1, info);
                }

                foundInfo = m_aryStructInfos.Find(m => "content".Equals(m.Name));
                if (foundInfo == null)
                {
                    StructInfo info = new StructInfo();
                    info.Caption       = "Content";
                    info.Name          = "content";
                    info.IsReadOnly    = false;
                    info.IsMultiEditor = true;
                    info.IsBestFit     = true;
                    m_aryStructInfos.Add(info);
                }

                for (int i = 0; i < m_aryStructInfos.Count; i++)
                {
                    m_aryStructInfos[i].DisplayOrder = i;
                }

                this.TableName = doc.SelectSingleNode("//Structure").Attributes["TableName"].Value;
            }
        }
Esempio n. 4
0
 public void Load(string sFullFilename, ParserInfo info)
 {
     m_currentSource = new SourceInfo(sFullFilename);
     m_parserEngine.DoParse(m_currentSource, info, DataSource);
 }