C# Class Umbraco.Belle.System.ManifestParser

Parses the Main.js file and replaces all tokens accordingly.
Mostra file Open project: umbraco/Belle Class Usage Examples

Public Methods

Method Description
GetJavascriptInitialization ( ) : string

Processes all found manifest files and outputs the main.js file containing all plugin manifests

GetManifests ( ) : IEnumerable

Get all registered manifests

ManifestParser ( DirectoryInfo pluginsDir ) : System

Private Methods

Method Description
CreateManifests ( ) : IEnumerable

Creates a list of PropertyEditorManifest from the file contents of each manifest file

This ensures that comments are removed (but they have to be /* */ style comments and ensures that virtual paths are replaced with real ones

FolderDepth ( DirectoryInfo baseDir, DirectoryInfo currDir ) : int

Get the folder depth compared to the base folder

GetAllManfifestFileContents ( DirectoryInfo currDir ) : IEnumerable

Get the file contents from all declared manifest files

GetDefaultConfig ( ) : Newtonsoft.Json.Linq.JObject

Returns the default config as a JObject

GetDefaultInitialization ( ) : Newtonsoft.Json.Linq.JArray

Returns the default config as a JArray

GetPropertyEditors ( Newtonsoft.Json.Linq.JArray jsonEditors ) : IEnumerable

Parse the property editors from the json array

MergeJArrays ( Newtonsoft.Json.Linq.JArray receiver, Newtonsoft.Json.Linq.JArray donor ) : void

Merges the donor array values into the receiver array

MergeJObjects ( Newtonsoft.Json.Linq.JObject receiver, Newtonsoft.Json.Linq.JObject donor, bool keepOriginal = false ) : void

Merges two json objects together

taken from http://stackoverflow.com/questions/4002508/does-c-sharp-have-a-library-for-parsing-multi-level-cascading-json/4002550#4002550

ParseMain ( ) : string

Parses the JsResources.Main and replaces the replacement tokens accordingly.

ReplaceVirtualPaths ( Newtonsoft.Json.Linq.JObject jObj ) : void

Replaces any virtual paths found in properties

Method Details

GetJavascriptInitialization() public method

Processes all found manifest files and outputs the main.js file containing all plugin manifests
public GetJavascriptInitialization ( ) : string
return string

GetManifests() public method

Get all registered manifests
public GetManifests ( ) : IEnumerable
return IEnumerable

ManifestParser() public method

public ManifestParser ( DirectoryInfo pluginsDir ) : System
pluginsDir System.IO.DirectoryInfo
return System