public void Update(UserForm formNew) { if (formNew == null) { return; } if (formNew.Password != null) { Password = formNew.Password; } if (formNew.KeyParametrsBlob != null) { KeyParametrsBlob = formNew.KeyParametrsBlob; } if (formNew.PortClientToClient1 != 0) { PortClientToClient1 = formNew.PortClientToClient1; } if (formNew.PortClientToClient2 != 0) { PortClientToClient2 = formNew.PortClientToClient2; } if (formNew.PortClientToClient3 != 0) { PortClientToClient3 = formNew.PortClientToClient3; } if (formNew.PortServerToClient != 0) { PortServerToClient = formNew.PortServerToClient; } if (formNew.Ip != null) { Ip = formNew.Ip.ToString(); } if (formNew.AuthenticationForm != null) { AuthenticationForm = AuthenticationFormSur.From(formNew.AuthenticationForm); } AuthenticationForm.UserForm = this; if (formNew.Accessibility != null) { Accessibility = formNew.Accessibility; } Accessibility.UserForm = this; }
public static IAuthenticationForm To(AuthenticationFormSur sur) { var surOfClassForm = sur as AuthenticationFormClassicSur; if (surOfClassForm != null) { return((AuthenticationFormClassic)surOfClassForm); } var surOfSignForm = sur as AuthenticationFormSignSur; if (surOfSignForm != null) { return((AuthenticationFormSign)surOfSignForm); } return(null); }