/// <summary>
        /// The fill profiles.
        /// </summary>
        /// <returns>
        /// A list of AuthorProfile.
        /// </returns>
        public override List <AuthorProfile> FillProfiles()
        {
            var profiles = new List <AuthorProfile>();
            var blogs    = new List <Blog>();

            if (Blog.CurrentInstance.IsSiteAggregation)
            {
                blogs = Blog.Blogs;
            }
            else
            {
                blogs.Add(Blog.CurrentInstance);
            }

            foreach (Blog blog in blogs)
            {
                var folder = string.Format("{0}profiles{1}", GetFolder(blog), Path.DirectorySeparatorChar);

                if (!Directory.Exists(folder))
                {
                    continue;
                }

                profiles.AddRange(from file in Directory.GetFiles(folder, "*.xml", SearchOption.TopDirectoryOnly)
                                  select new FileInfo(file)
                                  into info
                                  select info.Name.Replace(".xml", string.Empty)
                                  into username
                                  select AuthorProfile.Load(username));
            }

            return(profiles);
        }
Пример #2
0
        /// <summary>
        /// The fill profiles.
        /// </summary>
        /// <returns>
        /// A list of AuthorProfile.
        /// </returns>
        public override List <AuthorProfile> FillProfiles()
        {
            var folder = string.Format("{0}profiles{1}", Category.Folder, Path.DirectorySeparatorChar);

            return((from file in Directory.GetFiles(folder, "*.xml", SearchOption.TopDirectoryOnly)
                    select new FileInfo(file)
                    into info
                    select info.Name.Replace(".xml", string.Empty)
                    into username
                    select AuthorProfile.Load(username)).ToList());
        }
Пример #3
0
        public override List <AuthorProfile> FillProfiles()
        {
            string folder = Category._Folder + "profiles" + Path.DirectorySeparatorChar;
            List <AuthorProfile> profiles = new List <AuthorProfile>();

            foreach (string file in Directory.GetFiles(folder, "*.xml", SearchOption.TopDirectoryOnly))
            {
                FileInfo      info     = new FileInfo(file);
                string        username = info.Name.Replace(".xml", string.Empty);
                AuthorProfile profile  = AuthorProfile.Load(username);
                profiles.Add(profile);
            }

            return(profiles);
        }