/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Unauthenticated != null) { hashCode = hashCode * 59 + Unauthenticated.GetHashCode(); } if (HighPriority != null) { hashCode = hashCode * 59 + HighPriority.GetHashCode(); } if (MediumPriority != null) { hashCode = hashCode * 59 + MediumPriority.GetHashCode(); } if (Unattended != null) { hashCode = hashCode * 59 + Unattended.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if AverageMetrics instances are equal /// </summary> /// <param name="other">Instance of AverageMetrics to be compared</param> /// <returns>Boolean</returns> public bool Equals(AverageMetrics other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Unauthenticated == other.Unauthenticated || Unauthenticated != null && Unauthenticated.Equals(other.Unauthenticated) ) && ( HighPriority == other.HighPriority || HighPriority != null && HighPriority.Equals(other.HighPriority) ) && ( MediumPriority == other.MediumPriority || MediumPriority != null && MediumPriority.Equals(other.MediumPriority) ) && ( Unattended == other.Unattended || Unattended != null && Unattended.Equals(other.Unattended) )); }
public void Login(object param) { LoginVM viewModel = param as LoginVM; try { LoginActions.Login(viewModel.Users, viewModel.Username, viewModel.Password); switch (Utils.AuthUser.Type) { case "admin": Administrator adminWindow = new Administrator(); adminWindow.ShowDialog(); break; case "client": Client clientWindow = new Client(); clientWindow.ShowDialog(); break; case "employee": Employee employeeWindow = new Employee(); employeeWindow.ShowDialog(); break; case "none": Unauthenticated newUser = new Unauthenticated(); newUser.ShowDialog(); break; default: MessageBox.Show("Type not allowed."); break; } } catch (LoginException ex) { MessageBox.Show("Eroare la login: "******"Eroare", MessageBoxButton.OKCancel); } }
public static void NotLoggedView() { Unauthenticated view = new Unauthenticated(); view.Show(); }