ContentAttribute Class

Namespace:
Weavy.Core.Models
Assembly:
Weavy.Core.dll

Attribute for providing metadata about content items.

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class ContentAttribute : PluginAttribute, _Attribute
Inheritance:
System.Object → System.Attribute → PluginAttributeContentAttribute
Attributes:
System.AttributeUsageAttribute

Constructors

ContentAttribute() Initializes a new instance of the ContentAttribute class.

Properties

AllowChildrenWithSameName Gets or sets a value indicating whether multiple childrens with the same name are allowed.
Children Gets or sets the System.Type of allowed child content, null means no children allowed and an an empty list means that any type of content is allowed.
CreateMode Gets or sets the the UI to use when creating new content.
CreateVerb This setting determines the verb used when when creating a new instance, e.g. 'Create'.
Layout Gets or sets the default layout.
Layouts Gets or sets the allowed layouts.
ModifyMode Gets or sets the the UI to use when updating an existing content item.
ModifyVerb This setting determines the verb used when modifying en existing instance, e.g. 'Update'.
Parents Gets or sets the System.Type of allowed parent apps and content types. If null (or empty) any type of app and/or content type is allowed.
PluralName This setting determines how multiple items will be referred to, e.g. 'blog posts'.
SingularName This setting determines how a singular item will be referred to, e.g. 'a blog post'.
SortBy Gets the default sort order.
SortBys Gets the possible ways to sort content.

Methods

AllowedChildren() Gets the allowed children for the content item as a comma separated string of guids, null means no child items allowed and "*" means any type of child content is allowed.
AllowedParents() Gets the allowed parents for the content item as a comma separated string of guids, "*" means any type of parent is allowed.
IsChildAllowed(Guid) Gets a value indicating whether the specied content item is an allowed child item.
IsParentAllowed(Guid) Gets a value indicating whether the specifed content item or app is an allowed parent.

Extension Methods

IsNullOrDefault(T) Gets a value indicating if the specified value has the default value of the generic type.
Serialize(Object) Serializes an object, or graph of connected objects, to a byte array.
SerializeToJson(Object, Nullable, JsonSerializerSettings) Serializes an object, or graph of connected objects, to a json string.
IsValid(Object) Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.