[NUI] Fix CA1066
authorDaekwang Ryu <dkdk.ryu@samsung.com>
Mon, 14 Dec 2020 05:23:05 +0000 (14:23 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 21 Dec 2020 12:05:23 +0000 (21:05 +0900)
CA1066:Implement IEquatable when overriding Equals

src/Tizen.NUI/src/internal/Xaml/XmlName.cs
src/Tizen.NUI/src/public/Layouting/LayoutLength.cs

index cbeeab8..056189d 100755 (executable)
@@ -1,9 +1,10 @@
+using System;
 using System.Diagnostics;
 
 namespace Tizen.NUI.Xaml
 {
     [DebuggerDisplay("{NamespaceURI}:{LocalName}")]
-    internal struct XmlName
+    internal struct XmlName : IEquatable<XmlName>
     {
         public static readonly XmlName _CreateContent = new XmlName("_", "CreateContent");
         public static readonly XmlName xKey = new XmlName("x", "Key");
@@ -33,6 +34,9 @@ namespace Tizen.NUI.Xaml
             return NamespaceURI == other.NamespaceURI && LocalName == other.LocalName;
         }
 
+        public bool Equals(XmlName other)
+            => NamespaceURI == other.NamespaceURI && LocalName == other.LocalName;
+
         public bool Equals(string namespaceUri, string localName)
             => Equals(new XmlName(namespaceUri, localName));
 
index 51804b5..705d1cc 100755 (executable)
@@ -24,7 +24,7 @@ namespace Tizen.NUI
     /// <summary>
     /// [Draft] A type that represents a layout length. Currently, this implies pixels, but could be extended to handle device dependant sizes, etc.
     /// </summary>
-    public struct LayoutLength
+    public struct LayoutLength : IEquatable<LayoutLength>
     {
         private float _value;