From 0801132af389609cefd224e0d942d8de39f8fabb Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Mon, 6 Jan 2020 19:07:28 +0900 Subject: [PATCH] eolian_mono: add namespace to extension methods of ItemFactory Summary: Like other classes and methods, the classes and methods for extension methods of ItemFactory are moved inside the namespace. Consequently, the namespace in the class name for extension methods is removed to avoid duplicate namespace name. Reviewers: lauromoura, felipealmeida, YOhoho, woohyun Reviewed By: YOhoho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10972 --- src/bin/eolian_mono/eolian/mono/klass.hh | 10 ++++++++-- src/tests/efl_mono/Model.cs | 1 + src/tests/efl_mono/Parts.cs | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh index 8656178..cc32e82 100644 --- a/src/bin/eolian_mono/eolian/mono/klass.hh +++ b/src/bin/eolian_mono/eolian/mono/klass.hh @@ -401,11 +401,14 @@ struct klass if (extension_method_stream.tellp() <= 0) return true; + if (!name_helpers::open_namespaces(sink, cls.namespaces, context)) + return false; + if(!as_generator (lit("#if EFL_BETA\n") << "#pragma warning disable CS1591\n" // Disabling warnings as DocFx will hide these classes - <<"public static class " << (string % "_") << name_helpers::klass_inherit_name(cls) - << "_ExtensionMethods {\n" + << "public static class " << name_helpers::klass_concrete_name(cls) + << "ExtensionMethods {\n" << extension_method_stream.str() << "}\n" << "#pragma warning restore CS1591\n" @@ -413,6 +416,9 @@ struct klass .generate(sink, cls.namespaces, context)) return false; + if (!name_helpers::close_namespaces(sink, cls.namespaces, context)) + return false; + return true; } diff --git a/src/tests/efl_mono/Model.cs b/src/tests/efl_mono/Model.cs index bb6ba3b..69596af 100644 --- a/src/tests/efl_mono/Model.cs +++ b/src/tests/efl_mono/Model.cs @@ -3,6 +3,7 @@ using System; using System.Threading.Tasks; using System.Diagnostics.CodeAnalysis; +using Efl.Ui; #if EFL_BETA diff --git a/src/tests/efl_mono/Parts.cs b/src/tests/efl_mono/Parts.cs index 3e2da24..e206681 100644 --- a/src/tests/efl_mono/Parts.cs +++ b/src/tests/efl_mono/Parts.cs @@ -19,6 +19,7 @@ using System; using System.Diagnostics.CodeAnalysis; +using Efl.Ui; namespace TestSuite { -- 2.7.4