/// <summary>
        /// Fetches all password lists and returns a single password list asynchronously.
        /// </summary>
        /// <returns></returns>
        public async Task <PasswordList> BuildAsync()
        {
            var passwordList = new PasswordList();

            foreach (var source in this._passwordListSources)
            {
                passwordList.AddRange(await source.FetchAsync());
            }

            return(passwordList);
        }
Exemplo n.º 2
0
        public async Task <PasswordList> DeserializeAsync(TextReader textReader)
        {
            var passwordList = new PasswordList();

            string line;

            while ((line = await textReader.ReadLineAsync()) != null)
            {
                passwordList.Add(line.Trim());
            }

            return(passwordList);
        }
Exemplo n.º 3
0
        private static async Task <PasswordList> FetchByColumnNumberAsync(TextReader textReader, int columnNumber)
        {
            var passwordList = new PasswordList();

            string line;

            while ((line = await textReader.ReadLineAsync()) != null)
            {
                var items = line.Split(new[] { ',' });

                if (items.Length <= columnNumber)
                {
                    throw new ArgumentOutOfRangeException(nameof(columnNumber));
                }

                passwordList.Add(items[columnNumber].Trim('"', '\''));
            }

            return(passwordList);
        }