Пример #1
0
        /********************************************************************/
        /// <summary>
        /// Sets the pattern string to search for
        /// </summary>
        /********************************************************************/
        public void SetPattern(BMPattern pattern)
        {
            searchPattern = pattern;

            String patternText = pattern.Pattern;

            modifiedMainText = (originalMainText + new String(patternText[patternText.Length - 1], patternText.Length)).ToUpper();

            Reset();
        }
Пример #2
0
        static void Main()
        {
//			Application.Run(new Form1());

            BMPattern patt   = new BMPattern("GCAGAGAG");
            BMSearch  search = new BMSearch("GCATCGCAGAGAGTATACAGTACG", patt);

            int index;

            while ((index = search.FindNext()) != -1)
            {
                System.Diagnostics.Debug.WriteLine(index.ToString());
            }

            search.SetPattern("Ta");
            while ((index = search.FindNext()) != -1)
            {
                System.Diagnostics.Debug.WriteLine(index.ToString());
            }
        }
Пример #3
0
 /********************************************************************/
 /// <summary>
 /// Initializes the class
 /// </summary>
 /********************************************************************/
 private void Initialize(String text, BMPattern pattern)
 {
     originalMainText = text;
     SetPattern(pattern);
 }
Пример #4
0
 /********************************************************************/
 /// <summary>
 /// Constructor
 /// </summary>
 /********************************************************************/
 public BMSearch(String text, BMPattern pattern)
 {
     Initialize(text, pattern);
 }