eina_mono: Initialize UNHANDLED_EXCEPTION inline
authorYeongjong Lee <yj34.lee@samsung.com>
Thu, 24 Oct 2019 21:24:07 +0000 (18:24 -0300)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 11 Nov 2019 02:20:38 +0000 (11:20 +0900)
Summary:
fix CA2207
ref T8427

Test Plan:
meson setup -Dbindings=mono,cxx -Dmono-beta=true
ninja test

Reviewers: lauromoura, felipealmeida, brunobelo

Reviewed By: lauromoura

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8427

Differential Revision: https://phab.enlightenment.org/D10463

src/bindings/mono/eina_mono/eina_error.cs

index ea73ee5..5c4ac93 100644 (file)
@@ -41,7 +41,7 @@ public struct Error : IComparable<Error>
     /// Unhandled Exception error identifier.
     /// <para>Since EFL 1.23.</para>
     /// </summary>
-    public static readonly Error UNHANDLED_EXCEPTION;
+    public static readonly Error UNHANDLED_EXCEPTION = eina_error_msg_register("Unhandled C# exception occurred.");
 
     /// <summary>
     /// No error identifier.
@@ -115,11 +115,6 @@ public struct Error : IComparable<Error>
         return "Eina.Error(" + code + ")";
     }
 
-    static Error()
-    {
-        UNHANDLED_EXCEPTION = eina_error_msg_register("Unhandled C# exception occurred.");
-    }
-
     [DllImport(efl.Libs.Eina)] static extern Error eina_error_msg_register(string msg);
     [DllImport(efl.Libs.Eina)] static extern Error eina_error_get();
     [DllImport(efl.Libs.Eina)] static extern void eina_error_set(Error error);