-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstructionViewComponent.cs
More file actions
42 lines (37 loc) · 2.15 KB
/
InstructionViewComponent.cs
File metadata and controls
42 lines (37 loc) · 2.15 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
39
40
41
42
/*==============================================================================================================================
| Author Ignia, LLC
| Client Ignia, LLC
| Project Topics Library
\=============================================================================================================================*/
namespace OnTopic.Editor.AspNetCore.Attributes.InstructionAttribute {
/*============================================================================================================================
| CLASS: INSTRUCTION (VIEW COMPONENT)
\---------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Delivers a view model for an instruction attribute type.
/// </summary>
public class InstructionViewComponent: ViewComponent {
/*==========================================================================================================================
| CONSTRUCTOR
\-------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Initializes a new instance of a <see cref="InstructionViewComponent"/> with necessary dependencies.
/// </summary>
/// <returns>A topic <see cref="InstructionViewComponent"/>.</returns>
public InstructionViewComponent() : base() { }
/*==========================================================================================================================
| METHOD: INVOKE
\-------------------------------------------------------------------------------------------------------------------------*/
/// <summary>
/// Assembles the view model for the <see cref="InstructionViewComponent"/>.
/// </summary>
public IViewComponentResult Invoke(
EditingTopicViewModel currentTopic,
InstructionAttributeDescriptorViewModel attribute,
string htmlFieldPrefix
) {
ViewData.TemplateInfo.HtmlFieldPrefix = htmlFieldPrefix;
return View(new AttributeViewModel<InstructionAttributeDescriptorViewModel>(currentTopic, attribute));
}
} // Class
} // Namespace