Class Macro
Represents a Macro
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
[Serializable]
[DataContract(IsReference = true)]
public class Macro : Entity, IMacro, IAggregateRoot, IDeletableEntity, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Constructors
Macro()
Declaration
public Macro()
Macro(Int32, Guid, Boolean, Int32, String, String, String, String, String, Boolean, Boolean, Boolean, String)
Creates an item with pre-filled properties
Declaration
public Macro(int id, Guid key, bool useInEditor, int cacheDuration, string alias, string name, string controlType, string controlAssembly, string xsltPath, bool cacheByPage, bool cacheByMember, bool dontRender, string scriptPath)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | |
System.Guid | key | |
System.Boolean | useInEditor | |
System.Int32 | cacheDuration | |
System.String | alias | |
System.String | name | |
System.String | controlType | |
System.String | controlAssembly | |
System.String | xsltPath | |
System.Boolean | cacheByPage | |
System.Boolean | cacheByMember | |
System.Boolean | dontRender | |
System.String | scriptPath |
Macro(String, String, String, String, String, String, Boolean, Boolean, Boolean, Boolean, Int32)
Creates an instance for persisting a new item
Declaration
public Macro(string alias, string name, string controlType = "", string controlAssembly = "", string xsltPath = "", string scriptPath = "", 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 | controlType | |
System.String | controlAssembly | |
System.String | xsltPath | |
System.String | scriptPath | |
System.Boolean | cacheByPage | |
System.Boolean | cacheByMember | |
System.Boolean | dontRender | |
System.Boolean | useInEditor | |
System.Int32 | cacheDuration |
Properties
Alias
Gets or sets the alias of the Macro
Declaration
[DataMember]
public string Alias { get; set; }
Property Value
Type | Description |
---|---|
System.String |
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 |
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 |
CacheDuration
Gets or sets the Cache Duration for the Macro
Declaration
[DataMember]
public int CacheDuration { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
ControlAssembly
Gets or sets the name of the assembly, which should be used by the Macro
Declaration
[DataMember]
public string ControlAssembly { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Will usually only be filled if the ControlType is a Usercontrol
ControlType
Gets or sets the path to user control or the Control Type to render
Declaration
[DataMember]
public string ControlType { get; set; }
Property Value
Type | Description |
---|---|
System.String |
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 |
Name
Gets or sets the name of the Macro
Declaration
[DataMember]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Properties
Gets or sets a list of Macro Properties
Declaration
[DataMember]
public MacroPropertyCollection Properties { get; }
Property Value
Type | Description |
---|---|
MacroPropertyCollection |
ScriptPath
Gets or set the path to the Python file in use
Declaration
[DataMember]
public string ScriptPath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Optional: Can only be one of three Script, Python or Xslt
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 |
XsltPath
Gets or sets the path to the Xslt file in use
Declaration
[DataMember]
public string XsltPath { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Optional: Can only be one of three Script, Python or Xslt
Methods
DeepClone()
Declaration
public override object DeepClone()
Returns
Type | Description |
---|---|
System.Object |
ResetDirtyProperties(Boolean)
Declaration
public override void ResetDirtyProperties(bool rememberPreviouslyChangedProperties)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | rememberPreviouslyChangedProperties |