Class ClientResource
Client resource definition
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Framework.Web.Resources
Assembly: EPiServer.Framework.dll
Version: 8.11.0Syntax
public class ClientResource : IEquatable<ClientResource>
Constructors
ClientResource()
Initializes a new instance of the ClientResource class.
Declaration
public ClientResource()
ClientResource(String, String)
Initializes a new instance of the ClientResource class.
Declaration
public ClientResource(string path, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path to the resource. |
System.String | name | The client resource name. |
Properties
Dependencies
Gets or sets the names of other client resources that current resource depends on.
Declaration
public List<string> Dependencies { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.String> | The dependencies. |
InlineContent
Gets or sets the inline content.
Declaration
public string InlineContent { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Inline content is igroned if client resource has not empty path.
IsExternal
Gets a value indicating whether this instance references external client resource and Path property contains well-formed URL.
Declaration
public bool IsExternal { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsMinified
Gets or sets a value indicating whether this resource content is already minified.
Declaration
public bool IsMinified { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
IsStatic
Gets a value indicating whether property Path is not empty and the client resource references virtual file or URL.
Declaration
public bool IsStatic { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Name
Gets or sets the client resource name.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
The name is used to reference client resource when registering required resources and defining dependencies. Several client resources can use the same name, if they need to be grouped.
Path
Gets or sets the path to the resource.
Declaration
public string Path { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
The path of style and JavaScript resource can have following values:
- Virtual path to resource file that is available on the site. For example: /modules/ModuleName/Script.js
- Well-formed URL to the external resource. For example: http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.min.js
ResourceType
Gets or sets the type of the client resource.
Declaration
public ClientResourceType ResourceType { get; set; }
Property Value
Type | Description |
---|---|
ClientResourceType |
SortIndex
Gets or sets the sort index, use this if you have dependencies between resources with the same name.
Declaration
public int SortIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
Default value is 0.
Methods
Equals(ClientResource)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(ClientResource other)
Parameters
Type | Name | Description |
---|---|---|
ClientResource | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current object is equal to the |
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
Exceptions
Type | Condition |
---|---|
System.NullReferenceException | The |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |