summaryrefslogtreecommitdiff
path: root/src/bindings/mono/eldbus_mono/eldbus_common.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bindings/mono/eldbus_mono/eldbus_common.cs')
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_common.cs406
1 files changed, 325 insertions, 81 deletions
diff --git a/src/bindings/mono/eldbus_mono/eldbus_common.cs b/src/bindings/mono/eldbus_mono/eldbus_common.cs
index 34f6482..8d4a8ab 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_common.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_common.cs
@@ -1,3 +1,18 @@
1/*
2 * Copyright 2019 by its authors. See AUTHORS.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
1#pragma warning disable 1591 16#pragma warning disable 1591
2 17
3using System; 18using System;
@@ -26,7 +41,7 @@ public static class Timeout
26/// <para>Since EFL 1.23.</para> 41/// <para>Since EFL 1.23.</para>
27/// </summary> 42/// </summary>
28[StructLayout(LayoutKind.Sequential)] 43[StructLayout(LayoutKind.Sequential)]
29public struct ObjectPath 44public struct ObjectPath : IEquatable<ObjectPath>
30{ 45{
31 /// <summary> 46 /// <summary>
32 /// The string of the path. 47 /// The string of the path.
@@ -49,20 +64,71 @@ public struct ObjectPath
49 /// <para>Since EFL 1.23.</para> 64 /// <para>Since EFL 1.23.</para>
50 /// </summary> 65 /// </summary>
51 /// <param name="str">The string of the path.</param> 66 /// <param name="str">The string of the path.</param>
52 public static implicit operator ObjectPath(string str) 67 public static implicit operator ObjectPath(string str) => FromString(str);
53 { 68
54 return new ObjectPath(str); 69 /// <summary>
55 } 70 /// Converts a <see cref="string" /> to a <see cref="ObjectPath" />.
71 /// <para>Since EFL 1.23.</para>
72 /// </summary>
73 /// <param name="str">The <see cref="string" /> of the path.</param>
74 public static ObjectPath FromString(string str) => new ObjectPath(str);
56 75
57 /// <summary> 76 /// <summary>
58 /// Conversion operator of string from ObjectPath. 77 /// Conversion operator of string from ObjectPath.
59 /// <para>Since EFL 1.23.</para> 78 /// <para>Since EFL 1.23.</para>
60 /// </summary> 79 /// </summary>
61 /// <param name="path">The ObjectPath to be converted.</param> 80 /// <param name="path">The ObjectPath to be converted.</param>
62 public static implicit operator string(ObjectPath path) 81 public static implicit operator string(ObjectPath path) => ToString(path);
63 { 82
64 return path.value; 83 /// <summary>
65 } 84 /// Converts a <see cref="ObjectPath" /> to a <see cref="string" />.
85 /// <para>Since EFL 1.23.</para>
86 /// </summary>
87 /// <param name="path">The ObjectPath to be converted.</param>
88 public static string ToString(ObjectPath path) => path.value;
89
90 /// <summary>
91 /// Gets a hash for <see cref="ObjectPath" />.
92 /// <para>Since EFL 1.24.</para>
93 /// </summary>
94 /// <returns>A hash code.</returns>
95 public override int GetHashCode() => value.GetHashCode(StringComparison.Ordinal);
96
97 /// <summary>Returns whether this <see cref="ObjectPath" />
98 /// is equal to the given <see cref="object" />.
99 /// <para>Since EFL 1.24.</para>
100 /// </summary>
101 /// <param name="other">The <see cref="object" /> to be compared to.</param>
102 /// <returns><c>true</c> if is equal to <c>other</c>.</returns>
103 public override bool Equals(object other)
104 => (!(other is ObjectPath)) ? false : Equals((ObjectPath)other);
105
106 /// <summary>Returns whether this <see cref="ObjectPath" /> is equal
107 /// to the given <see cref="ObjectPath" />.
108 /// <para>Since EFL 1.24.</para>
109 /// </summary>
110 /// <param name="other">The <see cref="ObjectPath" /> to be compared to.</param>
111 /// <returns><c>true</c> if is equal to <c>other</c>.</returns>
112 public bool Equals(ObjectPath other) => value == other.value;
113
114 /// <summary>Returns whether <c>lhs</c> is equal to <c>rhs</c>.
115 /// <para>Since EFL 1.24.</para>
116 /// </summary>
117 /// <param name="lhs">The left hand side of the operator.</param>
118 /// <param name="rhs">The right hand side of the operator.</param>
119 /// <returns><c>true</c> if <c>lhs</c> is equal
120 /// to <c>rhs</c>.</returns>
121 public static bool operator==(ObjectPath lhs, ObjectPath rhs) => lhs.Equals(rhs);
122
123 /// <summary>Returns whether <c>lhs</c> is not equal to <c>rhs</c>.
124 /// <para>Since EFL 1.24.</para>
125 /// </summary>
126 /// <param name="lhs">The left hand side of the operator.</param>
127 /// <param name="rhs">The right hand side of the operator.</param>
128 /// <returns><c>true</c> if <c>lhs</c> is not equal
129 /// to <c>rhs</c>.</returns>
130 public static bool operator!=(ObjectPath lhs, ObjectPath rhs) => !(lhs == rhs);
131
66} 132}
67 133
68/// <summary> 134/// <summary>
@@ -70,7 +136,7 @@ public struct ObjectPath
70/// <para>Since EFL 1.23.</para> 136/// <para>Since EFL 1.23.</para>
71/// </summary> 137/// </summary>
72[StructLayout(LayoutKind.Sequential)] 138[StructLayout(LayoutKind.Sequential)]
73public struct SignatureString 139public struct SignatureString : IEquatable<SignatureString>
74{ 140{
75 /// <summary> 141 /// <summary>
76 /// The string of the signature. 142 /// The string of the signature.
@@ -94,9 +160,15 @@ public struct SignatureString
94 /// </summary> 160 /// </summary>
95 /// <param name="str">The string of the signature.</param> 161 /// <param name="str">The string of the signature.</param>
96 public static implicit operator SignatureString(string str) 162 public static implicit operator SignatureString(string str)
97 { 163 => FromString(str);
98 return new SignatureString(str); 164
99 } 165 /// <summary>
166 /// Converts a <see cref="string" /> to a <see cref="SignatureString" />
167 /// <para>Since EFL 1.23.</para>
168 /// </summary>
169 /// <param name="str">The string of the signature.</param>
170 public static SignatureString FromString(string str)
171 => new SignatureString(str);
100 172
101 /// <summary> 173 /// <summary>
102 /// Conversion operator of string from SignatureString. 174 /// Conversion operator of string from SignatureString.
@@ -104,9 +176,51 @@ public struct SignatureString
104 /// </summary> 176 /// </summary>
105 /// <param name="sig">The SignatureString to be conversion.</param> 177 /// <param name="sig">The SignatureString to be conversion.</param>
106 public static implicit operator string(SignatureString sig) 178 public static implicit operator string(SignatureString sig)
107 { 179 => ToString(sig);
108 return sig.value; 180
109 } 181 public static string ToString(SignatureString sig) => sig.value;
182
183 /// <summary>
184 /// Gets a hash for <see cref="SignatureString" />.
185 /// <para>Since EFL 1.24.</para>
186 /// </summary>
187 /// <returns>A hash code.</returns>
188 public override int GetHashCode() => value.GetHashCode(StringComparison.Ordinal);
189
190 /// <summary>Returns whether this <see cref="SignatureString" />
191 /// is equal to the given <see cref="object" />.
192 /// <para>Since EFL 1.24.</para>
193 /// </summary>
194 /// <param name="other">The <see cref="object" /> to be compared to.</param>
195 /// <returns><c>true</c> if is equal to <c>other</c>.</returns>
196 public override bool Equals(object other)
197 => (!(other is SignatureString)) ? false : Equals((SignatureString)other);
198
199 /// <summary>Returns whether this <see cref="SignatureString" /> is equal
200 /// to the given <see cref="SignatureString" />.
201 /// <para>Since EFL 1.24.</para>
202 /// </summary>
203 /// <param name="other">The <see cref="SignatureString" /> to be compared to.</param>
204 /// <returns><c>true</c> if is equal to <c>other</c>.</returns>
205 public bool Equals(SignatureString other) => value == other.value;
206
207 /// <summary>Returns whether <c>lhs</c> is equal to <c>rhs</c>.
208 /// <para>Since EFL 1.24.</para>
209 /// </summary>
210 /// <param name="lhs">The left hand side of the operator.</param>
211 /// <param name="rhs">The right hand side of the operator.</param>
212 /// <returns><c>true</c> if <c>lhs</c> is equal
213 /// to <c>rhs</c>.</returns>
214 public static bool operator==(SignatureString lhs, SignatureString rhs) => lhs.Equals(rhs);
215
216 /// <summary>Returns whether <c>lhs</c> is not equal to <c>rhs</c>.
217 /// <para>Since EFL 1.24.</para>
218 /// </summary>
219 /// <param name="lhs">The left hand side of the operator.</param>
220 /// <param name="rhs">The right hand side of the operator.</param>
221 /// <returns><c>true</c> if <c>lhs</c> is not equal
222 /// to <c>rhs</c>.</returns>
223 public static bool operator!=(SignatureString lhs, SignatureString rhs) => !(lhs == rhs);
110} 224}
111 225
112/// <summary> 226/// <summary>
@@ -114,7 +228,7 @@ public struct SignatureString
114/// <para>Since EFL 1.23.</para> 228/// <para>Since EFL 1.23.</para>
115/// </summary> 229/// </summary>
116[StructLayout(LayoutKind.Sequential)] 230[StructLayout(LayoutKind.Sequential)]
117public struct UnixFd 231public struct UnixFd : IEquatable<UnixFd>
118{ 232{
119 /// <summary> 233 /// <summary>
120 /// The value of the file descriptor. 234 /// The value of the file descriptor.
@@ -137,22 +251,71 @@ public struct UnixFd
137 /// <para>Since EFL 1.23.</para> 251 /// <para>Since EFL 1.23.</para>
138 /// </summary> 252 /// </summary>
139 /// <param name="fd">The file descriptor.</param> 253 /// <param name="fd">The file descriptor.</param>
140 public static implicit operator UnixFd(Int32 fd) 254 public static implicit operator UnixFd(Int32 fd) => FromInt32(fd);
141 { 255
142 return new UnixFd(fd); 256 /// <summary>
143 } 257 /// Converts a <see cref="Int32" /> to a <see cref="UnixFd" />.
258 /// <para>Since EFL 1.23.</para>
259 /// </summary>
260 /// <param name="fd">The file descriptor.</param>
261 public static UnixFd FromInt32(Int32 fd) => new UnixFd(fd);
144 262
145 /// <summary> 263 /// <summary>
146 /// Conversion operator of Int32 from UnixFd. 264 /// Conversion operator of Int32 from UnixFd.
147 /// <para>Since EFL 1.23.</para> 265 /// <para>Since EFL 1.23.</para>
148 /// </summary> 266 /// </summary>
149 /// <param name="unix_fd">The UnixFd to be converted.</param> 267 /// <param name="unix_fd">The UnixFd to be converted.</param>
150 public static implicit operator Int32(UnixFd unix_fd) 268 public static implicit operator Int32(UnixFd unix_fd) => ToInt32(unix_fd);
151 {
152 return unix_fd.value;
153 }
154}
155 269
270 /// <summary>
271 /// Converts a <see cref="UnixFd" /> to a <see cref="Int32" />.
272 /// <para>Since EFL 1.23.</para>
273 /// </summary>
274 /// <param name="unix_fd">The <see cref="UnixFd" /> to be converted.</param>
275 public static Int32 ToInt32(UnixFd unix_fd) => unix_fd.value;
276
277 /// <summary>
278 /// Gets a hash for <see cref="UnixFd" />.
279 /// <para>Since EFL 1.24.</para>
280 /// </summary>
281 /// <returns>A hash code.</returns>
282 public override int GetHashCode() => value.GetHashCode();
283
284 /// <summary>Returns whether this <see cref="UnixFd" />
285 /// is equal to the given <see cref="object" />.
286 /// <para>Since EFL 1.24.</para>
287 /// </summary>
288 /// <param name="other">The <see cref="object" /> to be compared to.</param>
289 /// <returns><c>true</c> if is equal to <c>other</c>.</returns>
290 public override bool Equals(object other)
291 => (!(other is UnixFd)) ? false : Equals((UnixFd)other);
292
293 /// <summary>Returns whether this <see cref="UnixFd" /> is equal
294 /// to the given <see cref="UnixFd" />.
295 /// <para>Since EFL 1.24.</para>
296 /// </summary>
297 /// <param name="other">The <see cref="UnixFd" /> to be compared to.</param>
298 /// <returns><c>true</c> if is equal to <c>other</c>.</returns>
299 public bool Equals(UnixFd other) => value == other.value;
300
301 /// <summary>Returns whether <c>lhs</c> is equal to <c>rhs</c>.
302 /// <para>Since EFL 1.24.</para>
303 /// </summary>
304 /// <param name="lhs">The left hand side of the operator.</param>
305 /// <param name="rhs">The right hand side of the operator.</param>
306 /// <returns><c>true</c> if <c>lhs</c> is equal
307 /// to <c>rhs</c>.</returns>
308 public static bool operator==(UnixFd lhs, UnixFd rhs) => lhs.Equals(rhs);
309
310 /// <summary>Returns whether <c>lhs</c> is not equal to <c>rhs</c>.
311 /// <para>Since EFL 1.24.</para>
312 /// </summary>
313 /// <param name="lhs">The left hand side of the operator.</param>
314 /// <param name="rhs">The right hand side of the operator.</param>
315 /// <returns><c>true</c> if <c>lhs</c> is not equal
316 /// to <c>rhs</c>.</returns>
317 public static bool operator!=(UnixFd lhs, UnixFd rhs) => !(lhs == rhs);
318}
156/// <summary> 319/// <summary>
157/// Arguments of EldBus. 320/// Arguments of EldBus.
158/// <para>Since EFL 1.23.</para> 321/// <para>Since EFL 1.23.</para>
@@ -163,7 +326,7 @@ public static class Argument
163 /// The type of a byte. 326 /// The type of a byte.
164 /// <para>Since EFL 1.23.</para> 327 /// <para>Since EFL 1.23.</para>
165 /// </summary> 328 /// </summary>
166 public static class ByteType 329 internal static class ByteType
167 { 330 {
168 /// <summary> 331 /// <summary>
169 /// The code of the byte. 332 /// The code of the byte.
@@ -181,7 +344,7 @@ public static class Argument
181 /// The type of a boolean 344 /// The type of a boolean
182 /// <para>Since EFL 1.23.</para> 345 /// <para>Since EFL 1.23.</para>
183 /// </summary> 346 /// </summary>
184 public static class BooleanType 347 internal static class BooleanType
185 { 348 {
186 /// <summary> 349 /// <summary>
187 /// The code of the boolean. 350 /// The code of the boolean.
@@ -199,7 +362,7 @@ public static class Argument
199 /// The type of a Int16. 362 /// The type of a Int16.
200 /// <para>Since EFL 1.23.</para> 363 /// <para>Since EFL 1.23.</para>
201 /// </summary> 364 /// </summary>
202 public static class Int16Type 365 internal static class Int16Type
203 { 366 {
204 /// <summary> 367 /// <summary>
205 /// The code of the Int16. 368 /// The code of the Int16.
@@ -217,7 +380,7 @@ public static class Argument
217 /// The type of an unsigned Int16. 380 /// The type of an unsigned Int16.
218 /// <para>Since EFL 1.23.</para> 381 /// <para>Since EFL 1.23.</para>
219 /// </summary> 382 /// </summary>
220 public static class UInt16Type 383 internal static class UInt16Type
221 { 384 {
222 /// <summary> 385 /// <summary>
223 /// The code of the unsigned Int16. 386 /// The code of the unsigned Int16.
@@ -235,7 +398,7 @@ public static class Argument
235 /// The type of a Int32. 398 /// The type of a Int32.
236 /// <para>Since EFL 1.23.</para> 399 /// <para>Since EFL 1.23.</para>
237 /// </summary> 400 /// </summary>
238 public static class Int32Type 401 internal static class Int32Type
239 { 402 {
240 /// <summary> 403 /// <summary>
241 /// The code of the Int32. 404 /// The code of the Int32.
@@ -253,7 +416,7 @@ public static class Argument
253 /// The type of an unsigned Int32. 416 /// The type of an unsigned Int32.
254 /// <para>Since EFL 1.23.</para> 417 /// <para>Since EFL 1.23.</para>
255 /// </summary> 418 /// </summary>
256 public static class UInt32Type 419 internal static class UInt32Type
257 { 420 {
258 /// <summary> 421 /// <summary>
259 /// The code of the unsigned Int32. 422 /// The code of the unsigned Int32.
@@ -271,7 +434,7 @@ public static class Argument
271 /// The type of a Int64. 434 /// The type of a Int64.
272 /// <para>Since EFL 1.23.</para> 435 /// <para>Since EFL 1.23.</para>
273 /// </summary> 436 /// </summary>
274 public static class Int64Type 437 internal static class Int64Type
275 { 438 {
276 /// <summary> 439 /// <summary>
277 /// The code of the Int64. 440 /// The code of the Int64.
@@ -289,7 +452,7 @@ public static class Argument
289 /// The type of an unsigned Int64. 452 /// The type of an unsigned Int64.
290 /// <para>Since EFL 1.23.</para> 453 /// <para>Since EFL 1.23.</para>
291 /// </summary> 454 /// </summary>
292 public static class UInt64Type 455 internal static class UInt64Type
293 { 456 {
294 /// <summary> 457 /// <summary>
295 /// The code of the unsigned Int64. 458 /// The code of the unsigned Int64.
@@ -307,7 +470,7 @@ public static class Argument
307 /// The type of the double. 470 /// The type of the double.
308 /// <para>Since EFL 1.23.</para> 471 /// <para>Since EFL 1.23.</para>
309 /// </summary> 472 /// </summary>
310 public static class DoubleType 473 internal static class DoubleType
311 { 474 {
312 /// <summary> 475 /// <summary>
313 /// The code of the double. 476 /// The code of the double.
@@ -325,7 +488,7 @@ public static class Argument
325 /// The type of a string. 488 /// The type of a string.
326 /// <para>Since EFL 1.23.</para> 489 /// <para>Since EFL 1.23.</para>
327 /// </summary> 490 /// </summary>
328 public static class StringType 491 internal static class StringType
329 { 492 {
330 /// <summary> 493 /// <summary>
331 /// The code of the string. 494 /// The code of the string.
@@ -343,7 +506,7 @@ public static class Argument
343 /// The type of an object path. 506 /// The type of an object path.
344 /// <para>Since EFL 1.23.</para> 507 /// <para>Since EFL 1.23.</para>
345 /// </summary> 508 /// </summary>
346 public static class ObjectPathType 509 internal static class ObjectPathType
347 { 510 {
348 /// <summary> 511 /// <summary>
349 /// The code of the object path. 512 /// The code of the object path.
@@ -361,7 +524,7 @@ public static class Argument
361 /// The type of a signature. 524 /// The type of a signature.
362 /// <para>Since EFL 1.23.</para> 525 /// <para>Since EFL 1.23.</para>
363 /// </summary> 526 /// </summary>
364 public static class SignatureType 527 internal static class SignatureType
365 { 528 {
366 /// <summary> 529 /// <summary>
367 /// The code of the signature. 530 /// The code of the signature.
@@ -379,7 +542,7 @@ public static class Argument
379 /// The type of a array. 542 /// The type of a array.
380 /// <para>Since EFL 1.23.</para> 543 /// <para>Since EFL 1.23.</para>
381 /// </summary> 544 /// </summary>
382 public static class ArrayType 545 internal static class ArrayType
383 { 546 {
384 /// <summary> 547 /// <summary>
385 /// The code of the array. 548 /// The code of the array.
@@ -397,7 +560,7 @@ public static class Argument
397 /// The type of a struct. 560 /// The type of a struct.
398 /// <para>Since EFL 1.23.</para> 561 /// <para>Since EFL 1.23.</para>
399 /// </summary> 562 /// </summary>
400 public static class StructType 563 internal static class StructType
401 { 564 {
402 /// <summary> 565 /// <summary>
403 /// The code of the struct. 566 /// The code of the struct.
@@ -415,7 +578,7 @@ public static class Argument
415 /// The type of a variant. 578 /// The type of a variant.
416 /// <para>Since EFL 1.23.</para> 579 /// <para>Since EFL 1.23.</para>
417 /// </summary> 580 /// </summary>
418 public static class VariantType 581 internal static class VariantType
419 { 582 {
420 /// <summary> 583 /// <summary>
421 /// The code of the variant. 584 /// The code of the variant.
@@ -433,7 +596,7 @@ public static class Argument
433 /// The type of a dictionary. 596 /// The type of a dictionary.
434 /// <para>Since EFL 1.23.</para> 597 /// <para>Since EFL 1.23.</para>
435 /// </summary> 598 /// </summary>
436 public static class DictEntryType 599 internal static class DictEntryType
437 { 600 {
438 /// <summary> 601 /// <summary>
439 /// The code of the dictionary. 602 /// The code of the dictionary.
@@ -451,7 +614,7 @@ public static class Argument
451 /// The type of an unix file descriptor. 614 /// The type of an unix file descriptor.
452 /// <para>Since EFL 1.23.</para> 615 /// <para>Since EFL 1.23.</para>
453 /// </summary> 616 /// </summary>
454 public static class UnixFdType 617 internal static class UnixFdType
455 { 618 {
456 /// <summary> 619 /// <summary>
457 /// The code of unix fd. 620 /// The code of unix fd.
@@ -558,9 +721,15 @@ public abstract class BasicMessageArgument
558 /// </summary> 721 /// </summary>
559 /// <param name="arg">The byte to be converted.</param> 722 /// <param name="arg">The byte to be converted.</param>
560 public static implicit operator BasicMessageArgument(byte arg) 723 public static implicit operator BasicMessageArgument(byte arg)
561 { 724 => FromByte(arg);
562 return new ByteMessageArgument(arg); 725
563 } 726 /// <summary>
727 /// Converts a <see cref="byte" /> to a <see cref="BasicMessageArgument" />.
728 /// <para>Since EFL 1.23.</para>
729 /// </summary>
730 /// <param name="arg">The <see cref="byte" /> to be converted.</param>
731 public static BasicMessageArgument FromByte(byte arg)
732 => new ByteMessageArgument(arg);
564 733
565 /// <summary> 734 /// <summary>
566 /// Conversion operator of BasicMessageArgument from bool. 735 /// Conversion operator of BasicMessageArgument from bool.
@@ -568,9 +737,15 @@ public abstract class BasicMessageArgument
568 /// </summary> 737 /// </summary>
569 /// <param name="arg">The bool to be converted.</param> 738 /// <param name="arg">The bool to be converted.</param>
570 public static implicit operator BasicMessageArgument(bool arg) 739 public static implicit operator BasicMessageArgument(bool arg)
571 { 740 => FromBoolean(arg);
572 return new BoolMessageArgument(arg); 741
573 } 742 /// <summary>
743 /// Converts a <see cref="bool" /> to a <see cref="BasicMessageArgument" />.
744 /// <para>Since EFL 1.23.</para>
745 /// </summary>
746 /// <param name="arg">The <see cref="bool" /> to be converted.</param>
747 public static BasicMessageArgument FromBoolean(bool arg)
748 => new BoolMessageArgument(arg);
574 749
575 /// <summary> 750 /// <summary>
576 /// Conversion operator of BasicMessageArgument from Int16. 751 /// Conversion operator of BasicMessageArgument from Int16.
@@ -578,9 +753,15 @@ public abstract class BasicMessageArgument
578 /// </summary> 753 /// </summary>
579 /// <param name="arg">The int16 to be converted.</param> 754 /// <param name="arg">The int16 to be converted.</param>
580 public static implicit operator BasicMessageArgument(Int16 arg) 755 public static implicit operator BasicMessageArgument(Int16 arg)
581 { 756 => FromInt16(arg);
582 return new Int16MessageArgument(arg); 757
583 } 758 /// <summary>
759 /// Converts a <see cref="Int16" /> to a <see cref="BasicMessageArgument" />.
760 /// <para>Since EFL 1.23.</para>
761 /// </summary>
762 /// <param name="arg">The <see cref="Int16" /> to be converted.</param>
763 public static BasicMessageArgument FromInt16(Int16 arg)
764 => new Int16MessageArgument(arg);
584 765
585 /// <summary> 766 /// <summary>
586 /// Conversion operator of BasicMessageArgument from unsigned int16. 767 /// Conversion operator of BasicMessageArgument from unsigned int16.
@@ -588,9 +769,15 @@ public abstract class BasicMessageArgument
588 /// </summary> 769 /// </summary>
589 /// <param name="arg">The unsigned int16 to be converted.</param> 770 /// <param name="arg">The unsigned int16 to be converted.</param>
590 public static implicit operator BasicMessageArgument(UInt16 arg) 771 public static implicit operator BasicMessageArgument(UInt16 arg)
591 { 772 => FromUInt16(arg);
592 return new UInt16MessageArgument(arg); 773
593 } 774 /// <summary>
775 /// Converts a <see cref="UInt16" /> to a <see cref="BasicMessageArgument" />.
776 /// <para>Since EFL 1.23.</para>
777 /// </summary>
778 /// <param name="arg">The <see cref="UInt16" /> to be converted.</param>
779 public static BasicMessageArgument FromUInt16(UInt16 arg)
780 => new UInt16MessageArgument(arg);
594 781
595 /// <summary> 782 /// <summary>
596 /// Conversion operator of BasicMessageArgument from int32. 783 /// Conversion operator of BasicMessageArgument from int32.
@@ -598,9 +785,15 @@ public abstract class BasicMessageArgument
598 /// </summary> 785 /// </summary>
599 /// <param name="arg">The int32 to be converted.</param> 786 /// <param name="arg">The int32 to be converted.</param>
600 public static implicit operator BasicMessageArgument(Int32 arg) 787 public static implicit operator BasicMessageArgument(Int32 arg)
601 { 788 => FromInt32(arg);
602 return new Int32MessageArgument(arg); 789
603 } 790 /// <summary>
791 /// Converts a <see cref="Int32" /> to a <see cref="BasicMessageArgument" />.
792 /// <para>Since EFL 1.23.</para>
793 /// </summary>
794 /// <param name="arg">The <see cref="Int32" /> to be converted.</param>
795 public static BasicMessageArgument FromInt32(Int32 arg)
796 => new Int32MessageArgument(arg);
604 797
605 /// <summary> 798 /// <summary>
606 /// Conversion operator of BasicMessageArgument from unsigned int32. 799 /// Conversion operator of BasicMessageArgument from unsigned int32.
@@ -608,9 +801,15 @@ public abstract class BasicMessageArgument
608 /// </summary> 801 /// </summary>
609 /// <param name="arg">The unsigned int32 to be converted.</param> 802 /// <param name="arg">The unsigned int32 to be converted.</param>
610 public static implicit operator BasicMessageArgument(UInt32 arg) 803 public static implicit operator BasicMessageArgument(UInt32 arg)
611 { 804 => FromUInt32(arg);
612 return new UInt32MessageArgument(arg); 805
613 } 806 /// <summary>
807 /// Converts a <see cref="UInt32" /> to a <see cref="BasicMessageArgument" />.
808 /// <para>Since EFL 1.23.</para>
809 /// </summary>
810 /// <param name="arg">The <see cref="UInt32" /> to be converted.</param>
811 public static BasicMessageArgument FromUInt32(UInt32 arg)
812 => new UInt32MessageArgument(arg);
614 813
615 /// <summary> 814 /// <summary>
616 /// Conversion operator of BasicMessageArgument from int64. 815 /// Conversion operator of BasicMessageArgument from int64.
@@ -618,9 +817,15 @@ public abstract class BasicMessageArgument
618 /// </summary> 817 /// </summary>
619 /// <param name="arg">The int64 to be converted.</param> 818 /// <param name="arg">The int64 to be converted.</param>
620 public static implicit operator BasicMessageArgument(Int64 arg) 819 public static implicit operator BasicMessageArgument(Int64 arg)
621 { 820 => FromInt64(arg);
622 return new Int64MessageArgument(arg); 821
623 } 822 /// <summary>
823 /// Converts a <see cref="Int64" /> to a <see cref="BasicMessageArgument" />.
824 /// <para>Since EFL 1.23.</para>
825 /// </summary>
826 /// <param name="arg">The <see cref="Int64" /> to be converted.</param>
827 public static BasicMessageArgument FromInt64(Int64 arg)
828 => new Int64MessageArgument(arg);
624 829
625 /// <summary> 830 /// <summary>
626 /// Conversion operator of BasicMessageArgument from unsigned int64. 831 /// Conversion operator of BasicMessageArgument from unsigned int64.
@@ -628,9 +833,15 @@ public abstract class BasicMessageArgument
628 /// </summary> 833 /// </summary>
629 /// <param name="arg">The unsigned int64 to be converted.</param> 834 /// <param name="arg">The unsigned int64 to be converted.</param>
630 public static implicit operator BasicMessageArgument(UInt64 arg) 835 public static implicit operator BasicMessageArgument(UInt64 arg)
631 { 836 => FromUInt64(arg);
632 return new UInt64MessageArgument(arg); 837
633 } 838 /// <summary>
839 /// Converts a <see cref="UInt64" /> to a <see cref="BasicMessageArgument" />.
840 /// <para>Since EFL 1.23.</para>
841 /// </summary>
842 /// <param name="arg">The <see cref="UInt64" /> to be converted.</param>
843 public static BasicMessageArgument FromUInt64(UInt64 arg)
844 => new UInt64MessageArgument(arg);
634 845
635 /// <summary> 846 /// <summary>
636 /// Conversion operator of BasicMessageArgument from string. 847 /// Conversion operator of BasicMessageArgument from string.
@@ -638,9 +849,15 @@ public abstract class BasicMessageArgument
638 /// </summary> 849 /// </summary>
639 /// <param name="arg">the string to be converted.</param> 850 /// <param name="arg">the string to be converted.</param>
640 public static implicit operator BasicMessageArgument(string arg) 851 public static implicit operator BasicMessageArgument(string arg)
641 { 852 => FromString(arg);
642 return new StringMessageArgument(arg); 853
643 } 854 /// <summary>
855 /// Converts a <see cref="string" /> to a <see cref="BasicMessageArgument" />.
856 /// <para>Since EFL 1.23.</para>
857 /// </summary>
858 /// <param name="arg">The <see cref="string" /> to be converted.</param>
859 public static BasicMessageArgument FromString(string arg)
860 => new StringMessageArgument(arg);
644 861
645 /// <summary> 862 /// <summary>
646 /// Conversion operator of BasicMessageArgument from signature. 863 /// Conversion operator of BasicMessageArgument from signature.
@@ -648,9 +865,15 @@ public abstract class BasicMessageArgument
648 /// </summary> 865 /// </summary>
649 /// <param name="arg">The signature to be converted.</param> 866 /// <param name="arg">The signature to be converted.</param>
650 public static implicit operator BasicMessageArgument(SignatureString arg) 867 public static implicit operator BasicMessageArgument(SignatureString arg)
651 { 868 => FromSignatureString(arg);
652 return new SignatureMessageArgument(arg); 869
653 } 870 /// <summary>
871 /// Converts a <see cref="SignatureString" /> to a <see cref="BasicMessageArgument" />.
872 /// <para>Since EFL 1.23.</para>
873 /// </summary>
874 /// <param name="arg">The <see cref="SignatureString" /> to be converted.</param>
875 public static BasicMessageArgument FromSignatureString(SignatureString arg)
876 => new SignatureMessageArgument(arg);
654 877
655 /// <summary> 878 /// <summary>
656 /// Conversion operator of BasicMessageArgument from object path. 879 /// Conversion operator of BasicMessageArgument from object path.
@@ -658,9 +881,15 @@ public abstract class BasicMessageArgument
658 /// </summary> 881 /// </summary>
659 /// <param name="arg">The object path to be converted.</param> 882 /// <param name="arg">The object path to be converted.</param>
660 public static implicit operator BasicMessageArgument(ObjectPath arg) 883 public static implicit operator BasicMessageArgument(ObjectPath arg)
661 { 884 => FromObjectPath(arg);
662 return new ObjectPathMessageArgument(arg); 885
663 } 886 /// <summary>
887 /// Converts a <see cref="ObjectPath" /> to a <see cref="BasicMessageArgument" />.
888 /// <para>Since EFL 1.23.</para>
889 /// </summary>
890 /// <param name="arg">The <see cref="ObjectPath" /> to be converted.</param>
891 public static BasicMessageArgument FromObjectPath(ObjectPath arg)
892 => new ObjectPathMessageArgument(arg);
664 893
665 /// <summary> 894 /// <summary>
666 /// Conversion operator of BasicMessageArgument from unix fd. 895 /// Conversion operator of BasicMessageArgument from unix fd.
@@ -668,9 +897,15 @@ public abstract class BasicMessageArgument
668 /// </summary> 897 /// </summary>
669 /// <param name="arg">The unix fd to be converted.</param> 898 /// <param name="arg">The unix fd to be converted.</param>
670 public static implicit operator BasicMessageArgument(UnixFd arg) 899 public static implicit operator BasicMessageArgument(UnixFd arg)
671 { 900 => FromUnixFd(arg);
672 return new UnixFdMessageArgument(arg); 901
673 } 902 /// <summary>
903 /// Converts a <see cref="UnixFd" /> to a <see cref="BasicMessageArgument" />.
904 /// <para>Since EFL 1.23.</para>
905 /// </summary>
906 /// <param name="arg">The <see cref="UnixFd" /> to be converted.</param>
907 public static BasicMessageArgument FromUnixFd(UnixFd arg)
908 => new UnixFdMessageArgument(arg);
674} 909}
675 910
676/// <summary> 911/// <summary>
@@ -1372,8 +1607,8 @@ public static class Common
1372 return; 1607 return;
1373 } 1608 }
1374 1609
1375 eldbus.Message msg; 1610 eldbus.Message msg = null;
1376 eldbus.Pending pending; 1611 eldbus.Pending pending = null;
1377 1612
1378 try 1613 try
1379 { 1614 {
@@ -1383,6 +1618,11 @@ public static class Common
1383 catch (Exception e) 1618 catch (Exception e)
1384 { 1619 {
1385 Eina.Log.Error("Eldbus: could not convert Eldbus_Message_Cb parameters. Exception: " + e.ToString()); 1620 Eina.Log.Error("Eldbus: could not convert Eldbus_Message_Cb parameters. Exception: " + e.ToString());
1621
1622 if (msg != null)
1623 {
1624 msg.Dispose(); // CA2000
1625 }
1386 return; 1626 return;
1387 } 1627 }
1388 1628
@@ -1394,6 +1634,10 @@ public static class Common
1394 { 1634 {
1395 Eina.Log.Error("Eldbus: Eldbus_Message_Cb delegate error. Exception: " + e.ToString()); 1635 Eina.Log.Error("Eldbus: Eldbus_Message_Cb delegate error. Exception: " + e.ToString());
1396 } 1636 }
1637 finally
1638 {
1639 msg.Dispose(); // CA2000
1640 }
1397 } 1641 }
1398 1642
1399 private static Eldbus_Message_Cb message_cb_wrapper = null; 1643 private static Eldbus_Message_Cb message_cb_wrapper = null;