Ejemplo n.º 1
0
        /// <summary>
        /// Construtor padrão.
        /// </summary>
        /// <param name="profile"></param>
        /// <param name="profileProvider"></param>
        public ProfileWrapper(ProfileProviderServiceReference.Profile profile, RemoteProfileProvider profileProvider)
        {
            _profileProvider = profileProvider;
            _instance        = profile;
            _roleSet         = profile.RoleSet ?? new ProfileRoleSet();

            if (_instance != null)
            {
                _instance.RoleSet = _roleSet;
            }

            //profile.RoleSet = null;

            if (profile.Source != null)
            {
                _source = new AuthenticationSourceWrapper(profile.Source);
            }

            if (profile.Properties != null)
            {
                foreach (var property in profile.Properties)
                {
                    if (property != null)
                    {
                        _properties.Add(property.Name, property.Value);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 internal AuthenticationSource(IAuthenticationSource source)
 {
     if (source == null)
     {
         throw new ArgumentNullException("source");
     }
     if (source.Uid > 0)
     {
         this.Uid = source.Uid;
     }
     this.FullName = source.FullName;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Construtor usado na serialização dos dados.
 /// </summary>
 /// <param name="info"></param>
 /// <param name="context"></param>
 protected ProfileInfo(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
 {
     _profileId        = info.GetInt32("ProfileId");
     _isAnonymous      = info.GetBoolean("IsAnonymous");
     _lastActivityDate = (DateTimeOffset)info.GetValue("LastActivityDate", typeof(DateTimeOffset));
     _lastUpdatedDate  = (DateTimeOffset)info.GetValue("LastUpdatedDate", typeof(DateTimeOffset));
     _userName         = info.GetString("UserName");
     _fullName         = info.GetString("FullName");
     _searchMode       = (ProfileSearchMode)info.GetInt32("SearchMode");
     _source           = (IAuthenticationSource)info.GetValue("Source", typeof(AuthenticationSource));
     _markGroupId      = (int?)info.GetValue("MarkGroupId", typeof(int?));
     _sellerTreeId     = (int?)info.GetValue("SellerTreeId", typeof(int?));
     _intermediateId   = (int?)info.GetValue("IntermediateId", typeof(int?));
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Cria uma instancia com base nos dados do perfil.
 /// </summary>
 /// <param name="profile"></param>
 public ProfileInfo(IProfile profile)
 {
     profile.Require("profile").NotNull();
     _profileId        = profile.ProfileId;
     _fullName         = profile.FullName;
     _userName         = profile.UserName;
     _source           = profile.Source;
     _lastActivityDate = profile.LastActivityDate;
     _lastUpdatedDate  = profile.LastUpdatedDate;
     _isAnonymous      = profile.IsAnonymous;
     _markGroupId      = profile.MarkGroupId;
     _searchMode       = profile.SearchMode;
     _sellerTreeId     = profile.SellerTreeId;
     _intermediateId   = profile.IntermediateId;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Logins the specified on login completed callback.
        /// </summary>
        /// <param name="onLoginCompletedCallback">The on login completed callback.</param>
        public void Login(Action <AuthenticatedUserResponseEventArgs> onLoginCompletedCallback)
        {
            if (!_isLoggingIn || !VerifySession())
            {
                _isLoggingIn            = true;
                _loginCompletedCallback = onLoginCompletedCallback;
                if (_authenticationSource != null)
                {
                    _authenticationSource.OnAuthenticationCompleted -= OnAuthenticationCompelted;
                }

                _authenticationSource = AuthenticationFactory.GetAuthenticationSource(AuthenticationType.Facebook);
                _authenticationSource.OnAuthenticationCompleted += OnAuthenticationCompelted;
                _authenticationSource.Login();
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Construtor padrão.
 /// </summary>
 /// <param name="profileId"></param>
 /// <param name="username"></param>
 /// <param name="fullName"></param>
 /// <param name="searchMode">Modo de pesquisa associado.</param>
 /// <param name="source">Source.</param>
 /// <param name="isAnonymous"></param>
 /// <param name="lastActivityDate"></param>
 /// <param name="lastUpdatedDate"></param>
 /// <param name="markGroupId"></param>
 /// <param name="sellerTreeId"></param>
 /// <param name="intermediateId"></param>
 public ProfileInfo(int profileId, string username, string fullName, bool isAnonymous, ProfileSearchMode searchMode, IAuthenticationSource source, DateTimeOffset lastActivityDate, DateTimeOffset lastUpdatedDate, int?markGroupId, int?sellerTreeId, int?intermediateId)
 {
     _profileId = profileId;
     _fullName  = fullName;
     if (username != null)
     {
         username = username.Trim();
     }
     _userName         = username;
     _source           = source;
     _lastActivityDate = lastActivityDate;
     _lastUpdatedDate  = lastUpdatedDate;
     _isAnonymous      = isAnonymous;
     _markGroupId      = markGroupId;
     _sellerTreeId     = sellerTreeId;
     _intermediateId   = intermediateId;
     _searchMode       = searchMode;
 }