/// <summary> /// Create a new instance of <see cref="NodeContainer"/>. This constructor allows to provide a <see cref="IGuidContainer"/>, /// in order to share object <see cref="Guid"/> between different <see cref="NodeContainer"/>. /// </summary> /// <param name="guidContainer">A <see cref="IGuidContainer"/> to use to ensure the unicity of guid associated to data objects. Cannot be <c>null</c></param> public NodeContainer(IGuidContainer guidContainer) { if (guidContainer == null) throw new ArgumentNullException(nameof(guidContainer)); this.guidContainer = guidContainer; NodeBuilder = CreateDefaultNodeBuilder(); RegisterDefaultFactory((name, content, guid) => new GraphNode(name, content, guid)); }
/// <summary> /// Create a new instance of <see cref="NodeContainer"/>. /// </summary> /// <param name="instantiateGuidContainer">Indicate whether to create a <see cref="GuidContainer"/> to store Guid per data object. This can be useful to retrieve an existing nodes for a data object.</param> public NodeContainer(bool instantiateGuidContainer = true) { if (instantiateGuidContainer) guidContainer = new GuidContainer(); NodeBuilder = CreateDefaultNodeBuilder(); RegisterDefaultFactory((name, content, guid) => new GraphNode(name, content, guid)); }
/// <summary> /// Create a new instance of <see cref="ModelContainer"/>. /// </summary> /// <param name="instantiateGuidContainer">Indicate whether to create a <see cref="GuidContainer"/> to store Guid per data object. This can be useful to retrieve an existing model from a data object.</param> public ModelContainer(bool instantiateGuidContainer = true) { if (instantiateGuidContainer) { guidContainer = new GuidContainer(); } NodeBuilder = CreateDefaultNodeBuilder(); }
/// <summary> /// Create a new instance of <see cref="ModelContainer"/>. This constructor allows to provide a <see cref="IGuidContainer"/>, /// in order to share object <see cref="Guid"/> between different <see cref="ModelContainer"/>. /// </summary> /// <param name="guidContainer">A <see cref="IGuidContainer"/> to use to ensure the unicity of guid associated to data objects. Cannot be <c>null</c></param> public ModelContainer(IGuidContainer guidContainer) { if (guidContainer == null) { throw new ArgumentNullException("guidContainer"); } this.guidContainer = guidContainer; NodeBuilder = CreateDefaultNodeBuilder(); }
/// <summary> /// Create a new instance of <see cref="NodeContainer"/>. /// </summary> /// <param name="instantiateGuidContainer">Indicate whether to create a <see cref="GuidContainer"/> to store Guid per data object. This can be useful to retrieve an existing nodes for a data object.</param> public NodeContainer(bool instantiateGuidContainer = true) { if (instantiateGuidContainer) { guidContainer = new GuidContainer(); } NodeBuilder = CreateDefaultNodeBuilder(); RegisterDefaultFactory((name, content, guid) => new GraphNode(name, content, guid)); }
/// <summary> /// Create a new instance of <see cref="NodeContainer"/>. This constructor allows to provide a <see cref="IGuidContainer"/>, /// in order to share object <see cref="Guid"/> between different <see cref="NodeContainer"/>. /// </summary> /// <param name="guidContainer">A <see cref="IGuidContainer"/> to use to ensure the unicity of guid associated to data objects. Cannot be <c>null</c></param> public NodeContainer(IGuidContainer guidContainer) { if (guidContainer == null) { throw new ArgumentNullException(nameof(guidContainer)); } this.guidContainer = guidContainer; NodeBuilder = CreateDefaultNodeBuilder(); RegisterDefaultFactory((name, content, guid) => new GraphNode(name, content, guid)); }
/// <summary> /// Creates a new instance of <see cref="NodeContainer"/> class. This constructor allows to provide a custom implementation /// of <see cref="IGuidContainer"/> in order to share <see cref="Guid"/> of objects. /// </summary> /// <param name="guidContainer">A <see cref="IGuidContainer"/> to use to ensure the unicity of guid associated to data objects. Cannot be <c>null</c></param> public NodeContainer(IGuidContainer guidContainer) { if (guidContainer == null) throw new ArgumentNullException(nameof(guidContainer)); this.guidContainer = guidContainer; NodeBuilder = CreateDefaultNodeBuilder(); }
/// <summary> /// Create a new instance of <see cref="ModelContainer"/>. /// </summary> /// <param name="instantiateGuidContainer">Indicate whether to create a <see cref="GuidContainer"/> to store Guid per data object. This can be useful to retrieve an existing model from a data object.</param> public ModelContainer(bool instantiateGuidContainer = true) { if (instantiateGuidContainer) guidContainer = new GuidContainer(); NodeBuilder = CreateDefaultNodeBuilder(); }