public static FileAccess Pars(StartFileAccess access) { switch (access) { case StartFileAccess.Read: return FileAccess.Read; case StartFileAccess.Write: return FileAccess.Write; case StartFileAccess.ReadWrite: return FileAccess.ReadWrite; default: throw new ArgumentException("doesn't exists"); } }
private void setFiledValues() { for (int i = 1; i < users.Count; i++) { UserSettings user = users[i]; if (user.AccessRights != FileAccessHelper.Pars(access)) { access = StartFileAccess.None; } if (user.MaxNrOfConnections != maxNrOfConnections) { maxNrOfConnections = -1; } if (user.StartingDirectory != startDir) { startDir = "N/A"; } name.Append(", " + user.Name); } }
public static string GetAccessName(StartFileAccess access) { return AccessNames[(int) access]; }
private void initiateFields() { access = FileAccessHelper.Pars(users[0].AccessRights); maxNrOfConnections = users[0].MaxNrOfConnections; startDir = users[0].StartingDirectory; name = new StringBuilder(users[0].Name); }