View Source
Class Macro
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
[DataContract(IsReference = true)]
public class Macro : EntityBase, IMacro, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Constructors
View Source
Macro(IShortStringHelper)
Declaration
public Macro(IShortStringHelper shortStringHelper)
Parameters
View Source
Macro(IShortStringHelper, Int32, Guid, Boolean, Int32, String, String, Boolean, Boolean, Boolean, String)
Creates an item with pre-filled properties
Declaration
public Macro(IShortStringHelper shortStringHelper, int id, Guid key, bool useInEditor, int cacheDuration, string alias, string name, bool cacheByPage, bool cacheByMember, bool dontRender, string macroSource)
Parameters
Type |
Name |
Description |
IShortStringHelper |
shortStringHelper |
|
System.Int32 |
id |
|
Guid |
key |
|
System.Boolean |
useInEditor |
|
System.Int32 |
cacheDuration |
|
System.String |
alias |
|
System.String |
name |
|
System.Boolean |
cacheByPage |
|
System.Boolean |
cacheByMember |
|
System.Boolean |
dontRender |
|
System.String |
macroSource |
|
View Source
Macro(IShortStringHelper, String, String, String, Boolean, Boolean, Boolean, Boolean, Int32)
Creates an instance for persisting a new item
Declaration
public Macro(IShortStringHelper shortStringHelper, string alias, string name, string macroSource, bool cacheByPage = false, bool cacheByMember = false, bool dontRender = true, bool useInEditor = false, int cacheDuration = 0)
Parameters
Type |
Name |
Description |
IShortStringHelper |
shortStringHelper |
|
System.String |
alias |
|
System.String |
name |
|
System.String |
macroSource |
|
System.Boolean |
cacheByPage |
|
System.Boolean |
cacheByMember |
|
System.Boolean |
dontRender |
|
System.Boolean |
useInEditor |
|
System.Int32 |
cacheDuration |
|
Properties
View Source
Alias
Gets or sets the alias of the Macro
Declaration
[DataMember]
public string Alias { get; set; }
Property Value
Type |
Description |
System.String |
|
View Source
CacheByMember
Gets or sets a boolean indicating whether the Macro should be Cached Personally
Declaration
[DataMember]
public bool CacheByMember { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
View Source
CacheByPage
Gets or sets a boolean indicating whether the Macro should be Cached by Page
Declaration
[DataMember]
public bool CacheByPage { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
View Source
CacheDuration
Gets or sets the Cache Duration for the Macro
Declaration
[DataMember]
public int CacheDuration { get; set; }
Property Value
Type |
Description |
System.Int32 |
|
View Source
DontRender
Gets or sets a boolean indicating whether the Macro should be rendered in an Editor
Declaration
[DataMember]
public bool DontRender { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
View Source
MacroSource
Gets or set the path to the Partial View to render
Declaration
[DataMember]
public string MacroSource { get; set; }
Property Value
Type |
Description |
System.String |
|
View Source
Name
Gets or sets the name of the Macro
Declaration
[DataMember]
public string Name { get; set; }
Property Value
Type |
Description |
System.String |
|
View Source
Properties
Gets or sets a list of Macro Properties
Declaration
[DataMember]
public MacroPropertyCollection Properties { get; }
Property Value
View Source
UseInEditor
Gets or sets a boolean indicating whether the Macro can be used in an Editor
Declaration
[DataMember]
public bool UseInEditor { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
View Source
Declaration
protected override void PerformDeepClone(object clone)
Parameters
Type |
Name |
Description |
System.Object |
clone |
|
View Source
ResetDirtyProperties(Boolean)
Declaration
public override void ResetDirtyProperties(bool rememberDirty)
Parameters
Type |
Name |
Description |
System.Boolean |
rememberDirty |
|