summaryrefslogtreecommitdiff
path: root/src/bindings
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-12-09 08:32:02 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2019-12-09 08:33:00 -0300
commit25e2ed3b2f3aa39869fd2bafa04550d3174f9c30 (patch)
tree858ab324ec0a19bdd8b56e8ae95efc711e8a6209 /src/bindings
parented43683955844fe456c4285c6c7e5b3cc903dd4f (diff)
csharp: changing string literal with nameof.
Summary: ref T8407 Reviewers: lauromoura, felipealmeida, YOhoho, jptiz Reviewed By: jptiz Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8407 Differential Revision: https://phab.enlightenment.org/D10668
Diffstat (limited to 'src/bindings')
-rw-r--r--src/bindings/mono/eina_mono/eina_array.cs20
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_connection.cs12
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_object.cs8
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_proxy.cs6
4 files changed, 21 insertions, 25 deletions
diff --git a/src/bindings/mono/eina_mono/eina_array.cs b/src/bindings/mono/eina_mono/eina_array.cs
index 7ebb7ed31e..ce26acdd9a 100644
--- a/src/bindings/mono/eina_mono/eina_array.cs
+++ b/src/bindings/mono/eina_mono/eina_array.cs
@@ -147,12 +147,10 @@ public class Array<T> : IEnumerable<T>, IDisposable
147 [EditorBrowsable(EditorBrowsableState.Never)] 147 [EditorBrowsable(EditorBrowsableState.Never)]
148 public Array(IntPtr handle, bool own) 148 public Array(IntPtr handle, bool own)
149 { 149 {
150 if (handle == IntPtr.Zero) 150 Handle = (handle != IntPtr.Zero)
151 { 151 ? handle
152 throw new ArgumentNullException("handle", "Handle can't be null"); 152 : throw new ArgumentNullException(nameof(handle),
153 } 153 $"{nameof(Handle)} can't be null");
154
155 Handle = handle;
156 Own = own; 154 Own = own;
157 OwnContent = own; 155 OwnContent = own;
158 } 156 }
@@ -166,12 +164,10 @@ public class Array<T> : IEnumerable<T>, IDisposable
166 [EditorBrowsable(EditorBrowsableState.Never)] 164 [EditorBrowsable(EditorBrowsableState.Never)]
167 public Array(IntPtr handle, bool own, bool ownContent) 165 public Array(IntPtr handle, bool own, bool ownContent)
168 { 166 {
169 if (handle == IntPtr.Zero) 167 Handle = (handle != IntPtr.Zero)
170 { 168 ? handle
171 throw new ArgumentNullException("handle", "Handle can't be null"); 169 : throw new ArgumentNullException(nameof(handle),
172 } 170 $"{nameof(Handle)} can't be null");
173
174 Handle = handle;
175 Own = own; 171 Own = own;
176 OwnContent = ownContent; 172 OwnContent = ownContent;
177 } 173 }
diff --git a/src/bindings/mono/eldbus_mono/eldbus_connection.cs b/src/bindings/mono/eldbus_mono/eldbus_connection.cs
index c2120600d3..ba54408ea7 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_connection.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_connection.cs
@@ -298,7 +298,7 @@ public class Connection : IDisposable
298 298
299 if (msg == null) 299 if (msg == null)
300 { 300 {
301 throw new ArgumentNullException("msg"); 301 throw new ArgumentNullException(nameof(msg));
302 } 302 }
303 303
304 IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr()); 304 IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
@@ -347,7 +347,7 @@ public class Connection : IDisposable
347 347
348 if (bus == null) 348 if (bus == null)
349 { 349 {
350 throw new ArgumentNullException("bus"); 350 throw new ArgumentNullException(nameof(bus));
351 } 351 }
352 352
353 IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr()); 353 IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
@@ -376,7 +376,7 @@ public class Connection : IDisposable
376 376
377 if (bus == null) 377 if (bus == null)
378 { 378 {
379 throw new ArgumentNullException("bus"); 379 throw new ArgumentNullException(nameof(bus));
380 } 380 }
381 381
382 IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr()); 382 IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
@@ -405,7 +405,7 @@ public class Connection : IDisposable
405 405
406 if (bus == null) 406 if (bus == null)
407 { 407 {
408 throw new ArgumentNullException("bus"); 408 throw new ArgumentNullException(nameof(bus));
409 } 409 }
410 410
411 IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr()); 411 IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
@@ -434,7 +434,7 @@ public class Connection : IDisposable
434 434
435 if (bus == null) 435 if (bus == null)
436 { 436 {
437 throw new ArgumentNullException("bus"); 437 throw new ArgumentNullException(nameof(bus));
438 } 438 }
439 439
440 IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr()); 440 IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
@@ -533,7 +533,7 @@ public class Connection : IDisposable
533 533
534 if (bus == null) 534 if (bus == null)
535 { 535 {
536 throw new ArgumentNullException("bus"); 536 throw new ArgumentNullException(nameof(bus));
537 } 537 }
538 538
539 IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr()); 539 IntPtr cb_wrapper = (dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr());
diff --git a/src/bindings/mono/eldbus_mono/eldbus_object.cs b/src/bindings/mono/eldbus_mono/eldbus_object.cs
index 329bd34a54..3c77d258c4 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_object.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_object.cs
@@ -146,17 +146,17 @@ public class Object : System.IDisposable
146 { 146 {
147 if (conn == null) 147 if (conn == null)
148 { 148 {
149 throw new System.ArgumentNullException("conn"); 149 throw new System.ArgumentNullException(nameof(conn));
150 } 150 }
151 151
152 if (bus == null) 152 if (bus == null)
153 { 153 {
154 throw new System.ArgumentNullException("bus"); 154 throw new System.ArgumentNullException(nameof(bus));
155 } 155 }
156 156
157 if (path == null) 157 if (path == null)
158 { 158 {
159 throw new System.ArgumentNullException("path"); 159 throw new System.ArgumentNullException(nameof(path));
160 } 160 }
161 161
162 var handle = eldbus_object_get(conn.Handle, bus, path); 162 var handle = eldbus_object_get(conn.Handle, bus, path);
@@ -316,7 +316,7 @@ public class Object : System.IDisposable
316 316
317 if (msg == null) 317 if (msg == null)
318 { 318 {
319 throw new System.ArgumentNullException("msg"); 319 throw new System.ArgumentNullException(nameof(msg));
320 } 320 }
321 321
322 IntPtr cb_wrapper = dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr(); 322 IntPtr cb_wrapper = dlgt == null ? IntPtr.Zero : eldbus.Common.GetMessageCbWrapperPtr();
diff --git a/src/bindings/mono/eldbus_mono/eldbus_proxy.cs b/src/bindings/mono/eldbus_mono/eldbus_proxy.cs
index 7fc48d3095..a3a984df97 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_proxy.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_proxy.cs
@@ -24,7 +24,7 @@ using static eldbus.EldbusProxyNativeFunctions;
24namespace eldbus 24namespace eldbus
25{ 25{
26 26
27[EditorBrowsable(EditorBrowsableState.Never)] 27[EditorBrowsable(EditorBrowsableState.Never)]
28internal static class EldbusProxyNativeFunctions 28internal static class EldbusProxyNativeFunctions
29{ 29{
30 [DllImport(efl.Libs.Eldbus)] public static extern IntPtr 30 [DllImport(efl.Libs.Eldbus)] public static extern IntPtr
@@ -215,7 +215,7 @@ public class Proxy : IDisposable
215 215
216 if (member == null) 216 if (member == null)
217 { 217 {
218 throw new ArgumentNullException("member"); 218 throw new ArgumentNullException(nameof(member));
219 } 219 }
220 220
221 var ptr = eldbus_proxy_method_call_new(Handle, member); 221 var ptr = eldbus_proxy_method_call_new(Handle, member);
@@ -233,7 +233,7 @@ public class Proxy : IDisposable
233 233
234 if (msg == null) 234 if (msg == null)
235 { 235 {
236 throw new ArgumentNullException("msg"); 236 throw new ArgumentNullException(nameof(msg));
237 } 237 }
238 238
239 // Native send() takes ownership of the message. We ref here to keep the IDisposable 239 // Native send() takes ownership of the message. We ref here to keep the IDisposable