Exemple #1
0
        private void EditContentTypeHeader(XmlDocument xDoc, CtdBuilder builder)
        {
            void SetProperty(string propertyName, string value)
            {
                if (value == null)
                {
                    return;
                }

                var propertyElement = LoadOrAddChild(xDoc.DocumentElement, propertyName);

                propertyElement.InnerXml = value;
            }

            SetProperty("DisplayName", builder.DisplayNameValue);
            SetProperty("Description", builder.DescriptionValue);
            SetProperty("Icon", builder.IconValue);
        }
Exemple #2
0
        public IContentTypeBuilder Type(string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException(nameof(name));
            }

            var ctb = ContentTypeBuilders.FirstOrDefault(cb => cb.ContentTypeName == name);

            if (ctb != null)
            {
                return(ctb);
            }

            ctb = new CtdBuilder(name);
            ContentTypeBuilders.Add(ctb);

            return(ctb);
        }
Exemple #3
0
 internal FieldEditor(CtdBuilder ctdBuilder, string name, string type)
 {
     _ctdBuilder = ctdBuilder;
     FieldName   = name;
     Type        = type;
 }