コード例 #1
0
 public async void GetUsers()
 {
     foreach (var users in await Data.User.GetAllAsync())
     {
         Usernames.Add(users.UserName.Trim());
         StudentNumbers.Add(users.StudentNumber.Trim());
         Emails.Add(users.EmailAdress.Trim());
     }
 }
コード例 #2
0
ファイル: FriendsList.cs プロジェクト: mailboxhead2188/PFire
        public override void Process(XFireClient context)
        {
            var friends = context.Server.Database.QueryFriends(_ownerUser);

            friends.ForEach(f =>
            {
                UserIds.Add(f.UserId);
                Usernames.Add(f.Username);
                Nicks.Add(f.Nickname);
            });
        }
コード例 #3
0
ファイル: FriendsList.cs プロジェクト: Alauraa/PFire
        public void Process(Context context)
        {
            var friends = context.Server.Database.QueryFriends(owner);

            friends.ForEach(f =>
            {
                UserIds.Add(f.UserId);
                Usernames.Add(f.Username);
                Nicks.Add(f.Nickname);
            });
        }
コード例 #4
0
 public void AddUsername(string username)
 {
     if (Usernames == null)
     {
         Usernames = new List <string>();
     }
     if (!Usernames.Contains(username))
     {
         Usernames.Add(username);
     }
 }
コード例 #5
0
        public WorldRecordHolder(int id, string username, TimeSpan totalTimeHeld, TimeSpan longestTimeHeldConsecutively, int worldRecordCount, DateTime lastHeld)
        {
            ID = id;
            Usernames.Add(username);
            TotalTimeHeld = totalTimeHeld;
            LongestTimeHeldConsecutively = longestTimeHeldConsecutively;
            WorldRecordCount             = worldRecordCount;
            LastHeld = lastHeld;

            MostRecentUsername = username;
        }
コード例 #6
0
 public DatabaseUser AddUsername(string username)
 {
     if (Usernames == null)
     {
         Usernames = new List <string>();
     }
     if (!Usernames.Contains(username))
     {
         Usernames.Add(username);
     }
     return(this);
 }
コード例 #7
0
        public void AddName(string name)
        {
            Check.NotNull(name);
            if (Username == name)
            {
                return;
            }
            Log.Info($"User updated username: {Username} => {name} ({Id})");
            Username = name;
            var newUsername = new Username {
                User = this,
                Date = DateTimeOffset.Now,
                Name = Username
            };

            Usernames.Add(newUsername);
        }
コード例 #8
0
ファイル: FriendInvite.cs プロジェクト: Alauraa/PFire
 public void AddFriendInvitation(string username, string nickname, string message)
 {
     Usernames.Add(username);
     Nicknames.Add(nickname);
     Messages.Add(message);
 }
コード例 #9
0
        public virtual void AddFields(IEnumerable <Field> fields)
        {
            if (fields == null)
            {
                return;
            }

            // Add the fields to their corresponding container.
            foreach (Field field in fields)
            {
                if (field.GetType() == typeof(Data.Fields.Name))
                {
                    Names.Add((Data.Fields.Name)field);
                }
                else if (field.GetType() == typeof(Address))
                {
                    Addresses.Add((Address)field);
                }
                else if (field.GetType() == typeof(Phone))
                {
                    Phones.Add((Phone)field);
                }
                else if (field.GetType() == typeof(Email))
                {
                    Emails.Add((Email)field);
                }
                else if (field.GetType() == typeof(Job))
                {
                    Jobs.Add((Job)field);
                }
                else if (field.GetType() == typeof(Education))
                {
                    Educations.Add((Education)field);
                }
                else if (field.GetType() == typeof(Image))
                {
                    Images.Add((Image)field);
                }
                else if (field.GetType() == typeof(Username))
                {
                    Usernames.Add((Username)field);
                }
                else if (field.GetType() == typeof(UserID))
                {
                    UserIDs.Add((UserID)field);
                }
                else if (field.GetType() == typeof(DOB))
                {
                    DOB = (DOB)field;
                }
                else if (field.GetType() == typeof(Gender))
                {
                    Gender = (Gender)field;
                }
                else if (field.GetType() == typeof(Language))
                {
                    Languages.Add((Language)field);
                }
                else if (field.GetType() == typeof(Ethnicity))
                {
                    Ethnicities.Add((Ethnicity)field);
                }
                else if (field.GetType() == typeof(OriginCountry))
                {
                    OriginCountries.Add((OriginCountry)field);
                }
                else if (field.GetType() == typeof(URL))
                {
                    Urls.Add((URL)field);
                }
            }
        }