Table of Contents

Class Resource

Namespace
Oqtane.Models
Assembly
Oqtane.Shared.dll

Resource Objects describe a JavaScript or CSS file which is needed by the Module to work.

public class Resource
Inheritance
Resource

Properties

Bundle

For Scripts a Bundle can be used to identify dependencies and ordering in the script loading process

public string Bundle { get; set; }

Property Value

string

Content

Allows specification of inline script - not applicable to Stylesheets

public string Content { get; set; }

Property Value

string

CrossOrigin

Cross-Origin rules for this Resources. Usually anonymous

public string CrossOrigin { get; set; }

Property Value

string

Declaration

[Obsolete("ResourceDeclaration is deprecated", false)]
public ResourceDeclaration Declaration { get; set; }

Property Value

ResourceDeclaration

ES6Module

For Scripts this allows type="module" registrations - not applicable to Stylesheets

public bool ES6Module { get; set; }

Property Value

bool

Integrity

Integrity checks to increase the security of resources accessed. Especially common in CDN resources.

public string Integrity { get; set; }

Property Value

string

Level

For Stylesheets this defines the relative position for cascading purposes

public ResourceLevel Level { get; set; }

Property Value

ResourceLevel

Location

For Scripts this defines if the resource should be included in the Head or Body

public ResourceLocation Location { get; set; }

Property Value

ResourceLocation

Namespace

The namespace of the component that declared the resource - only used in SiteRouter

public string Namespace { get; set; }

Property Value

string

Reload

Indicates that a script should be reloaded on every page transition - not applicable to Stylesheets

public bool Reload { get; set; }

Property Value

bool

RenderMode

For Scripts this defines the render mode (default is all render modes) - not applicable to Stylesheets

public string RenderMode { get; set; }

Property Value

string

ResourceType

A ResourceType so the Interop can properly create script or link tags

public ResourceType ResourceType { get; set; }

Property Value

ResourceType

Url

Path to the resource (note that querytring parameters can be included for cache busting ie. ?v=#)

public string Url { get; set; }

Property Value

string

Methods

Clone(ResourceLevel, string)

public Resource Clone(ResourceLevel level, string name)

Parameters

level ResourceLevel
name string

Returns

Resource