1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Made AddDynamicChild return the datamodel added

This commit is contained in:
Diogo Trindade 2020-10-04 23:06:40 +01:00
parent 8f552d0f71
commit 36571471cf

View File

@ -58,7 +58,7 @@ namespace Artemis.Core.DataModelExpansions
/// <param name="key">The key of the child, must be unique to this data model</param> /// <param name="key">The key of the child, must be unique to this data model</param>
/// <param name="name">An optional name, if not provided the key will be used in a humanized form</param> /// <param name="name">An optional name, if not provided the key will be used in a humanized form</param>
/// <param name="description">An optional description</param> /// <param name="description">An optional description</param>
public void AddDynamicChild(DataModel dynamicDataModel, string key, string name = null, string description = null) public DataModel AddDynamicChild(DataModel dynamicDataModel, string key, string name = null, string description = null)
{ {
if (dynamicDataModel == null) if (dynamicDataModel == null)
throw new ArgumentNullException(nameof(dynamicDataModel)); throw new ArgumentNullException(nameof(dynamicDataModel));
@ -91,6 +91,8 @@ namespace Artemis.Core.DataModelExpansions
Description = description Description = description
}; };
_dynamicDataModels.Add(key, dynamicDataModel); _dynamicDataModels.Add(key, dynamicDataModel);
return dynamicDataModel;
} }
/// <summary> /// <summary>