public static StylesheetProperty MakeNew(string Text, StyleSheet sheet, BusinessLogic.User user) { CMSNode newNode = CMSNode.MakeNew(sheet.Id, moduleObjectType, user.Id, 2, Text, Guid.NewGuid()); SqlHelper.ExecuteNonQuery(String.Format("Insert into cmsStylesheetProperty (nodeId,stylesheetPropertyAlias,stylesheetPropertyValue) values ('{0}','{1}','')", newNode.Id, Text)); StylesheetProperty ssp = new StylesheetProperty(newNode.Id); NewEventArgs e = new NewEventArgs(); ssp.OnNew(e); return ssp; }
public bool Delete() { cms.businesslogic.web.StylesheetProperty sp = new cms.businesslogic.web.StylesheetProperty(ParentID); cms.businesslogic.web.StyleSheet s = sp.StyleSheet(); s.saveCssToFile(); sp.delete(); return true; }
public override bool PerformDelete() { var sp = new cms.businesslogic.web.StylesheetProperty(ParentID); var s = sp.StyleSheet(); s.saveCssToFile(); sp.delete(); return true; }
public bool Delete() { cms.businesslogic.web.StylesheetProperty sp = new cms.businesslogic.web.StylesheetProperty(ParentID); cms.businesslogic.web.StyleSheet s = sp.StyleSheet(); s.saveCssToFile(); sp.delete(); return(true); }
public static StylesheetProperty MakeNew(string Text, StyleSheet sheet, BusinessLogic.User user) { CMSNode newNode = CMSNode.MakeNew(sheet.Id, moduleObjectType, user.Id, 2, Text, Guid.NewGuid()); SqlHelper.ExecuteNonQuery("Insert into cmsStylesheetProperty (nodeId,stylesheetPropertyAlias,stylesheetPropertyValue) values ('" + newNode.Id + "','" + Text + "','')"); StylesheetProperty ssp = new StylesheetProperty(newNode.Id); NewEventArgs e = new NewEventArgs(); ssp.OnNew(e); return(ssp); }
public static StylesheetProperty MakeNew(string Text, StyleSheet sheet, BusinessLogic.User user) { var newNode = CMSNode.MakeNew(sheet.Id, ModuleObjectType, user.Id, 2, Text, Guid.NewGuid()); SqlHelper.ExecuteNonQuery(String.Format("Insert into cmsStylesheetProperty (nodeId,stylesheetPropertyAlias,stylesheetPropertyValue) values ('{0}','{1}','')", newNode.Id, Text)); var ssp = new StylesheetProperty(newNode.Id); var e = new NewEventArgs(); ssp.OnNew(e); return(ssp); }
public static StylesheetProperty MakeNew(string Text, StyleSheet sheet, BusinessLogic.User user) { //we need to create it with a temp place holder! var prop = new Umbraco.Core.Models.StylesheetProperty(Text, "#" + Text.ToSafeAlias(), ""); sheet.StylesheetEntity.AddProperty(prop); ApplicationContext.Current.Services.FileService.SaveStylesheet(sheet.StylesheetEntity); var ssp = new StylesheetProperty(sheet.StylesheetEntity, prop); var e = new NewEventArgs(); ssp.OnNew(e); return(ssp); }
public static StyleSheet Import(XmlNode n, umbraco.BusinessLogic.User u) { string stylesheetName = xmlHelper.GetNodeValue(n.SelectSingleNode("Name")); StyleSheet s = GetByName(stylesheetName); if (s == null) { s = StyleSheet.MakeNew( u, stylesheetName, xmlHelper.GetNodeValue(n.SelectSingleNode("FileName")), xmlHelper.GetNodeValue(n.SelectSingleNode("Content"))); } foreach (XmlNode prop in n.SelectNodes("Properties/Property")) { string alias = xmlHelper.GetNodeValue(prop.SelectSingleNode("Alias")); var sp = s.Properties.SingleOrDefault(p => p != null && p.Alias == alias); string name = xmlHelper.GetNodeValue(prop.SelectSingleNode("Name")); if (sp == default(StylesheetProperty)) { sp = StylesheetProperty.MakeNew( name, s, u); } else { sp.Text = name; } sp.Alias = alias; sp.value = xmlHelper.GetNodeValue(prop.SelectSingleNode("Value")); } s.saveCssToFile(); return(s); }
public StylesheetProperty AddProperty(string Alias, BusinessLogic.User u) { return(StylesheetProperty.MakeNew(Alias, this, u)); }