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(); } }
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 :)"); }
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(); } }
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); } }
public void ReadFile(string filename) { mFile = new PeonLib.File.textlist(filename); RefreshListBox(); }