Переименование UOI в COI
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user