예제 #1
0
        private static void OnGetIdentityComplete <T>(DataPortalResult <T> e, EventHandler <DataPortalResult <SilverlightPrincipal> > completed) where T : IIdentity
        {
            if (e.Error == null)
            {
                SetPrincipal(e.Object);
            }
            else
            {
                SetPrincipal(CslaIdentity.UnauthenticatedIdentity());
            }

            if (completed != null)
            {
                completed(Csla.ApplicationContext.User, null);
            }
        }
        public static void LoginUsingCSLA(string name, string password)
        {
            var identity = CslaIdentity.GetCslaIdentity <SilverlightIdentity>(new Criteria(name, password));

            SetPrincipal(identity);
        }
예제 #3
0
 public static void LoginUsingCSLA(EventHandler <DataPortalResult <SilverlightPrincipal> > completed)
 {
     CslaIdentity.GetCslaIdentity <SilverlightIdentity>(
         (o, e) =>
         OnGetIdentityComplete(e, completed), new Criteria(VALID_TEST_UID, VALID_TEST_PWD));
 }
예제 #4
0
        private static void SetPrincipal(CslaIdentity identity)
        {
            RolodexPrincipal principal = new RolodexPrincipal(identity);

            Csla.ApplicationContext.User = principal;
        }