View Source
Class Macro
Inheritance
System.Object
Assembly: Umbraco.Core.dll
Syntax
[Serializable]
[DataContract(IsReference = true)]
public class Macro : EntityBase, IMacro, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Constructors
View Source
Macro()
Declaration
View Source
Macro(Int32, Guid, Boolean, Int32, String, String, Boolean, Boolean, Boolean, String, MacroTypes)
Creates an item with pre-filled properties
Declaration
public Macro(int id, Guid key, bool useInEditor, int cacheDuration, string alias, string name, bool cacheByPage, bool cacheByMember, bool dontRender, string macroSource, MacroTypes macroType)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
System.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 |
|
MacroTypes |
macroType |
|
View Source
Macro(String, String, String, MacroTypes, Boolean, Boolean, Boolean, Boolean, Int32)
Creates an instance for persisting a new item
Declaration
public Macro(string alias, string name, string macroSource, MacroTypes macroType, bool cacheByPage = false, bool cacheByMember = false, bool dontRender = true, bool useInEditor = false, int cacheDuration = 0)
Parameters
Type |
Name |
Description |
System.String |
alias |
|
System.String |
name |
|
System.String |
macroSource |
|
MacroTypes |
macroType |
|
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
MacroType
Gets or set the path to the Partial View to render
Declaration
[DataMember]
public MacroTypes MacroType { get; set; }
Property Value
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 |
|