refactor: rootCollection to use IProperties
This commit is contained in:
@@ -2,6 +2,7 @@ using Speckle.Objects.Geometry;
|
||||
using Speckle.Objects.Other;
|
||||
using Speckle.Objects.Primitive;
|
||||
using Speckle.Sdk.Models;
|
||||
using Speckle.Sdk.Models.Proxies;
|
||||
|
||||
namespace Speckle.Objects;
|
||||
|
||||
@@ -110,15 +111,7 @@ public interface IDisplayValue<out T> : ISpeckleObject
|
||||
|
||||
#region Data objects
|
||||
|
||||
/// <summary>
|
||||
/// Specifies properties on objects to be used for data-based workflows
|
||||
/// </summary>
|
||||
public interface IProperties : ISpeckleObject
|
||||
{
|
||||
Dictionary<string, object?> properties { get; }
|
||||
}
|
||||
|
||||
public interface IDataObject : IProperties, IDisplayValue<IReadOnlyList<Base>>
|
||||
public interface IDataObject : IProperties, IDisplayValue<IReadOnlyList<Base>>, ISpeckleObject
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the object, primarily used to decorate the object for consumption in frontend and other apps
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Speckle.Sdk.Models.Proxies;
|
||||
|
||||
namespace Speckle.Sdk.Models.Collections;
|
||||
|
||||
/// <summary>
|
||||
@@ -5,7 +7,7 @@ namespace Speckle.Sdk.Models.Collections;
|
||||
/// Extends Collection to include model-wide properties that apply to the entire model.
|
||||
/// </summary>
|
||||
[SpeckleType("Speckle.Core.Models.Collections.RootCollection")]
|
||||
public class RootCollection : Collection
|
||||
public class RootCollection : Collection, IProperties
|
||||
{
|
||||
public RootCollection() { }
|
||||
|
||||
@@ -15,8 +17,5 @@ public class RootCollection : Collection
|
||||
/// <summary>
|
||||
/// Model-wide properties that apply to the entire model.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// These are intended for model-level metadata such as total area, project information, or analysis results.
|
||||
/// </remarks>
|
||||
public Dictionary<string, object?>? properties { get; set; }
|
||||
public Dictionary<string, object?> properties { get; set; } = new();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Speckle.Sdk.Models.Proxies;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies properties on objects to be used for data-based workflows.
|
||||
/// Can be applied to both objects and collections.
|
||||
/// </summary>
|
||||
public interface IProperties
|
||||
{
|
||||
Dictionary<string, object?> properties { get; }
|
||||
}
|
||||
Reference in New Issue
Block a user