C# extensions

You may extend the application function with C#.  You can implement Kooboo interfaces and place the dlls in the executing folder of Kooboo. 

Datasource

Datasource is used in the view designer as source of data.  Once you implement the IDataSource interface or inherit from SiteDataSource, Your class methods will be discovered by Kooboo automatically. 

namespace Kooboo.Data.Interface
{
   public interface  IDataSource
    {
    }
}

namespace Kooboo.Sites.DataSources
{ 
    public abstract class SiteDataSource : IDataSource
    {
        public FrontContext Context { get; internal set; }
    }
}

kScript

Extend function for kScript, can be used like:  k.ex.{yourname}.{methodname}

namespace Kooboo.Data.Interface
{
    public interface IkScript
    { 
        string Name { get;  }
         
        RenderContext context { get; set; }
    }
}

Diagnosis

Diagnosis can be used to check errors of your website. 

namespace Kooboo.Sites.Diagnosis
{
    public interface IDiagnosis
    {
        DiagnosisSession session { get; set; }
         
        string Name(RenderContext context);

        string Group(RenderContext context); 

        void Check(); 
    }
}

DiagnosisSession contains methods that you can send back to users. 

  this.session.AddMessage("Missing link", message, MessageType.Critical); 

Form Submitter

Used to configure the submit action of HTML Form.  Form values contains in the RenderContext.  context.Request.Forms

namespace Kooboo.Data.Interface
{
  public interface IFormSubmitter
    {
        string Name { get;  }

        bool Submit(RenderContext context, Guid FormId,  Dictionary<string, string> settings);
         
        List<Models.SimpleSetting> Settings(RenderContext context);

        string CustomActionUrl(RenderContext context, Dictionary<string, string> settings); 
    }
}

View function

View function is used in the kView render function. for example: appendUrl is a function that append new querystring to current url. 

<td><a k-href="appendUrl('deleteFile', item.fullName)"> del </a></td>

Interface

namespace Kooboo.Sites.Render.Functions
{
    public interface IFunction
    {
        string Name { get; }

        List<IFunction> Parameters { get; set; }
         
        object Render(RenderContext context); 
    }
}

Background worker

Tasks that needs to be run in the background. 

namespace Kooboo.Data.Interface
{
    public interface IBackgroundWorker
    {  
        /// Interval in seconds.  
        int Interval { get;  }

        DateTime LastExecute { get; set; }

        void Execute();
    }
}