public ContentProperty(string serializedValue, CultureInfo culture, Content content, IContentTypeProperty contentTypeProperty) { Content = content; SerializedValue = serializedValue; ContentTypeProperty = contentTypeProperty; Culture = culture; }
protected internal ContentProperty(Content content, IContentTypeProperty property, CultureInfo culture) { ContentTypeProperty = property; Culture = culture; Content = content; SerializedValue = property.SerializedDefaultValue; }
public ContentProperty(CultureInfo culture, object value, Content content, IContentTypeProperty contentTypeProperty) { Content = content; SetValue(value); ContentTypeProperty = contentTypeProperty; Culture = culture; }
public ActionResult Edit(string contentTypeFullName, string propertyFullName = null) { //TODO: Validation, etc. //TODO: BaseContentType contentTypeFullName = _reflectionContentManager.GetContentTypeFullNameFromPropertyFullName(propertyFullName) ?? contentTypeFullName; ContentType contentType = null; if (!contentTypeFullName.IsNullOrEmpty()) { contentType = _reflectionContentManager.LoadContentType(contentTypeFullName); } if (contentType == null) { throw new NotImplementedException(); } IContentTypeProperty contentTypeProperty = null; if (!propertyFullName.IsNullOrEmpty()) { contentType.TryGetProperty(propertyFullName, out contentTypeProperty); } var viewModel = new PropertyEditorViewModelBase(); if (contentTypeProperty != null) { viewModel.Name = contentTypeProperty.Name; } //viewModel.GetPropertyEditorValues = () => contentType.Module.ContentTypes.Select(ct => new MultiSelectListItem // { // GroupKey = ct.Module.Id.ToString(), // GroupName = ct.Module.Name, // Text = ct.Name, // Value = ct.Id.ToString() // }); viewModel.GetPropertyEditorValues = new[] { new SelectListItem { Text = "", Value = "" } } .Union(_propertyEditorRepository.GetAll().Select(p => new SelectListItem { Text = p.Name, Value = p.GetRoute + ";" + p.PostRoute })).ToArray(); viewModel.ContentTypeFullName = contentType.FullName; if (Request.IsAjaxRequest()) { return(PartialView("Edit", viewModel)); } return(View(viewModel)); }
private static Type GetTypeOrDefaultType(IContentTypeProperty contentTypeProperty) { Type type; if (!contentTypeProperty.TryGetMetadata("Type", out type)) { type = typeof(string); } return(type); }
private void AddContentProperty(ContentTranslationVersion currentVersion, IContentTypeProperty property, CultureInfo culture) { ContentTranslationVersionProperty currentVersionProperty; if (currentVersion.TryGetProperty(property.Name, out currentVersionProperty)) { _internalProperties.Add(new ContentProperty(currentVersionProperty.SerializedValue, culture, this, property)); } else { _internalProperties.Add(new ContentProperty(this, property, culture)); } }
public bool TryGetProperty(string name, out IContentTypeProperty contentTypeProperty) { name = name.SubstringAfterLastIndexOf('.'); return(_properties.TryGetValue(name, out contentTypeProperty)); }
private void AddInheritedProperty(IContentTypeProperty property) { _properties.Add(property.Name, new InheritedContentTypeProperty(property, this)); }
public ContentProperty this[IContentTypeProperty property] { get { return(this[property.Name]); } }
public bool TryGetProperty(IContentTypeProperty property, out ContentProperty contentProperty) { return(TryGetProperty(property.Name, out contentProperty)); }
protected internal InheritedContentTypeProperty(InheritedContentTypePropertyDto inheritedContentTypePropertyDto, IContentTypeProperty parentProperty, ContentType contentType) : base(parentProperty.Id, contentType, inheritedContentTypePropertyDto.Metadata) { _parentProperty = parentProperty; }
protected internal InheritedContentTypeProperty(IContentTypeProperty parentProperty, ContentType contentType) : base(parentProperty.Id, contentType) { _parentProperty = parentProperty; }