internal static GXDLMSObject CreateObject(ObjectType type, Dictionary<ObjectType, Type> availableObjectTypes)
{
lock (availableObjectTypes)
{
//Update objects.
if (availableObjectTypes.Count == 0)
{
GetObjectTypes(availableObjectTypes);
}
if (availableObjectTypes.ContainsKey(type))
{
return Activator.CreateInstance(availableObjectTypes[type]) as GXDLMSObject;
}
}
GXDLMSObject obj = new GXDLMSObject();
obj.ObjectType = type;
return obj;
}