Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CmsController" /> class.
 /// </summary>
 /// <param name="pageAccessor">The page accessor.</param>
 /// <param name="cmsConfiguration">The configuration loader.</param>
 /// <param name="cacheService">The cache service.</param>
 /// <param name="securityService">The security service.</param>
 public CmsController(IPageAccessor pageAccessor, ICmsConfiguration cmsConfiguration, ICacheService cacheService, ISecurityService securityService)
 {
     this.securityService = securityService;
     this.pageAccessor = pageAccessor;
     this.cmsConfiguration = cmsConfiguration;
     this.cacheService = cacheService;
 }
Example #2
0
        /// <summary>
        /// Constructs a new BinaryHeapNode
        /// </summary>
        /// <param name="pages">A list of pointers to pages</param>
        /// <param name="pageIndex">The index of the page in pages</param>
        /// <param name="pageSize">The number of values per page</param>
        /// <param name="index">The index inside the page, must be less than pageSize</param>
        public BinaryHeapNode(IPageAccessor <BinaryHeap <TKey, TValue> .Data> pages, ulong index)
        {
            this.index = index;
            this.pages = pages;

            parentIndex     = TreeHelper.CalculateParentIndex(index);
            leftChildIndex  = TreeHelper.CalculateLeftChildIndex(index);
            rightChildIndex = TreeHelper.CalculateRightChildIndex(index);
        }
 public GetPageToRenderCommand(IPageAccessor pageAccessor, PageContentProjectionFactory pageContentProjectionFactory,
                               PageStylesheetProjectionFactory pageStylesheetProjectionFactory, PageJavaScriptProjectionFactory pageJavaScriptProjectionFactory,
                               ICmsConfiguration cmsConfiguration, RootModuleDescriptor rootModuleDescriptor)
 {
     this.rootModuleDescriptor            = rootModuleDescriptor;
     this.pageContentProjectionFactory    = pageContentProjectionFactory;
     this.pageStylesheetProjectionFactory = pageStylesheetProjectionFactory;
     this.pageJavaScriptProjectionFactory = pageJavaScriptProjectionFactory;
     this.pageAccessor     = pageAccessor;
     this.cmsConfiguration = cmsConfiguration;
 }
Example #4
0
 public GetPageToRenderCommand(IPageAccessor pageAccessor, PageStylesheetProjectionFactory pageStylesheetProjectionFactory,
                               PageJavaScriptProjectionFactory pageJavaScriptProjectionFactory,
                               ICmsConfiguration cmsConfiguration, RootModuleDescriptor rootModuleDescriptor, IOptionService optionService,
                               IContentProjectionService contentProjectionService, IChildContentService childContentService)
 {
     this.rootModuleDescriptor            = rootModuleDescriptor;
     this.pageStylesheetProjectionFactory = pageStylesheetProjectionFactory;
     this.pageJavaScriptProjectionFactory = pageJavaScriptProjectionFactory;
     this.pageAccessor             = pageAccessor;
     this.cmsConfiguration         = cmsConfiguration;
     this.optionService            = optionService;
     this.contentProjectionService = contentProjectionService;
     this.childContentService      = childContentService;
 }
Example #5
0
        /// <summary>
        /// Constructs a new BinaryHeapNode
        /// </summary>
        /// <param name="pages">A list of pointers to pages</param>
        /// <param name="pageIndex">The index of the page in pages</param>
        /// <param name="pageSize">The number of values per page</param>
        /// <param name="index">The index inside the page, must be less than pageSize</param>
        public BTreeNode(IPageAccessor <BTreeNode <TKey, TValue> .Data> pages, IBTreeValue <TKey, TValue>?parent, int arity, ulong index)
        {
            if (arity < 2)
            {
                throw new ArgumentOutOfRangeException(nameof(arity), arity, "Arity must be greater or equal to two");
            }

            if (index == 0)
            {
                throw new ArgumentNullException(nameof(index), "The node's index may not be 0");
            }

            this.pages  = pages;
            this.parent = parent;
            this.index  = index;
            this.arity  = arity;
        }
Example #6
0
        public BTree(IPageAccessor <BTreeNode <TKey, TValue> .Data> pageAccessor, int arity = 2)
        {
            // Console.WriteLine($"Creating new heap");
            pages = pageAccessor;
            Arity = arity;

            if (!pages.GetPageFor(1).IsIndexUsed(1))
            {
                for (var i = 0; i <= arity; i++)
                {
                    var idx = (ulong)i;
                    idx++;

                    var page = pages.GetPageFor(idx);
                    page.Set(idx);
                    page[idx] = new BTreeNode <TKey, TValue> .Data {
                        IsAvailable = false,
                        LesserIndex = 0
                    };
                }
            }

            RootNode = new BTreeNode <TKey, TValue>(pages, null, arity, 1);
        }
Example #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SidebarController" /> class.
 /// </summary>
 /// <param name="modulesRegistration">The modules.</param>
 /// <param name="pageAccessor">The page extensions.</param>
 /// <param name="configuration">The CMS configuration.</param>
 public SidebarController(IModulesRegistration modulesRegistration, IPageAccessor pageAccessor, ICmsConfiguration configuration)
 {
     this.configuration       = configuration;
     this.modulesRegistration = modulesRegistration;
     this.pageAccessor        = pageAccessor;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SiteSettingsController" /> class.
 /// </summary>
 /// <param name="modulesRegistration">The modules registration.</param>
 /// <param name="pageAccessor">The page extensions.</param>
 public SiteSettingsController(IModulesRegistration modulesRegistration, IPageAccessor pageAccessor)
 {
     this.modulesRegistration = modulesRegistration;
     this.pageAccessor = pageAccessor;
 }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SidebarController" /> class.
 /// </summary>
 /// <param name="modulesRegistration">The modules.</param>
 /// <param name="pageAccessor">The page extensions.</param>
 /// <param name="cmsHost">The contract for BetterCMS application host.</param>
 public SidebarController(IModulesRegistration modulesRegistration, IPageAccessor pageAccessor, ICmsHost cmsHost)
 {
     this.cmsHost = cmsHost;
     this.modulesRegistration = modulesRegistration;
     this.pageAccessor = pageAccessor;
 }
Example #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SiteSettingsController" /> class.
 /// </summary>
 /// <param name="modulesRegistration">The modules registration.</param>
 /// <param name="pageAccessor">The page extensions.</param>
 public SiteSettingsController(IModulesRegistration modulesRegistration, IPageAccessor pageAccessor)
 {
     this.modulesRegistration = modulesRegistration;
     this.pageAccessor        = pageAccessor;
 }
Example #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SidebarController" /> class.
 /// </summary>
 /// <param name="modulesRegistration">The modules.</param>
 /// <param name="pageAccessor">The page extensions.</param>
 /// <param name="configuration">The CMS configuration.</param>
 public SidebarController(IModulesRegistration modulesRegistration, IPageAccessor pageAccessor, ICmsConfiguration configuration)
 {
     this.configuration = configuration;
     this.modulesRegistration = modulesRegistration;
     this.pageAccessor = pageAccessor;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="RenderingController" /> class.
 /// </summary>
 /// <param name="modulesRegistration">A contract to manage modules registry.</param>
 /// <param name="pageAccessor">The page extensions.</param>
 public RenderingController(IModulesRegistration modulesRegistration, IPageAccessor pageAccessor)
 {
     this.modulesRegistration = modulesRegistration;
     this.pageAccessor = pageAccessor;
 }
Example #13
0
 public BinaryHeap(IPageAccessor <Data> pageAccessor)
 {
     // Console.WriteLine($"Creating new heap");
     pages    = pageAccessor;
     RootNode = new BinaryHeapNode <TKey, TValue>(pages, 0);
 }