From 31865554892b25858056663296d009ae6dc303ac Mon Sep 17 00:00:00 2001 From: Pawel Baran Date: Fri, 5 Nov 2021 20:11:31 +0100 Subject: [PATCH] code aligned to the changes in Reflection_Engine --- UI_Engine/Query/Items.cs | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/UI_Engine/Query/Items.cs b/UI_Engine/Query/Items.cs index 59b9445..77e4f03 100644 --- a/UI_Engine/Query/Items.cs +++ b/UI_Engine/Query/Items.cs @@ -22,9 +22,10 @@ using BH.Adapter; using BH.Engine.Reflection; -using BH.oM.Base; +using BH.oM.Reflection.Attributes; using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Reflection; @@ -36,6 +37,8 @@ public static partial class Query /**** Public Methods ****/ /***************************************************/ + [Description("Extracts all BHoM methods to be grouped as Engine items in the UI (combined group of all 5 basic Engine classes).")] + [Output("items", "All BHoM methods to be grouped as Engine items.")] public static IEnumerable EngineItems() { return Engine.Reflection.Query.BHoMMethodList().Where(x => x.IsExposed()); @@ -43,6 +46,8 @@ public static IEnumerable EngineItems() /***************************************************/ + [Description("Extracts all BHoM methods to be grouped as Create items in the UI.")] + [Output("items", "All BHoM methods to be grouped as Create items.")] public static IEnumerable CreateItems() { return Engine.Reflection.Query.BHoMMethodList() @@ -51,6 +56,8 @@ public static IEnumerable CreateItems() /***************************************************/ + [Description("Extracts all BHoM methods to be grouped as Compute items in the UI.")] + [Output("items", "All BHoM methods to be grouped as Compute items.")] public static IEnumerable ComputeItems() { return Engine.Reflection.Query.BHoMMethodList() @@ -59,6 +66,8 @@ public static IEnumerable ComputeItems() /***************************************************/ + [Description("Extracts all BHoM methods to be grouped as Convert items in the UI.")] + [Output("items", "All BHoM methods to be grouped as Convert items.")] public static IEnumerable ConvertItems() { return Engine.Reflection.Query.BHoMMethodList() @@ -67,6 +76,8 @@ public static IEnumerable ConvertItems() /***************************************************/ + [Description("Extracts all BHoM methods to be grouped as Modify items in the UI.")] + [Output("items", "All BHoM methods to be grouped as Modify items.")] public static IEnumerable ModifyItems() { return Engine.Reflection.Query.BHoMMethodList() @@ -75,6 +86,8 @@ public static IEnumerable ModifyItems() /***************************************************/ + [Description("Extracts all BHoM methods to be grouped as Query items in the UI.")] + [Output("items", "All BHoM methods to be grouped as Query items.")] public static IEnumerable QueryItems() { return Engine.Reflection.Query.BHoMMethodList() @@ -83,6 +96,8 @@ public static IEnumerable QueryItems() /***************************************************/ + [Description("Extracts all BHoM type constructors to be grouped as Create Adapter items in the UI.")] + [Output("items", "All BHoM type constructors to be grouped as Create Adapter items.")] public static IEnumerable AdapterConstructorItems() { return Engine.Reflection.Query.AdapterTypeList() @@ -93,6 +108,8 @@ public static IEnumerable AdapterConstructorItems() /***************************************************/ + [Description("Extracts all BHoM type constructors to be grouped as Create Request items in the UI.")] + [Output("items", "All BHoM type constructors to be grouped as Create Request items.")] public static IEnumerable CreateRequestItems() { return BH.Engine.Reflection.Query.BHoMMethodList() @@ -104,6 +121,8 @@ public static IEnumerable CreateRequestItems() /***************************************************/ + [Description("Extracts all BHoM types that implement IRequest interface and have a valid public constructor.")] + [Output("items", "All BHoM types that implement IRequest interface and have a valid public constructor.")] public static IEnumerable ConstructableRequestItems() { return Engine.Reflection.Query.BHoMTypeList() @@ -113,10 +132,12 @@ public static IEnumerable ConstructableRequestItems() /***************************************************/ + [Description("Extracts all types valid in BHoM.")] + [Output("items", "All types valid in BHoM.")] public static IEnumerable TypeItems() { return Engine.Reflection.Query.BHoMTypeList() - .Concat(Engine.Reflection.Query.BHoMInterfaceList()) + .Concat(Engine.Reflection.Query.BHoMInterfaceTypeList()) .Concat(new List { typeof(Type), typeof(Enum), typeof(object), typeof(bool), typeof(byte), typeof(char), typeof(string), @@ -127,6 +148,8 @@ public static IEnumerable TypeItems() /***************************************************/ + [Description("Extracts all types that have a valid public constructor.")] + [Output("items", "All types that have a valid public constructor.")] public static IEnumerable ConstructableTypeItems() { return Engine.Reflection.Query.BHoMTypeList() @@ -136,6 +159,8 @@ public static IEnumerable ConstructableTypeItems() /***************************************************/ + [Description("Extracts all enum types valid in BHoM.")] + [Output("items", "All enum types valid in BHoM.")] public static IEnumerable EnumItems() { return Engine.Reflection.Query.BHoMEnumList() @@ -144,6 +169,8 @@ public static IEnumerable EnumItems() /***************************************************/ + [Description("Extracts names of all BHoM library items.")] + [Output("items", "Names of all BHoM library items.")] public static List LibraryItems() { return Engine.Library.Query.LibraryNames().ToList(); @@ -151,6 +178,8 @@ public static List LibraryItems() /***************************************************/ + [Description("Extracts all external methods in BHoM.")] + [Output("items", "All external methods in BHoM.")] public static List ExternalItems() { return Engine.Reflection.Query.ExternalMethodList();