-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEditorViewModelLookupService.cs
More file actions
38 lines (34 loc) · 2.2 KB
/
EditorViewModelLookupService.cs
File metadata and controls
38 lines (34 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*==============================================================================================================================
| Author Ignia, LLC
| Client Ignia, LLC
| Project Topics Library
\=============================================================================================================================*/
using OnTopic.Lookup;
namespace OnTopic.Editor.AspNetCore.Infrastructure {
/*============================================================================================================================
| CLASS: EDITOR VIEW MODEL LOOKUP SERVICE
\---------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Dynamically looks up all view models associated with attribute type plugins.
/// </summary>
/// <remarks>
/// Each OnTopic Editor attribute type plugin includes a view model derived from <see cref="ContentTypeDescriptorViewModel"
/// /> and another derive from <see cref="AttributeDescriptorViewModel"/>. The latter is responsible for exposing not only
/// the attribute configuration, but also for registered any client-side resources that the attribute type's view will
/// depend upon. The <see cref="EditorViewModelLookupService"/> will discover these regardless of what assembly they're
/// located in, thus providing support for both first-party and third-party plugins.
/// </remarks>
public class EditorViewModelLookupService: DynamicTypeLookupService {
/*==========================================================================================================================
| CONSTRUCTOR
\-------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Instantiates a new instance of the <see cref="EditorViewModelLookupService"/>.
/// </summary>
/// <returns>A new instance of the <see cref="EditorViewModelLookupService"/>.</returns>
public EditorViewModelLookupService() : base(t =>
typeof(ContentTypeDescriptorViewModel).IsAssignableFrom(t) ||
typeof(AttributeDescriptorViewModel).IsAssignableFrom(t)
) { }
} //Class
} //Namespace