public MacroModel(string name, string alias, string typeAssembly, string typeName, string xslt, string scriptName, int cacheDuration, bool cacheByPage, bool cacheByMember) { Name = name; Alias = alias; TypeAssembly = typeAssembly; TypeName = typeName; Xslt = xslt; ScriptName = scriptName; CacheDuration = cacheDuration; CacheByPage = cacheByPage; CacheByMember = cacheByMember; Properties = new List <MacroPropertyModel>(); MacroType = Macro.FindMacroType(Xslt, ScriptName, TypeName, TypeAssembly); }
public MacroModel(Macro m) { Properties = new List <MacroPropertyModel>(); if (m != null) { Id = m.Id; Name = m.Name; Alias = m.Alias; TypeAssembly = m.Assembly; TypeName = m.Type; Xslt = m.Xslt; ScriptName = m.ScriptingFile; CacheDuration = m.RefreshRate; CacheByPage = m.CacheByPage; CacheByMember = m.CachePersonalized; RenderInEditor = m.RenderContent; foreach (MacroProperty mp in m.Properties) { Properties.Add( new MacroPropertyModel(mp.Alias, string.Empty, mp.Type.Alias, mp.Type.BaseType)); } MacroType = Macro.FindMacroType(Xslt, ScriptName, TypeName, TypeAssembly); } }