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); }
public static void LoginUsingCSLA(EventHandler <DataPortalResult <SilverlightPrincipal> > completed) { CslaIdentity.GetCslaIdentity <SilverlightIdentity>( (o, e) => OnGetIdentityComplete(e, completed), new Criteria(VALID_TEST_UID, VALID_TEST_PWD)); }
private static void SetPrincipal(CslaIdentity identity) { RolodexPrincipal principal = new RolodexPrincipal(identity); Csla.ApplicationContext.User = principal; }