public void Remove(ContentTypeElement element)
 {
     if (this.BaseIndexOf(element) >= 0)
     {
         this.BaseRemove(element.Id);
     }
 }
        public static void AddOrUpdateProperty(string alias, string fieldset, int contentTypeId)
        {
            var section = GetConfigSection();
            var contentTypeElement = section.ContentTypes.Cast<ContentTypeElement>().FirstOrDefault(c => c.Id == contentTypeId);

            if (contentTypeElement == null)
            {
                contentTypeElement = new ContentTypeElement { Id = contentTypeId };
                section.ContentTypes.Add(contentTypeElement);
            }

            var genericPropertyElement =
                contentTypeElement.GenericProperties.Cast<GenericPropertyElement>().FirstOrDefault (p => p.Alias == alias);

                if (genericPropertyElement == null)
                {
                    genericPropertyElement = new GenericPropertyElement {Alias = alias, Fieldset = fieldset};
                    contentTypeElement.GenericProperties.Add(genericPropertyElement);
                }
                genericPropertyElement.Fieldset = fieldset;

                section.CurrentConfiguration.Save();
        }
 public int IndexOf(ContentTypeElement element)
 {
     return this.BaseIndexOf(element);
 }
 public void Add(ContentTypeElement element)
 {
     this.BaseAdd(element);
 }