// // General Settings // public void SetCurrentUsername() { //general settings current_username.Text = string.Format("Current: {0} ({1})", RegistryAccess.DefaultUsername, LocalDatabase.GetUserid(RegistryAccess.DefaultUsername)); }
/// <summary> /// Get path where user's submissions are stored. /// If user id doesn't found an empty string is returned. /// </summary> /// <param name="username">User-name of the user</param> /// <returns>Valid file with .json extension</returns> public static string GetUserSubPath(string username) { if (!LocalDatabase.ContainsUser(username)) { return(""); } string uid = LocalDatabase.GetUserid(username); string name = uid.ToString() + ".json"; string file = Path.Combine("Users", name); file = Path.Combine(DefaultPath, file); CreateFile(file); return(file); }
public void SetFormProperties() { string user = RegistryAccess.DefaultUsername; if (LocalDatabase.ContainsUser(user)) { this.Text = string.Format(this.Tag.ToString(), user, LocalDatabase.GetUserid(user)); } else { string msg = "Looks like you didn't set a default user-name." + Environment.NewLine; msg += "It is extremely important to set a default user-name to enable many features." + Environment.NewLine; msg += "Press OK to set it now. Or, you can set it later from the menu bar options."; if (MessageBox.Show(msg, Application.ProductName, MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK) { Interactivity.ShowUserNameForm(); } } }