private Task ShowDefaultAsync(string title, string message, UserInfoType type)
 {
     return(ShowAsync(new UserInfoBuilder()
                      .WithTitle(title)
                      .WithMessage(message)
                      .WithDefaultButton(Localization.Ok)
                      .As(type)
                      .Build()));
 }
Exemplo n.º 2
0
 private static void ValidateUserInfoTypeAndUserInfo(UserInfoType userInfoType, string userInfo, TransactionContext transactionContext)
 {
     if (String.IsNullOrWhiteSpace(userInfo))
     {
         throw new FrejaEidClientInternalException(message: "UserInfo cannot be null or empty.");
     }
     if (transactionContext == TransactionContext.PERSONAL && userInfoType.Equals(UserInfoType.ORG_ID))
     {
         throw new FrejaEidClientInternalException(message: "UserInfoType ORG ID cannot be used in personal context.");
     }
 }
        public override int GetHashCode()
        {
            var hashCode = 1528838401;

            hashCode = hashCode * -1521134295 + UserInfoType.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(UserInfo);

            hashCode = hashCode * -1521134295 + MinRegistrationLevel.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <SortedSet <AttributeToReturn> > .Default.GetHashCode(AttributesToReturn);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(RelyingPartyId);

            return(hashCode);
        }
Exemplo n.º 4
0
 internal UserInfo(
     string title,
     string message,
     string placeholder,
     string cancelButtonText,
     string destroyButtonText,
     IList <string> defaultButtonTexts,
     TimeSpan snackbarDuration,
     UserInfoType type)
 {
     Title              = title;
     Message            = message;
     Placeholder        = Placeholder;
     CancelButtonText   = cancelButtonText;
     DestroyButtonText  = destroyButtonText;
     DefaultButtonTexts = defaultButtonTexts;
     SnackbarDuration   = snackbarDuration;
     AsType             = type;
 }
Exemplo n.º 5
0
        public static UserInfoType BuildUserInfoV1(UserInfoEntity userInfo, RequestHead head)
        {
            if (userInfo == null)
            {
                return(null);
            }
            var result = new UserInfoType
            {
                UId        = userInfo.UId,
                Platform   = userInfo.Platform,
                OpenId     = userInfo.OpenId,
                Gender     = userInfo.Gender,
                Latitude   = userInfo.Latitude,
                UserType   = userInfo.UserType,
                Longitude  = userInfo.Longitude,
                NickName   = userInfo.NickName,
                Portrait   = userInfo.Portrait,
                Signature  = userInfo.Signature,
                IsRegister = userInfo.IsRegister,
                TagList    = BuildAllTags(userInfo)
            };

            if (head.UId == userInfo.UId)
            {
                result.NickName = string.Format("{0}(我)", result.NickName);
            }
            if (userInfo.Gender == GenderEnum.Man)
            {
                result.GenderIcon  = CommonConst.Man_GenderIcon;
                result.GenderColor = CommonConst.Color_Man_GenderIcon;
            }
            if (userInfo.Gender == GenderEnum.Woman)
            {
                result.GenderIcon  = CommonConst.WoMan_GenderIcon;
                result.GenderColor = CommonConst.Color_WoMan_GenderIcon;
            }

            return(result);
        }
Exemplo n.º 6
0
        public static int GetIconId(this string str, UserInfoType type)
        {
            switch (type)
            {
            case UserInfoType.Fruit:
                var fruitType = str.ToFruitType();
                return(fruitType == FruitType.Apple
                        ? Resource.Mipmap.ic_fruit_apple
                        : fruitType == FruitType.Banana
                            ? Resource.Mipmap.ic_fruit_banana
                            : fruitType == FruitType.Strawberry
                                ? Resource.Mipmap.ic_fruit_strawberry
                                : 0);

            case UserInfoType.Gender:
                var gender = str.ToGenderType();
                return(gender == GenderType.Female
                        ? Resource.Mipmap.ic_gender_female
                        : gender == GenderType.Male
                            ? Resource.Mipmap.ic_gender_male
                            : 0);

            case UserInfoType.EyeColor:
                var eyeColor = str.ToEyeColorType();
                return(eyeColor == EyeColorType.Blue
                        ? Resource.Mipmap.ic_eye_blue
                        : eyeColor == EyeColorType.Brown
                            ? Resource.Mipmap.ic_eye_brown
                            : eyeColor == EyeColorType.Green
                                ? Resource.Mipmap.ic_eye_green
                                : 0);

            default:
                return(0);
            }
        }
Exemplo n.º 7
0
 public TitleWithInfoItemVM(string title, string info, UserInfoType type)
     : base(title)
 {
     Info = info;
     Type = type;
 }
 /// <summary>
 /// Method to check if an account is protected. Accepts either ID or Screen Name. (Default Screen Name).
 /// </summary>
 /// <param name="user">User Id or handle</param>
 /// <param name="uitype">Specify if it is an ID or handle. Screen Name By Default</param>
 /// <returns>True if protected. False if Not</returns>
 public static bool isProtectedAccount(string user,UserInfoType uitype=UserInfoType.ScreenName)
 {
     List<string> userL = new List<string>(1);
     userL.Add(user);
     return getUserInfo(userL,uitype)[0]["protected"];
 }
Exemplo n.º 9
0
 partial void InsertUserInfoType(UserInfoType instance);
Exemplo n.º 10
0
        public static UserInfoType BuildUserInfo(UserInfoEntity userInfo, RequestHead head, int count = 3)
        {
            if (userInfo == null)
            {
                return(null);
            }
            var result = new UserInfoType
            {
                UId        = userInfo.UId,
                Platform   = userInfo.Platform,
                OpenId     = userInfo.OpenId,
                Gender     = userInfo.Gender,
                Latitude   = userInfo.Latitude,
                UserType   = userInfo.UserType,
                Longitude  = userInfo.Longitude,
                NickName   = userInfo.NickName,
                Portrait   = userInfo.Portrait,
                Signature  = userInfo.Signature,
                IsRegister = userInfo.IsRegister,
                TagList    = new List <TagItem>()
            };

            if (head.UId == userInfo.UId)
            {
                result.NickName = string.Format("{0}(我)", result.NickName);
            }
            if (userInfo.Gender == GenderEnum.Man)
            {
                result.GenderIcon  = CommonConst.Man_GenderIcon;
                result.GenderColor = CommonConst.Color_Man_GenderIcon;
            }
            if (userInfo.Gender == GenderEnum.Woman)
            {
                result.GenderIcon  = CommonConst.WoMan_GenderIcon;
                result.GenderColor = CommonConst.Color_WoMan_GenderIcon;
            }
            var distance = LocationHelper.GetDistanceDesc(userInfo.Latitude, userInfo.Longitude, head.Latitude, head.Longitude);

            if (!string.IsNullOrEmpty(distance))
            {
                result.TagList.Add(new TagItem()
                {
                    Type    = TagTypeEnum.LocationInfo,
                    Content = distance,
                    Index   = 1
                });
            }
            if (!userInfo.SchoolName.IsNullOrEmpty())
            {
                AddTag(result.TagList, TagTypeEnum.Default, userInfo.SchoolName, 3);
            }

            if (userInfo.BirthDate.HasValue && userInfo.BirthDate.Value > Convert.ToDateTime("1990-01-01"))
            {
                AddTag(result.TagList, TagTypeEnum.AgeGrade, userInfo.BirthDate.GetAgeYear(), 2);
                AddTag(result.TagList, TagTypeEnum.Constellation, userInfo.BirthDate.GetConstellation(), 4);
            }

            AddTag(result.TagList, TagTypeEnum.Default, GetLocationInfo(userInfo), 5);

            if (result.TagList.Count > count)
            {
                result.TagList = result.TagList.OrderBy(a => a.Index).Take(count).ToList();
            }
            return(result);
        }
Exemplo n.º 11
0
 partial void UpdateUserInfoType(UserInfoType instance);
 internal SetOptionalParamsBuilder(UserInfoType userInfoType, string userInfo)
 {
     this.userInfoType = userInfoType;
     this.userInfo     = userInfo;
 }
Exemplo n.º 13
0
 partial void DeleteUserInfoType(UserInfoType instance);
 internal InitiateAuthenticationRequest(UserInfoType userInfoType, string userInfo, MinRegistrationLevel minRegistrationLevel, SortedSet <AttributeToReturn> attributesToReturn)
     : this(userInfoType, userInfo, minRegistrationLevel, attributesToReturn, null)
 {
 }
Exemplo n.º 15
0
 public object GetUserInfo(string userid, string password, UserInfoType type)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Exemplo n.º 16
0
 public TitleWithIconItemVM(string title, string info, UserInfoType type)
     : base(title, info, type)
 {
 }
Exemplo n.º 17
0
 public UserInfoBuilder As(UserInfoType type) =>
 this.With(ref _type, type);