public void buildInvitedPersons()
 {
     if (File.Exists("./invitedPersons.txt"))
     {
         StreamReader sr = new StreamReader("./invitedPersons.txt");
         while (sr.Peek() > 0)
         {
             string curLine = sr.ReadLine().Trim();
             if (!invitedPersons.ContainsKey(curLine))
             {
                 Persons curPerson = new Persons();
                 curPerson.name = curLine;
                 invitedPersons.Add(curLine, curPerson);
             }
         }
         sr.Close();
     }
 }
 public void recievedWhoList(object sender, LuaEventArgs args)
 {
     List<string> whoNumAmounts = Lua.GetReturnValues("return GetNumWhoResults()");
     int shownWhos = Int32.Parse(whoNumAmounts[0]);
     totalWhos = Int32.Parse(whoNumAmounts[1]);
     for (int i = 1; i <= totalWhos; i++)
     {
         List<string> whoInfo = Lua.GetReturnValues("return GetWhoInfo(" + i + ")");
         if (whoInfo[1].Length <= 0)
         {
             Persons curPerson = new Persons();
             curPerson.name = whoInfo[0];
             curPerson.level = Int32.Parse(whoInfo[2]);
             if (!allPersons.ContainsKey(whoInfo[0]))
             {
                 allPersons.Add(whoInfo[0], curPerson);
                 writePerson(curPerson);
             }
         }
     }
     Lua.DoString("ToggleFriendsFrame(2)");
     improveSearch();
 }
        public void buildAllPersons()
        {
            if (File.Exists("./allPersons.txt"))
            {
                StreamReader sr = new StreamReader("./allPersons.txt");
                while (sr.Peek() > 0)
                {
                    string curLine = sr.ReadLine().Trim();
                    try
                    {

                        Persons curPerson = new Persons();
                        curPerson.name = curLine;
                        if (!allPersons.ContainsKey(curLine))
                        {
                            allPersons.Add(curLine, curPerson);
                        }
                    }
                    catch (Exception e)
                    {
                        Logging.Write("ERROR: " + e);
                    }
                }
                sr.Close();
            }
        }
 public void writePerson(Persons curPerson)
 {
     StreamWriter sw = new StreamWriter("./allPersons.txt", true, Encoding.UTF8);
     sw.WriteLine(curPerson.name);
     sw.Close();
 }
        public void writeInvitedPerson(Persons curPerson)
        {
            invitedPersons.Add(curPerson.name, curPerson);
            StreamWriter sw = new StreamWriter("./invitedPersons.txt", true, Encoding.UTF8);
            sw.WriteLine(curPerson.name);
            sw.Close();

        }