Inheritance: TimestampedModel
        /// <summary>
        /// initialize collections so they are never null
        /// </summary>
        protected AbstractSchemaEditorModel()
        {
            NewProperty    = new DocumentTypeProperty();
            ActiveTabIndex = 0;
            Properties     = new HashSet <DocumentTypeProperty>();

            AllowedChildren     = Enumerable.Empty <SelectListItem>();
            AllowedChildIds     = Enumerable.Empty <HiveId>();
            InheritFrom         = Enumerable.Empty <HierarchicalSelectListItem>();
            InheritFromIds      = Enumerable.Empty <HiveId>();
            AvailableIcons      = Enumerable.Empty <SelectListItem>();
            AvailableThumbnails = Enumerable.Empty <SelectListItem>();
            AvailableDataTypes  = Enumerable.Empty <SelectListItem>();
            AvailableTabs       = Enumerable.Empty <SelectListItem>();

            //ensure theres always a general tab
            DefinedTabs = new HashSet <Tab>();
            var generalGroup = FixedGroupDefinitions.GeneralGroup;

            DefinedTabs.Add(new Tab {
                Alias = generalGroup.Alias, Name = generalGroup.Name, SortOrder = generalGroup.Ordinal
            });

            InheritedTabs       = new HashSet <Tab>();
            InheritedProperties = new HashSet <DocumentTypeProperty>();

            IsReadOnly = false;
            IsAbstract = false;

            Icon      = "tree-folder";
            Thumbnail = "doc.png";

            PopulateUIElements();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor for creating a property that has a single bool value
 /// </summary>
 /// <param name="id"></param>
 /// <param name="docTypeProperty"></param>
 /// <param name="propertyValue">The value of the property</param>
 /// <remarks>
 /// This will create a new Dictionary object to put the value in with a key of "Value"
 /// </remarks>
 public ContentProperty(HiveId id,
                        DocumentTypeProperty docTypeProperty,
                        bool propertyValue)
     : this(id, docTypeProperty, new Dictionary <string, object> {
     { "Value", propertyValue }
 })
 {
 }
Ejemplo n.º 3
0
        /// <summary>
        /// constructor for creating a property that has a multi-value
        /// </summary>
        /// <param name="id"></param>
        /// <param name="docTypeProperty">The DocumentTypeProperty associated with this content property</param>
        /// <param name="propertyValue">The value of the property, used to set the values of the editor model</param>
        public ContentProperty(HiveId id,
                               DocumentTypeProperty docTypeProperty,
                               IDictionary <string, object> propertyValue)
        {
            Mandate.ParameterNotEmpty(id, "id");
            Mandate.ParameterNotNull(docTypeProperty, "docTypeProperty");

            _propertyValue    = propertyValue;
            Id                = id;
            DocTypeProperty   = docTypeProperty;
            DocTypePropertyId = docTypeProperty.Id;
        }