@@ -10,7 +10,7 @@ namespace AngleSharp.Css.Dom
10
10
/// Represents a medium rule. More information available at:
11
11
/// http://www.w3.org/TR/css3-mediaqueries/
12
12
/// </summary>
13
- sealed class CssMedium : ICssMedium
13
+ public sealed class CssMedium : ICssMedium
14
14
{
15
15
#region Fields
16
16
@@ -23,11 +23,24 @@ sealed class CssMedium : ICssMedium
23
23
24
24
#region ctor
25
25
26
+ /// <summary>
27
+ /// Creates a new CSS medium.
28
+ /// </summary>
29
+ /// <param name="type">The type of the media rule.</param>
30
+ /// <param name="inverse">Specifies if it should be inverted.</param>
31
+ /// <param name="exclusive">Specifies if the rule is exclusive.</param>
26
32
public CssMedium ( String type , Boolean inverse , Boolean exclusive )
27
33
: this ( type , inverse , exclusive , Enumerable . Empty < IMediaFeature > ( ) )
28
34
{
29
35
}
30
36
37
+ /// <summary>
38
+ /// Creates a new CSS medium.
39
+ /// </summary>
40
+ /// <param name="type">The type of the media rule.</param>
41
+ /// <param name="inverse">Specifies if it should be inverted.</param>
42
+ /// <param name="exclusive">Specifies if the rule is exclusive.</param>
43
+ /// <param name="features">The features of the medium.</param>
31
44
public CssMedium ( String type , Boolean inverse , Boolean exclusive , IEnumerable < IMediaFeature > features )
32
45
{
33
46
_features = new List < IMediaFeature > ( features ) ;
@@ -40,20 +53,36 @@ public CssMedium(String type, Boolean inverse, Boolean exclusive, IEnumerable<IM
40
53
41
54
#region Properties
42
55
56
+ /// <summary>
57
+ /// Gets the feature demands (constraints) of the medium.
58
+ /// </summary>
43
59
public IEnumerable < IMediaFeature > Features => _features ;
44
60
61
+ /// <summary>
62
+ /// Gets the type of the medium.
63
+ /// </summary>
45
64
public String Type => _type ;
46
65
66
+ /// <summary>
67
+ /// Gets if the medium is exclusive to other media.
68
+ /// </summary>
47
69
public Boolean IsExclusive => _exclusive ;
48
70
71
+ /// <summary>
72
+ /// Gets if the medium should be inverted.
73
+ /// </summary>
49
74
public Boolean IsInverse => _inverse ;
50
75
76
+ /// <summary>
77
+ /// Gets the constraints - i.e., the stringified features.
78
+ /// </summary>
51
79
public String Constraints => String . Join ( " and " , Features . Select ( m => m . ToCss ( ) ) ) ;
52
80
53
81
#endregion
54
82
55
83
#region Methods
56
84
85
+ /// <inheritdoc />
57
86
public override Boolean Equals ( Object obj )
58
87
{
59
88
var other = obj as CssMedium ;
@@ -80,8 +109,12 @@ public override Boolean Equals(Object obj)
80
109
return false ;
81
110
}
82
111
112
+ /// <inheritdoc />
83
113
public override Int32 GetHashCode ( ) => base . GetHashCode ( ) ;
84
114
115
+ /// <summary>
116
+ /// Writes the medium as CSS.
117
+ /// </summary>
85
118
public void ToCss ( TextWriter writer , IStyleFormatter formatter )
86
119
{
87
120
var offset = 0 ;
0 commit comments