Beispiel #1
0
        private void btnAuthorizationC_Click(object sender, RoutedEventArgs e)
        {
            txtAuthorizationC.Text = String.Empty;

            SLPrincipal.Logout();
            SLPrincipal.Login("PropertyARole", (o, e2) =>
            {
                bool pass = true;

                try
                {
                    try
                    {
                        ClassC1 classC1 = new ClassC1();
                        pass            = false;
                    }
                    catch (SecurityException ex)
                    { }

                    ClassC2 classC2 = new ClassC2();
                    classC2.A       = "test";
                    classC2.B       = "test";
                    if (classC2.A != "test" || classC2.B != "test")
                    {
                        pass = false;
                    }
                }
                catch (Exception ex)
                {
                    pass = false;
                }

                if (pass)
                {
                    txtAuthorizationC.Text = "Pass";
                }
                else
                {
                    txtAuthorizationC.Text = "Fail";
                }
            });
        }
Beispiel #2
0
    private void btnAuthorizationC_Click(object sender, RoutedEventArgs e)
    {
      txtAuthorizationC.Text = String.Empty;

      SLPrincipal.Logout();
      SLPrincipal.Login("PropertyARole", (o, e2) =>
      {
        bool pass = true;

        try
        {
          try
          {
            ClassC1 classC1 = new ClassC1();
            pass = false;
          }
          catch (SecurityException ex)
          { }

          ClassC2 classC2 = new ClassC2();
          classC2.A = "test";
          classC2.B = "test";
          if (classC2.A != "test" || classC2.B != "test")
            pass = false;
        }
        catch (Exception ex)
        {
          pass = false;
        }

        if (pass)
        {
          txtAuthorizationC.Text = "Pass";
        }
        else
        {
          txtAuthorizationC.Text = "Fail";
        }
      });
    }