Переименование UOI в COI

This commit is contained in:
2025-03-10 21:56:22 +03:00
parent 96aa828808
commit 5e21d941df
11 changed files with 123 additions and 115 deletions
+10 -8
View File
@@ -12,16 +12,15 @@ namespace mROA.Cbor
public class PreParsedValue : IPreParsedValue
{
private List<object> _properties { get; set; }
public PreParsedValue(List<object> properties)
{
_properties = properties;
}
private List<object> _properties { get; set; }
public object? ToObject(Type type, IEndPointContext? context)
{
if (type.IsInterface)
{
var sharedShell = typeof(SharedObjectShellShell<>).MakeGenericType(type);
@@ -31,10 +30,10 @@ namespace mROA.Cbor
if (context != null)
so.EndPointContext = context;
so.Identifier = UniversalObjectIdentifier.FromFlat((ulong)_properties[0]);
so.Identifier = ComplexObjectIdentifier.FromFlat((ulong)_properties[0]);
return so.UniversalValue;
}
var instance = Activator.CreateInstance(type);
if (instance == null)
return null;
@@ -48,7 +47,10 @@ namespace mROA.Cbor
for (var index = 0; index < properties.Count; index++)
{
var property = properties[index];
property.SetValue(instance, _properties[index] is IPreParsedValue ppv ? ppv.ToObject(property.PropertyType, context) : _properties[index]);
property.SetValue(instance,
_properties[index] is IPreParsedValue ppv
? ppv.ToObject(property.PropertyType, context)
: _properties[index]);
}
return instance;
@@ -57,13 +59,13 @@ namespace mROA.Cbor
public class ParsedValue : IPreParsedValue
{
private object? _value;
public ParsedValue(object? value)
{
_value = value;
}
private object? _value;
public object? ToObject(Type type, IEndPointContext? context)
{