Search Results for

    Show / Hide Table of Contents
    View Source

    Class Stylesheet

    Represents a Stylesheet file

    Inheritance
    System.Object
    BeingDirtyBase
    EntityBase
    File
    Namespace: Umbraco.Cms.Core.Models
    Assembly: Umbraco.Core.dll
    Syntax
    [DataContract(IsReference = true)]
    public class Stylesheet : File, IStylesheet, IFile, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty

    Constructors

    View Source

    Stylesheet(String)

    Declaration
    public Stylesheet(string path)
    Parameters
    Type Name Description
    System.String path
    View Source

    Stylesheet(String, Nullable<Func<File, String>>)

    Declaration
    public Stylesheet(string path, Func<File, string>? getFileContent)
    Parameters
    Type Name Description
    System.String path
    System.Nullable<Func<File, System.String>> getFileContent

    Properties

    View Source

    Content

    Gets or sets the Content of a File

    Declaration
    public override string Content { get; set; }
    Property Value
    Type Description
    System.String
    View Source

    HasIdentity

    Indicates whether the current entity has an identity, which in this case is a path/name.

    Declaration
    public override bool HasIdentity { get; }
    Property Value
    Type Description
    System.Boolean
    Remarks

    Overrides the default Entity identity check.

    View Source

    Properties

    Returns a list of umbraco back office enabled stylesheet properties

    Declaration
    [IgnoreDataMember]
    public IEnumerable<IStylesheetProperty>? Properties { get; }
    Property Value
    Type Description
    System.Nullable<IEnumerable<IStylesheetProperty>>
    Remarks

    An umbraco back office enabled stylesheet property has a special prefix, for example: /** umb_name: MyPropertyName */ p { font-size: 1em; }

    Methods

    View Source

    AddProperty(IStylesheetProperty)

    Adds an Umbraco stylesheet property for use in the back office

    Declaration
    public void AddProperty(IStylesheetProperty property)
    Parameters
    Type Name Description
    IStylesheetProperty property
    View Source

    RemoveProperty(String)

    Removes an Umbraco stylesheet property

    Declaration
    public void RemoveProperty(string name)
    Parameters
    Type Name Description
    System.String name
    • Improve this Doc
    • View Source
    In This Article
    • Constructors
      • Stylesheet(String)
      • Stylesheet(String, Nullable<Func<File, String>>)
    • Properties
      • Content
      • HasIdentity
      • Properties
    • Methods
      • AddProperty(IStylesheetProperty)
      • RemoveProperty(String)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX