Ejemplo n.º 1
0
        public void Get(string strFilter, ref CBook lpCBook)
        {
            for (int i = 0; i < lpCBook.Count(); i++)
            {
                if (HashTable.hasFilter(lpCBook[i].SName, strFilter) || HashTable.hasFilter(lpCBook[i].Name, strFilter))
                {
                    this.vecItems.Add(new HashTableItem(i, lpCBook[i].SName));
                }
            }

            UInt64 iMin;
            int    iMinPos;
            int    iCount = this.vecItems.Count();

            for (int i = 0; i < iCount - 1; i++)
            {
                iMin    = this.vecItems[i].iCashedString;
                iMinPos = i;
                for (int j = i + 1; j < iCount; j++)
                {
                    if (this.vecItems[j].iCashedString <= iMin)
                    {
                        iMin    = this.vecItems[j].iCashedString;
                        iMinPos = j;
                    }
                }
                HashTableItem temp = this.vecItems[i];
                this.vecItems[i]       = this.vecItems[iMinPos];
                this.vecItems[iMinPos] = temp;
            }
        }
Ejemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();
            this.form2  = new Form2(this);
            this.cbook  = new CBook();
            this.HTable = new HashTable();

            this.cbook.GetContactsFromFile("contacts.dat");

            this.textBox1.Text = "";

            this.ResetGUI(this.textBox1.Text);
        }
Ejemplo n.º 3
0
 public Contact GetContact(int iIndex, ref CBook lpCBook)
 {
     return(lpCBook[this.vecItems[iIndex].iIndex]);
 }