protected Element() { T = NullLocalizer.Instance; Data = new ElementDataDictionary(); ExportableData = new ElementDataDictionary(); }
public ImportElementContext() { ExportableData = new ElementDataDictionary(); }
public static ElementDataDictionary Combine(this ElementDataDictionary target, ElementDataDictionary input, bool removeNonExistingItems = false) { var combined = new ElementDataDictionary(target); foreach (var item in input) { combined[item.Key] = item.Value; } if (removeNonExistingItems) { foreach (var item in target) { if (!input.ContainsKey(item.Key)) { combined.Remove(item.Key); } } } return(combined); }
public ImportElementContext(Element element, ILayoutAspect layout, ElementDataDictionary exportableData, IContentImportSession session) { Element = element; Layout = layout; ExportableData = exportableData; Session = session; }
public static string Serialize(this ElementDataDictionary data) { return(data == null ? "" : String.Join("&", data.Select(x => String.Format("{0}={1}", x.Key, HttpUtility.UrlEncode(x.Value))))); }
public static string Get(this ElementDataDictionary data, string key, string defaultValue = null) { return(data != null?data.ContainsKey(key) ? data[key] : defaultValue : defaultValue); }
public static IValueProvider ToValueProvider(this ElementDataDictionary dictionary, CultureInfo culture) { return(new NameValueCollectionValueProvider(dictionary.ToNameValueCollection(), culture)); }
public ExportElementContext(Element element, ILayoutAspect layout, ElementDataDictionary exportableData) { Element = element; Layout = layout; ExportableData = exportableData; }
private ElementEditorContext CreateEditorContext(IContent content, Element element, ElementDataDictionary elementData, IUpdateModel updater, dynamic shapeFactory) { var context = new ElementEditorContext { Content = content, Element = element, Updater = updater, ValueProvider = elementData.ToValueProvider(_cultureAccessor.CurrentCulture), ElementData = elementData, ShapeFactory = shapeFactory, Prefix = Prefix }; return(context); }