public override void delete()
        {
            var e = new DeleteEventArgs();

            FireBeforeDelete(e);

            if (!e.Cancel)
            {
                StylesheetItem.RemoveProperty(Text);
                ApplicationContext.Current.Services.FileService.SaveStylesheet(StylesheetItem);

                FireAfterDelete(e);
            }
        }
예제 #2
0
        private void SaveClick(object sender, EventArgs e)
        {
            _stylesheetproperty.Value = Content.Text;
            _stylesheetproperty.Alias = AliasTxt.Text;

            if (_stylesheetproperty.Name != NameTxt.Text)
            {
                //to change the name we actually have to remove the property and re-add it as a different one
                _sheet.AddProperty(new Umbraco.Core.Models.StylesheetProperty(NameTxt.Text, _stylesheetproperty.Alias, _stylesheetproperty.Value));
                _sheet.RemoveProperty(_stylesheetproperty.Name);
                //reset our variable
                _stylesheetproperty = _sheet.Properties.Single(x => x.Name == NameTxt.Text);
            }

            Services.FileService.SaveStylesheet(_sheet);

            ClientTools.ShowSpeechBubble(speechBubbleIcon.save, ui.Text("speechBubbles", "editStylesheetPropertySaved", UmbracoUser), "");
        }