diff options
| author | Peter Maar <alset333@icloud.com> | 2020-03-19 22:02:08 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-19 22:02:08 -0400 |
| commit | adbf375efe44a5866a277ff2d7720c0ced6597b2 (patch) | |
| tree | e89e50745ed8288b7bbd388018ed7669e449fee9 /MediaBrowser.Model/Drawing/ImageDimensions.cs | |
| parent | 818695a01e007ce507d4518aefc520870989964d (diff) | |
| parent | af5d3e8eaeea6cd1c2e9248352a2e728d27b3c22 (diff) | |
Merge pull request #1 from jellyfin/master
Pull latest to my fork
Diffstat (limited to 'MediaBrowser.Model/Drawing/ImageDimensions.cs')
| -rw-r--r-- | MediaBrowser.Model/Drawing/ImageDimensions.cs | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/MediaBrowser.Model/Drawing/ImageDimensions.cs b/MediaBrowser.Model/Drawing/ImageDimensions.cs index e7805ac49..f84fe6830 100644 --- a/MediaBrowser.Model/Drawing/ImageDimensions.cs +++ b/MediaBrowser.Model/Drawing/ImageDimensions.cs @@ -1,36 +1,45 @@ +#pragma warning disable CS1591 + +using System.Globalization; + namespace MediaBrowser.Model.Drawing { /// <summary> - /// Struct ImageDimensions + /// Struct ImageDimensions. /// </summary> - public struct ImageDimensions + public readonly struct ImageDimensions { + public ImageDimensions(int width, int height) + { + Width = width; + Height = height; + } + /// <summary> - /// Gets or sets the height. + /// Gets the height. /// </summary> /// <value>The height.</value> - public int Height { get; set; } + public int Height { get; } /// <summary> - /// Gets or sets the width. + /// Gets the width. /// </summary> /// <value>The width.</value> - public int Width { get; set; } + public int Width { get; } public bool Equals(ImageDimensions size) { return Width.Equals(size.Width) && Height.Equals(size.Height); } + /// <inheritdoc /> public override string ToString() { - return string.Format("{0}-{1}", Width, Height); - } - - public ImageDimensions(int width, int height) - { - Width = width; - Height = height; + return string.Format( + CultureInfo.InvariantCulture, + "{0}-{1}", + Width, + Height); } } } |
