@@ -10,7 +10,7 @@ namespace AngleSharp.Css.Dom
1010 /// Represents a medium rule. More information available at:
1111 /// http://www.w3.org/TR/css3-mediaqueries/
1212 /// </summary>
13- sealed class CssMedium : ICssMedium
13+ public sealed class CssMedium : ICssMedium
1414 {
1515 #region Fields
1616
@@ -23,11 +23,24 @@ sealed class CssMedium : ICssMedium
2323
2424 #region ctor
2525
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>
2632 public CssMedium ( String type , Boolean inverse , Boolean exclusive )
2733 : this ( type , inverse , exclusive , Enumerable . Empty < IMediaFeature > ( ) )
2834 {
2935 }
3036
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>
3144 public CssMedium ( String type , Boolean inverse , Boolean exclusive , IEnumerable < IMediaFeature > features )
3245 {
3346 _features = new List < IMediaFeature > ( features ) ;
@@ -40,20 +53,36 @@ public CssMedium(String type, Boolean inverse, Boolean exclusive, IEnumerable<IM
4053
4154 #region Properties
4255
56+ /// <summary>
57+ /// Gets the feature demands (constraints) of the medium.
58+ /// </summary>
4359 public IEnumerable < IMediaFeature > Features => _features ;
4460
61+ /// <summary>
62+ /// Gets the type of the medium.
63+ /// </summary>
4564 public String Type => _type ;
4665
66+ /// <summary>
67+ /// Gets if the medium is exclusive to other media.
68+ /// </summary>
4769 public Boolean IsExclusive => _exclusive ;
4870
71+ /// <summary>
72+ /// Gets if the medium should be inverted.
73+ /// </summary>
4974 public Boolean IsInverse => _inverse ;
5075
76+ /// <summary>
77+ /// Gets the constraints - i.e., the stringified features.
78+ /// </summary>
5179 public String Constraints => String . Join ( " and " , Features . Select ( m => m . ToCss ( ) ) ) ;
5280
5381 #endregion
5482
5583 #region Methods
5684
85+ /// <inheritdoc />
5786 public override Boolean Equals ( Object obj )
5887 {
5988 var other = obj as CssMedium ;
@@ -80,8 +109,12 @@ public override Boolean Equals(Object obj)
80109 return false ;
81110 }
82111
112+ /// <inheritdoc />
83113 public override Int32 GetHashCode ( ) => base . GetHashCode ( ) ;
84114
115+ /// <summary>
116+ /// Writes the medium as CSS.
117+ /// </summary>
85118 public void ToCss ( TextWriter writer , IStyleFormatter formatter )
86119 {
87120 var offset = 0 ;
0 commit comments