public void Remove(GenericPropertyElement element)
 {
     if (this.BaseIndexOf(element) >= 0)
     {
         this.BaseRemove(element.Alias);
     }
 }
        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(GenericPropertyElement element)
 {
     return this.BaseIndexOf(element);
 }
 public void Add(GenericPropertyElement element)
 {
     this.BaseAdd(element);
 }