< Summary - ReFlex - Library

Information
Class: ReFlex.Core.Common.Util.StreamParameter
Assembly: ReFlex.Core.Common
File(s): D:\a\reflex\reflex\library\src\Core\Common\Util\StreamParameter.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 22
Coverable lines: 22
Total lines: 94
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 10
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Name()100%210%
get_Width()100%210%
get_Height()100%210%
get_Framerate()100%210%
get_Format()100%210%
get_Description()100%210%
.ctor(...)100%210%
Equals(...)0%7280%
ToString()0%620%

File(s)

D:\a\reflex\reflex\library\src\Core\Common\Util\StreamParameter.cs

#LineLine coverage
 1using System;
 2using System.ComponentModel;
 3using System.Configuration;
 4using Newtonsoft.Json;
 5
 6namespace ReFlex.Core.Common.Util
 7{
 8    /// <inheritdoc />
 9    /// <summary>
 10    /// </summary>
 11    [TypeConverter(typeof(StreamParameterConverter))]
 12    [SettingsSerializeAs(SettingsSerializeAs.String)]
 13    [JsonConverter(typeof(DisableTypeConverterJsonConverter<StreamParameter>))]
 14    public class StreamParameter : IEquatable<StreamParameter>
 15    {
 16        /// <summary>
 17        /// The name to distinguish similar Parameters
 18        /// </summary>
 019        public string Name { get; }
 20
 21        /// <summary>
 22        /// The horizontal resolution
 23        /// </summary>
 024        public int Width { get; }
 25
 26        /// <summary>
 27        /// The vertical resolution
 28        /// </summary>
 029        public int Height { get; }
 30
 31        /// <summary>
 32        /// The frame rate
 33        /// </summary>
 034        public int Framerate { get; }
 35
 036        public DepthImageFormat Format { get; }
 37
 38        /// <summary>
 39        /// Gets the description.
 40        /// </summary>
 41        /// <value>
 42        /// The description.
 43        /// </value>
 44        [JsonIgnore]
 045        public string Description => ToString();
 46
 47        /// <summary>
 48        /// Initializes a new instance of the <see cref="StreamParameter"/> class.
 49        /// </summary>
 50        /// <param name="width">The horizontal resolution.</param>
 51        /// <param name="height">The vertical resolution.</param>
 52        /// <param name="framerate">The frame rate.</param>
 53        /// <param name="name">(Optional) name, to distinguish different parameters with equal specification (e.g. for r
 054        public StreamParameter(int width, int height, int framerate, DepthImageFormat format = DepthImageFormat.Rgb24bpp
 055        {
 056            Name = name;
 057            Width = width;
 058            Height = height;
 059            Framerate = framerate;
 060            Format = format;
 061            Name = name;
 062        }
 63
 64        #region methods
 65
 66        /// <summary>
 67        /// Gibt an, ob das aktuelle Objekt gleich einem anderen Objekt des gleichen Typs ist.
 68        /// </summary>
 69        /// <param name="other">Ein Objekt, das mit diesem Objekt verglichen werden soll.</param>
 70        /// <returns>
 71        ///   <see langword="true" />, wenn das aktuelle Objekt gleich dem <paramref name="other" />-Parameter ist, ande
 72        /// </returns>
 73        /// <inheritdoc />
 74        public bool Equals(StreamParameter other)
 075            => other != null && other.Name == Name && Width == other.Width && Height == other.Height && Framerate == oth
 76
 77        /// <summary>
 78        /// Returns a <see cref="string" /> that represents [this] instance.
 79        /// </summary>
 80        /// <returns>
 81        /// A <see cref="string" /> that represents [this] instance.
 82        /// </returns>
 83        public override string ToString()
 084        {
 085            var desc = $"{Width} x {Height} x {Framerate}";
 086            if (!string.IsNullOrWhiteSpace(Name))
 087                desc = $"{Name}: ({desc})";
 88
 089            return desc;
 090        }
 91
 92        #endregion
 93    }
 94}