Class Resource
Resource Objects describe a JavaScript or CSS file which is needed by the Module to work.
public class Resource
- Inheritance
-
objectResource
- Derived
Properties
Bundle
For Scripts a Bundle can be used to identify dependencies and ordering in the script loading process (for Interactive rendering only)
public string Bundle { get; set; }
Property Value
- string
Content
For Scripts this allows for the 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
DataAttributes
Cusotm data-* attributes for scripts - not applicable to Stylesheets
public Dictionary<string, string> DataAttributes { get; set; }
Property Value
- Dictionary<string, string>
Declaration
[Obsolete("ResourceDeclaration is deprecated", false)]
public ResourceDeclaration Declaration { get; set; }
Property Value
ES6Module
[Obsolete("ES6Module is deprecated. Use Type property instead for scripts.", false)]
public bool ES6Module { get; set; }
Property Value
- bool
Fingerprint
Unique identifier of the version of the theme or module that declared the resource - for cache busting - only used in SiteRouter
public string Fingerprint { set; }
Property Value
- string
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
LoadBehavior
Specifies how a script should be loaded in Static rendering - not applicable to Stylesheets
public ResourceLoadBehavior LoadBehavior { get; set; }
Property Value
Location
For Scripts this defines if the resource should be included in the Head or Body
public ResourceLocation Location { get; set; }
Property Value
Namespace
The namespace of the component that declared the resource - only used in SiteRouter
public string Namespace { get; set; }
Property Value
- string
Reload
[Obsolete("Reload is deprecated. Use LoadBehavior property instead for scripts.", false)]
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 to define the type of resource ie. Script or Stylesheet
public ResourceType ResourceType { get; set; }
Property Value
Type
For Scripts this allows type to be specified - not applicable to Stylesheets
public string Type { get; set; }
Property Value
- string
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, string)
public Resource Clone(ResourceLevel level, string name, string fingerprint)
Parameters
level
ResourceLevelname
stringfingerprint
string