BlogProvider.cs :  » Bloggers » BlogEngine.NET » BlogEngine.Core » Providers » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Bloggers » BlogEngine.NET 
BlogEngine.NET » BlogEngine.Core » Providers » BlogProvider.cs
#region Using

using System;
using System.IO;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Configuration.Provider;
using BlogEngine.Core;

#endregion

namespace BlogEngine.Core.Providers{
    /// <summary>
    /// A base class for all custom providers to inherit from.
    /// </summary>
    public abstract partial class BlogProvider : ProviderBase
    {
        // Post
        /// <summary>
        /// Retrieves a Post from the provider based on the specified id.
        /// </summary>
        public abstract Post SelectPost(Guid id);
        ///// <summary>
        ///// Retrieves the content of the post in order to lazy load.
        ///// </summary>
        //public abstract string SelectPostContent(Guid id);
        /// <summary>
        /// Inserts a new Post into the data store specified by the provider.
        /// </summary>
        public abstract void InsertPost(Post post);
        /// <summary>
        /// Updates an existing Post in the data store specified by the provider.
        /// </summary>
        public abstract void UpdatePost(Post post);
        /// <summary>
        /// Deletes a Post from the data store specified by the provider.
        /// </summary>
        public abstract void DeletePost(Post post);
        /// <summary>
        /// Retrieves all Posts from the provider and returns them in a List.
        /// </summary>
        public abstract List<Post> FillPosts();

        // Page
        /// <summary>
        /// Retrieves a Page from the provider based on the specified id.
        /// </summary>
        public abstract Page SelectPage(Guid id);
        /// <summary>
        /// Inserts a new Page into the data store specified by the provider.
        /// </summary>
        public abstract void InsertPage(Page page);
        /// <summary>
        /// Updates an existing Page in the data store specified by the provider.
        /// </summary>
        public abstract void UpdatePage(Page page);
        /// <summary>
        /// Deletes a Page from the data store specified by the provider.
        /// </summary>
        public abstract void DeletePage(Page page);
        /// <summary>
        /// Retrieves all Pages from the provider and returns them in a List.
        /// </summary>
        public abstract List<Page> FillPages();

        // Profile
        /// <summary>
        /// Retrieves a Page from the provider based on the specified id.
        /// </summary>
      public abstract AuthorProfile SelectProfile(string id);
        /// <summary>
        /// Inserts a new Page into the data store specified by the provider.
        /// </summary>
      public abstract void InsertProfile(AuthorProfile profile);
        /// <summary>
        /// Updates an existing Page in the data store specified by the provider.
        /// </summary>
      public abstract void UpdateProfile(AuthorProfile profile);
        /// <summary>
        /// Deletes a Page from the data store specified by the provider.
        /// </summary>
      public abstract void DeleteProfile(AuthorProfile profile);
        /// <summary>
        /// Retrieves all Pages from the provider and returns them in a List.
        /// </summary>
      public abstract List<AuthorProfile> FillProfiles();

        /// <summary>
        /// Retrieves a Category from the provider based on the specified id.
        /// </summary>
        public abstract Category SelectCategory(Guid id);
        /// <summary>
        /// Inserts a new Category into the data store specified by the provider.
        /// </summary>
        public abstract void InsertCategory(Category category);
        /// <summary>
        /// Updates an existing Category in the data store specified by the provider.
        /// </summary>
        public abstract void UpdateCategory(Category category);
        /// <summary>
        /// Deletes a Category from the data store specified by the provider.
        /// </summary>
        public abstract void DeleteCategory(Category category);
        /// <summary>
        /// Retrieves all Categories from the provider and returns them in a List.
        /// </summary>
        public abstract List<Category> FillCategories();

        // Settings
        /// <summary>
        /// Loads the settings from the provider.
        /// </summary>
        public abstract StringDictionary LoadSettings();
        /// <summary>
        /// Saves the settings to the provider.
        /// </summary>
        public abstract void SaveSettings(StringDictionary settings);

        //Ping services
        /// <summary>
        /// Loads the ping services.
        /// </summary>
        /// <returns></returns>
        public abstract StringCollection LoadPingServices();
        /// <summary>
        /// Saves the ping services.
        /// </summary>
        /// <param name="services">The services.</param>
        public abstract void SavePingServices(StringCollection services);

        //Stop words
        /// <summary>
        /// Loads the stop words used in the search feature.
        /// </summary>
        public abstract StringCollection LoadStopWords();
              
        // Data Store
        /// <summary>
        /// Loads settings from data store
        /// </summary>
        /// <param name="exType">Extension Type</param>
        /// <param name="exId">Extensio Id</param>
        /// <returns>Settings as stream</returns>
        public abstract object LoadFromDataStore(DataStore.ExtensionType exType, string exId);
        /// <summary>
        /// Saves settings to data store
        /// </summary>
        /// <param name="exType">Extension Type</param>
        /// <param name="exId">Extension Id</param>
        /// <param name="settings">Settings object</param>
        public abstract void SaveToDataStore(DataStore.ExtensionType exType, string exId, object settings);
        /// <summary>
        /// Removes settings from data store
        /// </summary>
        /// <param name="exType">Extension Type</param>
        /// <param name="exId">Extension Id</param>
        public abstract void RemoveFromDataStore(DataStore.ExtensionType exType, string exId);

        /// <summary>
        /// Retrieves a BlogRoll from the provider based on the specified id.
        /// </summary>
        public abstract BlogRollItem SelectBlogRollItem(Guid Id);
        /// <summary>
        /// Inserts a new BlogRoll into the data store specified by the provider.
        /// </summary>
        public abstract void InsertBlogRollItem(BlogRollItem blogRollItem);
        /// <summary>
        /// Updates an existing BlogRoll in the data store specified by the provider.
        /// </summary>
        public abstract void UpdateBlogRollItem(BlogRollItem blogRollItem);
        /// <summary>
        /// Deletes a BlogRoll from the data store specified by the provider.
        /// </summary>
        public abstract void DeleteBlogRollItem(BlogRollItem blogRollItem);
        /// <summary>
        /// Retrieves all BlogRolls from the provider and returns them in a list.
        /// </summary>
        public abstract List<BlogRollItem> FillBlogRoll();

        /// <summary>
        /// Retrieves a Referrer from the provider based on the specified id.
        /// </summary>
        public abstract Referrer SelectReferrer(Guid Id);
        /// <summary>
        /// Inserts a new Referrer into the data store specified by the provider.
        /// </summary>
        public abstract void InsertReferrer(Referrer referrer);
        /// <summary>
        /// Updates an existing Referrer in the data store specified by the provider.
        /// </summary>
        public abstract void UpdateReferrer(Referrer referrer);
        /// <summary>
        /// Deletes a Referrer from the data store specified by the provider.
        /// </summary>
        public abstract List<Referrer> FillReferrers();

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public abstract string StorageLocation();
    }

    /// <summary>
    /// A collection of all registered providers.
    /// </summary>
    public class BlogProviderCollection : ProviderCollection
    {
        /// <summary>
        /// Gets a provider by its name.
        /// </summary>
        public new BlogProvider this[string name]
        {
            get { return (BlogProvider)base[name]; }
        }

        /// <summary>
        /// Add a provider to the collection.
        /// </summary>
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
                throw new ArgumentNullException("provider");

            if (!(provider is BlogProvider))
                throw new ArgumentException
                    ("Invalid provider type", "provider");

            base.Add(provider);
        }
    }

}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.