/// <summary> /// Root constructor /// </summary> /// <param name="definition">Entity definition that determines identity parameters</param> /// <param name="rootItem">Item contained by root</param> /// <param name="checkOptions">Options governing how uniqueness is enforced</param> protected MutableEntityTreeNode(IEntityDefinition <TId, TName, TItem> definition, TItem rootItem, ErrorCheckOptions checkOptions = ErrorCheckOptions.Default) : base(definition, rootItem, checkOptions) { _getName = definition.GetName; }
/// <summary> /// Root constructor /// </summary> /// <param name="definition">Entity definition that determines identity parameters</param> /// <param name="rootItem">Item contained by root</param> /// <param name="checkOptions">Options governing how uniqueness is enforced</param> protected ReadOnlyEntityTreeNode(IEntityDefinition <TId, TItem> definition, TItem rootItem, ErrorCheckOptions checkOptions = ErrorCheckOptions.Default) : base(definition, checkOptions, rootItem) { }
/// <summary> /// Root constructor /// </summary> /// <param name="getId">Entity Id selector</param> /// <param name="getItemName">Entity name (alias) selector</param> /// <param name="setItemName">Function specifying how entity name (alias) is set</param> /// <param name="rootItem">Item contained by root</param> /// <param name="checkOptions">Options governing how uniqueness is enforced</param> public NamedMutableEntityTreeNode(Func <TItem, TId> getId, Func <TItem, string> getItemName, Action <TItem, string> setItemName, TItem rootItem, ErrorCheckOptions checkOptions = ErrorCheckOptions.Default) : this(new NamedEntityDefinition <TId, TItem>(getId, getItemName), setItemName, rootItem, checkOptions) { }
/// <summary> /// Root constructor /// </summary> /// <param name="definition">Entity definition that determines identity parameters</param> /// <param name="setItemName">Function specifying how entity name is set</param> /// <param name="rootItem">Item contained by root</param> /// <param name="checkOptions">Options governing how uniqueness is enforced</param> public NamedMutableEntityTreeNode(IEntityDefinition <TId, string, TItem> definition, Action <TItem, string> setItemName, TItem rootItem, ErrorCheckOptions checkOptions = ErrorCheckOptions.Default) : base(definition, rootItem, checkOptions) { _setItemName = setItemName; }
/// <summary> /// Root constructor /// </summary> /// <param name="definition">Entity definition that determines identity parameters</param> /// <param name="checkOptions">Options governing how uniqueness is enforced</param> /// <param name="rootItem">Item contained by root</param> protected EntityTreeNode(IEntityDefinition <TId, TItem> definition, ErrorCheckOptions checkOptions, TItem rootItem) : base(rootItem, null) { Definition = definition; CheckOptions = checkOptions; TreeIdMap = checkOptions.HasFlag(ErrorCheckOptions.TreeScopeIdDuplicates) ? new HashSet <TId>(definition.IdEqualityComparer) : null; }
/// <summary> /// Root constructor /// </summary> /// <param name="getId">Entity Id selector</param> /// <param name="rootItem">Item contained by root</param> /// <param name="checkOptions">Options governing how uniqueness is enforced</param> public ReadOnlyEntityTreeNode(Func <TItem, TId> getId, TItem rootItem, ErrorCheckOptions checkOptions = ErrorCheckOptions.Default) : this(new EntityDefinition <TId, TItem>(getId), rootItem, checkOptions) { }
/// <summary> /// Root constructor /// </summary> /// <param name="definition">Entity definition that determines identity parameters</param> /// <param name="rootItem">Item contained by root</param> /// <param name="checkOptions">Options governing how uniqueness is enforced</param> public MutableEntityTreeNode(IEntityDefinition <TId, TItem> definition, TItem rootItem, ErrorCheckOptions checkOptions = ErrorCheckOptions.Default) : base(definition, rootItem, checkOptions) { }