DataStore Class

Members  Example 

This is an abstract class that cannot be instaniated directly. Instead it should be inherited when creating data store providers, such as StandardDataStore that is included in the core.

Syntax

'Declaration
 
Public MustInherit Class DataStore 
public abstract class DataStore 

Example

The main two methods that should be overridden are Get(string objectName) and Store(string objectName, object instance) as well as the three different constructors.
namespace SampleProject {
    using System;
    using Core;
    using Serialization;

    public class MySampleDataStore : DataStore {
        public MySampleDataStore(CmsPage page)
            : base(page) {
        }

        public MySampleDataStore(Guid id)
            : base(id) {
        }

        public MySampleDataStore(string id)
            : base(id) {
        }

        public override T Get<T>(string objectName) {
            // Add code here to return the deserialized object requested
        }

        public override void Store(string objectName, object instance) {
            // Add code here to store away the object using the given objectName
        }
    }
}

Inheritance Hierarchy

System.Object
   KalikoCMS.Data.DataStore
      KalikoCMS.Data.StandardDataStore

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

This documentation was created using Document! X from Innovasys