Пример #1
0
        private string getContent(StringContentType contentType)
        {
            if (contentType == StringContentType.None)
            {
                return(null);
            }

            if (!_content.ContainsKey(contentType))
            {
                var    rn         = this.GetType().Assembly.GetManifestResourceNames().First(x => x.EndsWith("." + contentType.ToString() + ".txt"));
                string allContent = this.GetType().Assembly.GetManifestResourceStream(rn).GetString();
                //switch (contentType)
                //{
                //	case StringContentType.Country:
                //		allContent = Properties.Resources.Countries;
                //		break;
                //	case StringContentType.LastName:
                //		allContent = Properties.Resources.LastNames;
                //		break;
                //	case StringContentType.FirstName:
                //		allContent = Properties.Resources.FirstNames;
                //		break;
                //}
                _content.Add(contentType, allContent.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries));
            }
            return(_content[contentType][random.Next(0, _content[contentType].Length - 1)]);
        }
Пример #2
0
 public StringContent(SqlDbType dbType)
     : base(dbType)
 {
     ContentType = StringContentType.LastFirstName;
 }