Skip to content

Commit 783f2ad

Browse files
committed
Documented the ViewModels
Typically, we don't document view models, since they're meant to be quick and easy to program, and usually the properties are self-explanatory. That said, since the `Ignia.Topics.ViewModels` collection represents a fairly stable and semi-permanent set of view models, which will be used by most implementations of **OnTopic**, it makes sense to provide documentation, not only for any generated reference documentation we may produce in the future, but also to provide an aid in IDEs (e.g., for _Intellisense_, for users of **Visual Studio**).
1 parent 3bd681d commit 783f2ad

8 files changed

Lines changed: 159 additions & 0 deletions

Ignia.Topics.ViewModels/ContentItemTopicViewModel.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,36 @@ namespace Ignia.Topics.ViewModels {
1919
/// </remarks>
2020
public class ContentItemTopicViewModel: ItemTopicViewModel {
2121

22+
/*==========================================================================================================================
23+
| DESCRIPTION
24+
\-------------------------------------------------------------------------------------------------------------------------*/
25+
/// <summary>
26+
/// Gets the description; for Content Items, this is effectively the body.
27+
/// </summary>
2228
public string Description { get; set; } = default!;
29+
30+
/*==========================================================================================================================
31+
| LEARN MORE URL
32+
\-------------------------------------------------------------------------------------------------------------------------*/
33+
/// <summary>
34+
/// Gets an optional URL for additional information that should be linked to.
35+
/// </summary>
2336
public string? LearnMoreUrl { get; set; }
37+
38+
/*==========================================================================================================================
39+
| THUMBNAIL IMAGE
40+
\-------------------------------------------------------------------------------------------------------------------------*/
41+
/// <summary>
42+
/// Gets an optional path to a thumbnail image that should accompany the content item.
43+
/// </summary>
2444
public string? ThumbnailImage { get; set; }
45+
46+
/*==========================================================================================================================
47+
| CATEGORY
48+
\-------------------------------------------------------------------------------------------------------------------------*/
49+
/// <summary>
50+
/// Gets the category that the content item should be grouped under.
51+
/// </summary>
2552
public string? Category { get; set; }
2653

2754
} //Class

Ignia.Topics.ViewModels/ContentListTopicViewModel.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,21 @@ namespace Ignia.Topics.ViewModels {
1919
/// </remarks>
2020
public class ContentListTopicViewModel: PageTopicViewModel {
2121

22+
/*==========================================================================================================================
23+
| CONTENT ITEMS
24+
\-------------------------------------------------------------------------------------------------------------------------*/
25+
/// <summary>
26+
/// Provides a list of <see cref="ContentItemTopicViewModel"/>, representing the contents of the <see
27+
/// cref="ContentListTopicViewModel"/>.
28+
/// </summary>
2229
public TopicViewModelCollection<ContentItemTopicViewModel> ContentItems { get; } = new TopicViewModelCollection<ContentItemTopicViewModel>();
30+
31+
/*==========================================================================================================================
32+
| CATEGORIES
33+
\-------------------------------------------------------------------------------------------------------------------------*/
34+
/// <summary>
35+
/// Provides a list of valid categories that each of the <see cref="ContentItems"/> may optionally be associated with.
36+
/// </summary>
2337
public TopicViewModelCollection<TopicViewModel> Categories { get; } = new TopicViewModelCollection<TopicViewModel>();
2438

2539
} //Class

Ignia.Topics.ViewModels/NavigationTopicViewModel.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,29 @@ namespace Ignia.Topics.ViewModels {
3030
/// </remarks>
3131
public sealed class NavigationTopicViewModel : TopicViewModel, INavigationTopicViewModel<NavigationTopicViewModel> {
3232

33+
/*==========================================================================================================================
34+
| SHORT TITLE
35+
\-------------------------------------------------------------------------------------------------------------------------*/
36+
/// <summary>
37+
/// Provides a short title to be used in the navigation, for cases where the normal title is too long.
38+
/// </summary>
3339
public string? ShortTitle { get; set; }
40+
41+
/*==========================================================================================================================
42+
| CHILDREN
43+
\-------------------------------------------------------------------------------------------------------------------------*/
44+
/// <summary>
45+
/// Provides a list of nested <see cref="NavigationTopicViewModel"/> objects, for handling hierarchical navigation.
46+
/// </summary>
3447
public Collection<NavigationTopicViewModel> Children { get; } = new Collection<NavigationTopicViewModel>();
48+
49+
/*==========================================================================================================================
50+
| IS SELECTED?
51+
\-------------------------------------------------------------------------------------------------------------------------*/
52+
/// <summary>
53+
/// Determines whether or not the node represented by this <see cref="NavigationTopicViewModel"/> is currently selected,
54+
/// typically meaning the user is on the page this object is pointing to.
55+
/// </summary>
3556
public bool IsSelected(string uniqueKey) =>
3657
$"{uniqueKey}:"?.StartsWith($"{UniqueKey}:", StringComparison.InvariantCultureIgnoreCase) ?? false;
3758

Ignia.Topics.ViewModels/PageTopicViewModel.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,50 @@ namespace Ignia.Topics.ViewModels {
2020
/// </remarks>
2121
public class PageTopicViewModel: TopicViewModel, IPageTopicViewModel {
2222

23+
/*==========================================================================================================================
24+
| SUBTITLE
25+
\-------------------------------------------------------------------------------------------------------------------------*/
26+
/// <summary>
27+
/// Provides an optional subtitle which will typically be displayed under the title.
28+
/// </summary>
2329
public string? Subtitle { get; set; }
2430

31+
/*==========================================================================================================================
32+
| META TITLE
33+
\-------------------------------------------------------------------------------------------------------------------------*/
34+
/// <summary>
35+
/// Provides an optional title to be used in page's metadata, if it differs from the <see cref="TopicViewModel.Title"/>.
36+
/// </summary>
2537
public string? MetaTitle { get; set; }
2638

39+
/*==========================================================================================================================
40+
| META DESCRIPTION
41+
\-------------------------------------------------------------------------------------------------------------------------*/
2742
/// <inheritdoc />
2843
public string? MetaDescription { get; set; }
2944

45+
/*==========================================================================================================================
46+
| META KEYWORDS
47+
\-------------------------------------------------------------------------------------------------------------------------*/
3048
/// <inheritdoc />
3149
public string? MetaKeywords { get; set; }
3250

3351
public bool? NoIndex { get; set; }
3452

53+
/*==========================================================================================================================
54+
| SHORT TITLE
55+
\-------------------------------------------------------------------------------------------------------------------------*/
56+
/// <summary>
57+
/// Provides a short title to be used in the navigation, for cases where the normal title is too long.
58+
/// </summary>
3559
public string? ShortTitle { get; set; }
3660

61+
/*==========================================================================================================================
62+
| BODY
63+
\-------------------------------------------------------------------------------------------------------------------------*/
64+
/// <summary>
65+
/// Provides the primary content for the page, which is typically in HTML format.
66+
/// </summary>
3767
public string? Body { get; set; }
3868

3969
} //Class

Ignia.Topics.ViewModels/SectionTopicViewModel.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ namespace Ignia.Topics.ViewModels {
1919
/// </remarks>
2020
public class SectionTopicViewModel : TopicViewModel {
2121

22+
/*==========================================================================================================================
23+
| HEADER IMAGE
24+
\-------------------------------------------------------------------------------------------------------------------------*/
25+
/// <summary>
26+
/// Provides a header image which may be displayed at the top of a section.
27+
/// </summary>
2228
public string? HeaderImageUrl { get; set; }
2329

2430
} //Class

Ignia.Topics.ViewModels/SlideshowTopicViewModel.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ namespace Ignia.Topics.ViewModels {
1919
/// </remarks>
2020
public class SlideshowTopicViewModel: ContentListTopicViewModel {
2121

22+
/*==========================================================================================================================
23+
| TRANSITION EFFECT
24+
\-------------------------------------------------------------------------------------------------------------------------*/
25+
/// <summary>
26+
/// Provides the transition effect to use when flipping between slides.
27+
/// </summary>
28+
/// <remarks>
29+
/// The effective values for <see cref="TransitionEffect"/> are dependent on the library used for presenting the
30+
/// slideshow. Typically, they will map to standard HTML5/CSS3 transition effects, but they could differ depending on the
31+
/// implementation.
32+
/// </remarks>
2233
public string? TransitionEffect { get; set; }
2334

2435
} //Class

Ignia.Topics.ViewModels/TopicViewModel.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,69 @@ namespace Ignia.Topics.ViewModels {
2222
/// </remarks>
2323
public class TopicViewModel: ITopicViewModel {
2424

25+
/*==========================================================================================================================
26+
| ID
27+
\-------------------------------------------------------------------------------------------------------------------------*/
2528
/// <inheritdoc />
2629
public int Id { get; set; }
2730

31+
/*==========================================================================================================================
32+
| KEY
33+
\-------------------------------------------------------------------------------------------------------------------------*/
2834
/// <inheritdoc />
2935
public string? Key { get; set; }
3036

37+
/*==========================================================================================================================
38+
| CONTENT TYPE
39+
\-------------------------------------------------------------------------------------------------------------------------*/
3140
/// <inheritdoc />
3241
public string? ContentType { get; set; }
3342

43+
/*==========================================================================================================================
44+
| UNIQUE KEY
45+
\-------------------------------------------------------------------------------------------------------------------------*/
3446
/// <inheritdoc />
3547
public string? UniqueKey { get; set; }
3648

49+
/*==========================================================================================================================
50+
| WEB PATH
51+
\-------------------------------------------------------------------------------------------------------------------------*/
3752
/// <inheritdoc />
3853
public string? WebPath { get; set; }
3954

55+
/*==========================================================================================================================
56+
| VIEW
57+
\-------------------------------------------------------------------------------------------------------------------------*/
4058
/// <inheritdoc />
4159
public string? View { get; set; }
4260

61+
/*==========================================================================================================================
62+
| TITLE
63+
\-------------------------------------------------------------------------------------------------------------------------*/
4364
/// <inheritdoc />
4465
public string? Title { get; set; }
4566

67+
/*==========================================================================================================================
68+
| IS HIDDEN?
69+
\-------------------------------------------------------------------------------------------------------------------------*/
4670
/// <inheritdoc />
4771
public bool IsHidden { get; set; }
4872

4973
public DateTime LastModified { get; set; }
5074

75+
/*==========================================================================================================================
76+
| PARENT
77+
\-------------------------------------------------------------------------------------------------------------------------*/
78+
/// <summary>
79+
/// Provides a reference to the parent <see cref="TopicViewModel"/> in the topic hierarchy.
80+
/// </summary>
81+
/// <remarks>
82+
/// If the current <see cref="TopicViewModel"/> is being mapped as part of another <see cref="TopicViewModel"/>, then the
83+
/// <see cref="Parent"/> property will only be mapped if that relationship includes a <see cref="FollowAttribute"/>
84+
/// with a value including <see cref="Relationships.Parents"/>. If it does, all <see cref="Parent"/> topics will be mapped
85+
/// up to the root of the site. No other relationships on the <see cref="Parent"/> view models will be mapped, even if
86+
/// they are annotated with a <see cref="FollowAttribute"/>.
87+
/// </remarks>
5188
[Follow(Relationships.Parents)]
5289
public TopicViewModel? Parent { get; set; }
5390

Ignia.Topics.ViewModels/VideoTopicViewModel.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,20 @@ namespace Ignia.Topics.ViewModels {
1919
/// </remarks>
2020
public class VideoTopicViewModel: PageTopicViewModel {
2121

22+
/*==========================================================================================================================
23+
| VIDEO URL
24+
\-------------------------------------------------------------------------------------------------------------------------*/
25+
/// <summary>
26+
/// Provides a URL reference to a video to display on the page.
27+
/// </summary>
2228
public string? VideoUrl { get; set; }
29+
30+
/*==========================================================================================================================
31+
| POSTER URL
32+
\-------------------------------------------------------------------------------------------------------------------------*/
33+
/// <summary>
34+
/// Provides a URL reference to an image to display prior to playing the video.
35+
/// </summary>
2336
public string? PosterUrl { get; set; }
2437

2538
} //Class

0 commit comments

Comments
 (0)