private void btnAuthorizationD_Click(object sender, RoutedEventArgs e) { txtAuthorizationD.Text = String.Empty; SLPrincipal.Logout(); SLPrincipal.Login("", (o, e2) => { bool pass = true; try { try { ClassD1 classD1 = new ClassD1(); pass = false; } catch (SecurityException ex) { } ClassD2 classD2 = new ClassD2(); try { classD2.A = "test"; pass = false; } catch (SecurityException ex) { } classD2.B = "test"; if (classD2.B != "test") { pass = false; } } catch (Exception ex) { pass = false; } if (pass) { txtAuthorizationD.Text = "Pass"; } else { txtAuthorizationD.Text = "Fail"; } }); }
private void btnAuthorizationD_Click(object sender, RoutedEventArgs e) { txtAuthorizationD.Text = String.Empty; SLPrincipal.Logout(); SLPrincipal.Login("", (o, e2) => { bool pass = true; try { try { ClassD1 classD1 = new ClassD1(); pass = false; } catch (SecurityException ex) { } ClassD2 classD2 = new ClassD2(); try { classD2.A = "test"; pass = false; } catch (SecurityException ex) { } classD2.B = "test"; if (classD2.B != "test") pass = false; } catch (Exception ex) { pass = false; } if (pass) { txtAuthorizationD.Text = "Pass"; } else { txtAuthorizationD.Text = "Fail"; } }); }