-
Notifications
You must be signed in to change notification settings - Fork 0
/
PresentationPrimitives.fs
85 lines (73 loc) 路 2.72 KB
/
PresentationPrimitives.fs
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
namespace Songhay.Modules.Publications.Models
open System
open Songhay.Modules.Models
open Songhay.Modules.Publications.Models
/// <summary>
/// Defines Publication copyright
/// </summary>
type Copyright =
{
///<summary>The Copyright year.</summary>
year: int
///<summary>The Copyright name.</summary>
name: string
}
///<summary>Returns the <see cref="string" /> representation of this instance.</summary>
override this.ToString() = $"漏{this.year} {this.name}"
/// <summary>
/// Defines Publication description
/// </summary>
type Description =
///<summary>Publication description.</summary>
| Description of DisplayText
///<summary>Returns the <see cref="string" /> representation of this instance.</summary>
override this.ToString() = match this with Description dt -> dt.Value
/// <summary>
/// Defines Publication credits
/// </summary>
type RoleCredit =
{
///<summary>Publication credits role.</summary>
role: string
///<summary>Publication credits name.</summary>
name: string
}
///<summary>Returns the <see cref="string" /> representation of this instance.</summary>
override this.ToString() = $"{nameof(this.role)}:{this.role}; {nameof(this.name)}:{this.name}"
/// <summary>
/// Defines Publication stream segments
/// </summary>
type StreamSegment =
{
///<summary>Publication stream segment identifier.</summary>
id: Id
///<summary>Publication stream segment thumbnail.</summary>
thumbnailUri: Uri
}
/// <summary>
/// Defines <see cref="Presentation"/> parts
/// </summary>
type PresentationPart =
///<summary><see cref="Presentation"/> copyright.</summary>
| CopyRights of Copyright list
///<summary><see cref="Presentation"/> credits.</summary>
| Credits of RoleCredit list
///<summary><see cref="Presentation"/> description.</summary>
| PresentationDescription of string
///<summary><see cref="Presentation"/> pages.</summary>
| Pages of string list
///<summary><see cref="Presentation"/> playlist.</summary>
| Playlist of (DisplayText * Uri) list
///<summary><see cref="Presentation"/> stream.</summary>
| Stream of StreamSegment list
///<summary>Returns the <see cref="string" /> representation of this instance.</summary>
member this.StringValue =
match this with
| _ -> this.ToString()
///<summary>Returns the <see cref="string" /> collection representation of this instance.</summary>
member this.StringValues =
match this with
| CopyRights l -> l |> List.map (fun i -> i.ToString())
| Pages l -> l
| Playlist l -> l |> List.map (fun (dt, _) -> dt.Value)
| _ -> [this.ToString()]