This commit is contained in:
2020-03-12 19:48:12 +00:00
parent 2cf681d7d7
commit e0b5ea0dc3
6 changed files with 34 additions and 26 deletions

View File

@@ -81,7 +81,7 @@ namespace AyaNova.Api.Controllers
foreach (AyaType t in values) foreach (AyaType t in values)
{ {
string name = t.ToString(); string name = t.ToString();
if (t.HasAttribute(typeof(AttachableAttribute))) if (t.HasAttribute(typeof(CoreBizObjectAttribute)))
{ {
name += " [Attachable]"; name += " [Attachable]";
} }

View File

@@ -11,10 +11,12 @@ namespace AyaNova.PickList
//Instantiate list object specified from type //Instantiate list object specified from type
internal static IAyaPickList GetAyaPickList(AyaType ayaType) internal static IAyaPickList GetAyaPickList(AyaType ayaType)
{ {
switch(ayaType){ switch (ayaType)
case AyaType.Widget: {
return new WidgetPickList() as IAyaDataList; case AyaType.Widget:
} return new WidgetPickList() as IAyaPickList;
}
return null;
} }
//List all the datalist types available //List all the datalist types available

View File

@@ -1,15 +0,0 @@
using System;
namespace AyaNova.Biz
{
/// <summary>
/// Marker attribute indicating that an object supports attachments
/// Used in <see cref="AyaType"/>
/// </summary>
[AttributeUsage(AttributeTargets.All)]
public class AttachableAttribute : Attribute
{
//No code required, it's just a marker
//https://docs.microsoft.com/en-us/dotnet/standard/attributes/writing-custom-attributes
}
}//eons

View File

@@ -1,27 +1,26 @@
namespace AyaNova.Biz namespace AyaNova.Biz
{ {
/// <summary> /// <summary>
/// All AyaNova types and their attributes indicating what features that type will support (tagging, attachments etc) /// All AyaNova types and their attributes indicating what features that type will support (tagging, attachments etc)
/// </summary> /// </summary>
public enum AyaType : int public enum AyaType : int
{ {
//COREBIZOBJECT attribute must be set on objects that are:
//Attachable objects can have attachments, //Attachable objects can have attachments,
//wikiable objects can have a wiki //wikiable objects can have a wiki
//reviewable objects can have a review which is basically the same as a Reminder but with an object attached (was follow up schedmarker in v7) //reviewable objects can have a review which is basically the same as a Reminder but with an object attached (was follow up schedmarker in v7)
//PIckList-able (has picklist template)
//Pretty much everything that represents some kind of real world object is wikiable or attachable as long as it has an ID and a type //Pretty much everything that represents some kind of real world object is wikiable or attachable as long as it has an ID and a type
//exceptions would be utility type objects like datalistview, formcustom etc that are not //exceptions would be utility type objects like datalistview, formcustom etc that are not
NoType = 0, NoType = 0,
Global = 1, Global = 1,
[Attachable] [CoreBizObject]
Widget = 2,//attachable, wikiable, reviewable Widget = 2,//attachable, wikiable, reviewable
[Attachable] [CoreBizObject]
User = 3,//attachable, wikiable, reviewable User = 3,//attachable, wikiable, reviewable
ServerState = 4, ServerState = 4,

View File

@@ -95,7 +95,7 @@ namespace AyaNova.Biz
{ {
get get
{ {
return this.ObjectType.HasAttribute(typeof(AttachableAttribute)); return this.ObjectType.HasAttribute(typeof(CoreBizObjectAttribute));
} }
} }

View File

@@ -0,0 +1,22 @@
using System;
namespace AyaNova.Biz
{
/// <summary>
/// Marker attribute indicating that an object is a core business object
/// In other words a real world business relevant object and not a utility or internal type of object
/// something that would be worked with by users in the UI for business purposes
/// This is used to indicate that an object supports these features:
/// PickList selectable (has picklist)
/// Attachable (can attach to it)
/// Reviewable (can set a review on it)
/// ETC
/// Used in <see cref="AyaType"/>
/// </summary>
[AttributeUsage(AttributeTargets.All)]
public class CoreBizObjectAttribute : Attribute
{
//No code required, it's just a marker
//https://docs.microsoft.com/en-us/dotnet/standard/attributes/writing-custom-attributes
}
}//eons