示例#1
0
 public void CodeSet()
 {
     this.lsbCode.Items.Clear();
     this.CodeList = new List<ListRec>();
     try
     {
         StreamReader reader = new StreamReader(this.pi.CodeList, Encoding.UTF8);
         try
         {
             while (!reader.EndOfStream)
             {
                 List<string> list = CommaText.CommaTextToItems(reader.ReadLine());
                 if (list.Count > 0)
                 {
                     ListRec item = new ListRec {
                         Name = list[0]
                     };
                     if (list.Count > 1)
                     {
                         item.URL = list[1];
                     }
                     else
                     {
                         item.URL = "";
                     }
                     this.CodeList.Add(item);
                 }
             }
         }
         finally
         {
             reader.Close();
         }
     }
     catch
     {
     }
     for (int i = 0; i < this.CodeList.Count; i++)
     {
         this.lsbCode.Items.Add(this.CodeList[i].Name);
     }
 }
示例#2
0
        internal void AddDelimString( string ToAdd )
        {
            // string DelimS = IntMath.ToString10( Y ) + "\t" +
            //                         ExpNumber.ToDelimString();

            string[] SplitS = ToAdd.Split( new Char[] { '\t' } );
            if( SplitS.Length < 2 )
              return;

            // MForm.ShowStatus( "Adding: " + ToAdd );
            Integer Y = new Integer();
            IntMath.SetFromString( Y, SplitS[0] );

            ExponentVectorNumber X = new ExponentVectorNumber( IntMath );
            X.SetFromDelimString( SplitS[1] );

            for( int Count = 0; ; Count++ )
              {
              VectorValueRec Rec = X.GetValueRecordAt( Count );
              if( Rec.Prime == 0 )
            break;

              // The one X number is being added as a reference in every
              // dictionary it belongs to.
              NumberRec NRec = new NumberRec();
              NRec.Y = Y;
              NRec.X = X;

              NumberList.Add( NRec );

              if( MainDictionary.ContainsKey( Rec.Prime ))
            {
            MainDictionary[Rec.Prime].OnePrimeList.Add( NRec );
            }
              else
            {
            ListRec LRec = new ListRec();
            LRec.OnePrimeList = new List<NumberRec>();
            LRec.OnePrimeList.Add( NRec );
            MainDictionary[Rec.Prime] = LRec;
            }
              }
        }