示例#1
0
        public void CreateUser()
        {
            string rep = AskQuestion(definitions.FormTitle.AddUser, definitions.Question.AddUser);

            if (rep != "")
            {
                bool          bFirst = false;
                File.textlist f      = ObtaintUserTextList();
                if (f.IsExist(rep))
                {
                    MessageBox.Show(definitions.Message.UserExist);
                    return;
                }
                if (!LoadCurrentUser())
                {
                    bFirst = true;
                }
                f.Items.Add(rep);
                f.Sort();
                f.WriteList();
                Object.User u = new User(rep);
                u.CreateUser();

                if (bFirst)
                {
                    SetCurrentUser(rep, true);
                }
                UpdateAllUserScript();
            }
        }
示例#2
0
        public void UpdateAllUserScript()
        {
            m_listUser = ObtaintUserTextList();

            for (int i = 0; i < m_listUser.Items.Count; i++)
            {
                UpdateAllScriptForOneUser(i);
            }
            LoadCurrentUser();
            mUser.TransferCurrentProfileInCurrentScript();
            MessageBox.Show("All scripts are uppdated :)");
        }
示例#3
0
 private void UpdateAllScriptForOneUser(int nCase)
 {
     if (m_listUser == null)
     {
         m_listUser = ObtaintUserTextList();
     }
     if (nCase >= 0 && nCase < m_listUser.Items.Count)
     {
         mUser = new User(m_listUser.Items[nCase]);
         mUser.LoadData(false);
         mUser.UpdateAllProfileScript();
     }
 }
示例#4
0
 private void NextCurrentUser()
 {
     File.textlist f = ObtaintUserTextList();
     if (f.Items.Count >= 2)
     {
         foreach (string s in f.Items)
         {
             if (s != mUser.NAME)
             {
                 SetCurrentUser(s, true);
                 break;
             }
         }
     }
     else
     {
         SetCurrentUser("", false);
     }
 }
示例#5
0
文件: listbox.cs 项目: dgx80/peon
 public void ReadFile(string filename)
 {
     mFile = new PeonLib.File.textlist(filename);
     RefreshListBox();
 }