/// <summary> /// Constructor for a ParameterEditor /// </summary> protected AbstractParameterEditor(IPropertyEditorFactory propertyEditorFactory) { //Locate the metadata attribute var paramEditorAttributes = GetType() .GetCustomAttributes(typeof(ParameterEditorAttribute), true) .OfType<ParameterEditorAttribute>(); if (!paramEditorAttributes.Any()) throw new InvalidOperationException( string.Format("The ParameterEditor of type {0} is missing the {1} attribute", GetType().FullName, typeof(ParameterEditorAttribute).FullName)); //assign the properties of this object to those of the metadata attribute var attr = paramEditorAttributes.First(); Id = attr.Id; Name = attr.Name; Alias = attr.Alias; PropertyEditorId = attr.PropertyEditorId; _propertyEditorFactory = propertyEditorFactory; var propEditor = _propertyEditorFactory.GetPropertyEditor(PropertyEditorId); if(propEditor == null) throw new InvalidOperationException("Unable to find a Property Editor with the id '"+ PropertyEditorId +"'"); if (!propEditor.Metadata.IsParameterEditor) throw new InvalidOperationException("Property Editor '"+ propEditor.Metadata.Name +"' is not a valid Parameter Editor type"); _propertyEditor = propertyEditorFactory.GetPropertyEditor(PropertyEditorId).Value; }
public DevDatasetInstallTask( IFrameworkContext frameworkContext, IPropertyEditorFactory propertyEditorFactory, IHiveManager hiveManager, IAttributeTypeRegistry attributeTypeRegistry) : base(frameworkContext, hiveManager) { _devDataSet = new DevDataset(propertyEditorFactory, frameworkContext, attributeTypeRegistry); }
public DevDataset(IPropertyEditorFactory propertyEditorFactory, IFrameworkContext frameworkContext, IAttributeTypeRegistry attributeTypeRegistry) { _frameworkContext = frameworkContext; _attributeTypeRegistry = attributeTypeRegistry; PropertyEditorFactory = propertyEditorFactory; InitCreators(); InitDataTypes(); InitTemplates(); InitDocTypes(); _nodeData = XDocument.Parse(Files.rebel); }
public DevDataset(IPropertyEditorFactory propertyEditorFactory, IFrameworkContext frameworkContext, IAttributeTypeRegistry attributeTypeRegistry) { _frameworkContext = frameworkContext; _attributeTypeRegistry = attributeTypeRegistry; PropertyEditorFactory = propertyEditorFactory; InitCreators(); InitDataTypes(); InitTemplates(); InitDocTypes(); _nodeData = XDocument.Parse(Files.umbraco); }
/// <summary> /// Initializes a new instance of the <see cref="T:System.Object"/> class. /// </summary> public MapResolverContext( IFrameworkContext frameworkContext, IHiveManager hive, IPropertyEditorFactory propertyEditorFactory, IParameterEditorFactory parameterEditorFactory) { ApplicationId = Guid.NewGuid(); FrameworkContext = frameworkContext; Hive = hive; PropertyEditorFactory = propertyEditorFactory; ParameterEditorFactory = parameterEditorFactory; }
public PugpigDataset(IPropertyEditorFactory propertyEditorFactory, IFrameworkContext frameworkContext, IAttributeTypeRegistry attributeTypeRegistry) { _frameworkContext = frameworkContext; PropertyEditorFactory = propertyEditorFactory; //InitCreators(); // Anthony's code var helper = new UmbracoXmlImportHelper(attributeTypeRegistry, propertyEditorFactory); _templates = helper.InitTemplates(); _dataTypes = helper.InitDataTypes(_frameworkContext); _docTypes = helper.InitDocTypes(); // get content node xml _nodeData = XDocument.Parse(Files.umbraco); }
public Property(object owner, PropertyInfo info, IPropertyEditorFactory editorFactory) { DisplayName = info.GetCustomAttribute <DisplayNameAttribute>(true)?.DisplayName ?? info.Name; Description = info.GetCustomAttribute <DescriptionAttribute>(true)?.Description; Category = info.GetCustomAttribute <CategoryAttribute>(true)?.Category ?? GENERIC_CATEGORY; var editable = info.GetCustomAttribute <EditableAttribute>(true)?.AllowEdit ?? false; var editorType = editable ? editorFactory.GetEditorType(info.PropertyType) : null; Value.Owner = owner; Value.Type = info.PropertyType; Value.Editor = editorType != null?Activator.CreateInstance(editorType, true) as IPropertyEditor : null; Value.Getter = () => info.GetValue(owner); Value.Setter = (v) => info.SetValue(owner, v); if (owner is INotifyPropertyChanged) { notificationSource = owner as INotifyPropertyChanged; propertyChangedHandler = new PropertyChangedEventHandler(Property_PropertyChanged); notificationSource.PropertyChanged += propertyChangedHandler; } }
/// <summary> /// Constructor for a ParameterEditor /// </summary> protected AbstractParameterEditor(IPropertyEditorFactory propertyEditorFactory) { //Locate the metadata attribute var paramEditorAttributes = GetType() .GetCustomAttributes(typeof(ParameterEditorAttribute), true) .OfType <ParameterEditorAttribute>(); if (!paramEditorAttributes.Any()) { throw new InvalidOperationException( string.Format("The ParameterEditor of type {0} is missing the {1} attribute", GetType().FullName, typeof(ParameterEditorAttribute).FullName)); } //assign the properties of this object to those of the metadata attribute var attr = paramEditorAttributes.First(); Id = attr.Id; Name = attr.Name; Alias = attr.Alias; PropertyEditorId = attr.PropertyEditorId; _propertyEditorFactory = propertyEditorFactory; var propEditor = _propertyEditorFactory.GetPropertyEditor(PropertyEditorId); if (propEditor == null) { throw new InvalidOperationException("Unable to find a Property Editor with the id '" + PropertyEditorId + "'"); } if (!propEditor.Metadata.IsParameterEditor) { throw new InvalidOperationException("Property Editor '" + propEditor.Metadata.Name + "' is not a valid Parameter Editor type"); } _propertyEditor = propertyEditorFactory.GetPropertyEditor(PropertyEditorId).Value; }
public IntegerEditor(IPropertyEditorFactory propertyEditorFactory) : base(propertyEditorFactory) { }
/// <summary> /// Initializes a new instance of the <see cref="T:System.Object"/> class. /// </summary> public MockedMapResolverContext(IFrameworkContext frameworkContext, IHiveManager hive, IPropertyEditorFactory propertyEditorFactory, IParameterEditorFactory parameterEditorFactory) : base(frameworkContext, hive, propertyEditorFactory, parameterEditorFactory) { }
public DocumentTypePicker(IPropertyEditorFactory propertyEditorFactory) : base(propertyEditorFactory) { }
public TextareaEditor(IPropertyEditorFactory propertyEditorFactory) : base(propertyEditorFactory) { }
public TextstringEditor(IPropertyEditorFactory propertyEditorFactory) : base(propertyEditorFactory) { }
protected ParameterEditor(IPropertyEditorFactory propertyEditorFactory) : base(propertyEditorFactory) { }
public MemberTypePicker(IPropertyEditorFactory propertyEditorFactory) : base(propertyEditorFactory) { }
public TrueFalseEditor(IPropertyEditorFactory propertyEditorFactory) : base(propertyEditorFactory) { }
public UserGroupPicker(IPropertyEditorFactory propertyEditorFactory) : base(propertyEditorFactory) { }
public UmbracoXmlImportHelper(IAttributeTypeRegistry attributeTypeRegistry, IPropertyEditorFactory propertyEditorFactory) { _attributeTypeRegistry = attributeTypeRegistry; _propertyEditorFactory = propertyEditorFactory; _Schema = XDocument.Parse(Files.Schema); }
public ContentPickerEditor(IPropertyEditorFactory propertyEditorFactory) : base(propertyEditorFactory) { }
public MemberGroupPicker(IPropertyEditorFactory propertyEditorFactory) : base(propertyEditorFactory) { }
public MediaTypePicker(IPropertyEditorFactory propertyEditorFactory) : base(propertyEditorFactory) { }
public MediaPickerEditor(IPropertyEditorFactory propertyEditorFactory) : base(propertyEditorFactory) { }
/// <summary> /// Returns a property editor from the property editor factory using a string id which must parse to a Guid /// </summary> /// <param name="factory"></param> /// <param name="id"></param> /// <returns></returns> public static Lazy <PropertyEditor, PropertyEditorMetadata> GetPropertyEditor(this IPropertyEditorFactory factory, string id) { Guid propEditorId; if (!Guid.TryParse(id, out propEditorId)) { throw new InvalidCastException("The id specified is not a valid GUID"); } return(factory.GetPropertyEditor(propEditorId)); }