c#: Checking null for parameters.
Checking for non-generated code. ref T8399 Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br> Differential Revision: https://phab.enlightenment.org/D10959
This commit is contained in:
parent
55e9d31569
commit
cf37047a7c
|
@ -20,6 +20,7 @@ using System.Runtime.InteropServices;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Diagnostics.Contracts;
|
||||||
|
|
||||||
using static Eina.TraitFunctions;
|
using static Eina.TraitFunctions;
|
||||||
using static Eina.ArrayNativeFunctions;
|
using static Eina.ArrayNativeFunctions;
|
||||||
|
@ -468,6 +469,7 @@ public class Array<T> : IList<T>, IEnumerable<T>, IDisposable
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Append(T[] values)
|
public bool Append(T[] values)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(values != null, nameof(values));
|
||||||
foreach (T v in values)
|
foreach (T v in values)
|
||||||
{
|
{
|
||||||
if (!Push(v))
|
if (!Push(v))
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics.Contracts;
|
||||||
|
|
||||||
namespace Eina
|
namespace Eina
|
||||||
{
|
{
|
||||||
|
@ -214,6 +215,7 @@ public class Binbuf : IDisposable
|
||||||
/// <returns>true on success, false if data could not be appended.</returns>
|
/// <returns>true on success, false if data could not be appended.</returns>
|
||||||
public bool Append(byte[] str)
|
public bool Append(byte[] str)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(str != null, nameof(str));
|
||||||
return 0 != eina_binbuf_append_length(Handle, str, (UIntPtr)(str.Length));
|
return 0 != eina_binbuf_append_length(Handle, str, (UIntPtr)(str.Length));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -238,6 +240,7 @@ public class Binbuf : IDisposable
|
||||||
/// <returns>true on success, false if data could not be appended.</returns>
|
/// <returns>true on success, false if data could not be appended.</returns>
|
||||||
public bool Append(Binbuf bb)
|
public bool Append(Binbuf bb)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(bb != null, nameof(bb));
|
||||||
return 0 != eina_binbuf_append_buffer(Handle, bb.Handle);
|
return 0 != eina_binbuf_append_buffer(Handle, bb.Handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,6 +276,7 @@ public class Binbuf : IDisposable
|
||||||
/// <returns>true on success, false if data could not be appended.</returns>
|
/// <returns>true on success, false if data could not be appended.</returns>
|
||||||
public bool Insert(byte[] str, uint pos)
|
public bool Insert(byte[] str, uint pos)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(str != null, nameof(str));
|
||||||
return 0 != eina_binbuf_insert_length(Handle, str, (UIntPtr)(str.Length), (UIntPtr)pos);
|
return 0 != eina_binbuf_insert_length(Handle, str, (UIntPtr)(str.Length), (UIntPtr)pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ using System.Runtime.InteropServices;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Diagnostics.Contracts;
|
||||||
|
|
||||||
using static Eina.TraitFunctions;
|
using static Eina.TraitFunctions;
|
||||||
using static Eina.InarrayNativeFunctions;
|
using static Eina.InarrayNativeFunctions;
|
||||||
|
@ -485,6 +486,7 @@ public class Inarray<T> : IEnumerable<T>, IDisposable
|
||||||
/// <returns>true on success, false otherwise.</returns>
|
/// <returns>true on success, false otherwise.</returns>
|
||||||
public bool Append(T[] values)
|
public bool Append(T[] values)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(values != null, nameof(values));
|
||||||
foreach (T v in values)
|
foreach (T v in values)
|
||||||
{
|
{
|
||||||
if (Push(v) == -1)
|
if (Push(v) == -1)
|
||||||
|
|
|
@ -20,6 +20,7 @@ using System.Runtime.InteropServices;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Diagnostics.Contracts;
|
||||||
|
|
||||||
using static Eina.TraitFunctions;
|
using static Eina.TraitFunctions;
|
||||||
using static Eina.InlistNativeFunctions;
|
using static Eina.InlistNativeFunctions;
|
||||||
|
@ -422,6 +423,7 @@ public class Inlist<T> : IEnumerable<T>, IDisposable
|
||||||
/// <param name="values">The values to be added.</param>
|
/// <param name="values">The values to be added.</param>
|
||||||
public void AppendArray(T[] values)
|
public void AppendArray(T[] values)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(values != null, nameof(values));
|
||||||
foreach (T v in values)
|
foreach (T v in values)
|
||||||
{
|
{
|
||||||
Append(v);
|
Append(v);
|
||||||
|
|
|
@ -20,6 +20,7 @@ using System.Runtime.InteropServices;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Diagnostics.Contracts;
|
||||||
|
|
||||||
using static Eina.TraitFunctions;
|
using static Eina.TraitFunctions;
|
||||||
using static Eina.ListNativeFunctions;
|
using static Eina.ListNativeFunctions;
|
||||||
|
@ -533,6 +534,7 @@ public class List<T> : IList<T>, IEnumerable<T>, IDisposable
|
||||||
/// <param name="values">The values to be appended.</param>
|
/// <param name="values">The values to be appended.</param>
|
||||||
public void Append(T[] values)
|
public void Append(T[] values)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(values != null, nameof(values));
|
||||||
RequireWritable();
|
RequireWritable();
|
||||||
|
|
||||||
foreach (T v in values)
|
foreach (T v in values)
|
||||||
|
|
|
@ -18,7 +18,7 @@ using System.Runtime.InteropServices;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics.Contracts;
|
||||||
|
|
||||||
using static Eina.EinaNative.PromiseNativeMethods;
|
using static Eina.EinaNative.PromiseNativeMethods;
|
||||||
|
|
||||||
|
@ -207,6 +207,7 @@ public class Promise : IDisposable
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Resolve(Eina.Value value)
|
public void Resolve(Eina.Value value)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(value != null, nameof(value));
|
||||||
SanityChecks();
|
SanityChecks();
|
||||||
eina_promise_resolve(this.Handle, value);
|
eina_promise_resolve(this.Handle, value);
|
||||||
// Promise will take care of releasing this value correctly.
|
// Promise will take care of releasing this value correctly.
|
||||||
|
@ -280,6 +281,7 @@ public class Future
|
||||||
/// <param name="cb">The callback to be called when the attached promise resolves.</param>
|
/// <param name="cb">The callback to be called when the attached promise resolves.</param>
|
||||||
public Future(Promise promise, ResolvedCb cb = null)
|
public Future(Promise promise, ResolvedCb cb = null)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(promise != null, nameof(promise));
|
||||||
IntPtr intermediate = eina_future_new(promise.Handle);
|
IntPtr intermediate = eina_future_new(promise.Handle);
|
||||||
Handle = ThenRaw(intermediate, (Eina.Value value) =>
|
Handle = ThenRaw(intermediate, (Eina.Value value) =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics.Contracts;
|
||||||
|
|
||||||
namespace Eina
|
namespace Eina
|
||||||
{
|
{
|
||||||
|
@ -235,6 +236,7 @@ public static class Eina_SliceUtils
|
||||||
{
|
{
|
||||||
public static byte[] GetBytes(this Eina.ISliceBase slc)
|
public static byte[] GetBytes(this Eina.ISliceBase slc)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(slc != null, nameof(slc));
|
||||||
var size = (int)(slc.Len);
|
var size = (int)(slc.Len);
|
||||||
byte[] mArray = new byte[size];
|
byte[] mArray = new byte[size];
|
||||||
Marshal.Copy(slc.Mem, mArray, 0, size);
|
Marshal.Copy(slc.Mem, mArray, 0, size);
|
||||||
|
|
|
@ -27,6 +27,7 @@ using System.Security;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Runtime.Serialization;
|
using System.Runtime.Serialization;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using System.Diagnostics.Contracts;
|
||||||
|
|
||||||
using static Eina.EinaNative.UnsafeNativeMethods;
|
using static Eina.EinaNative.UnsafeNativeMethods;
|
||||||
using static Eina.TraitFunctions;
|
using static Eina.TraitFunctions;
|
||||||
|
@ -1268,8 +1269,10 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <para>Since EFL 1.23.</para>
|
/// <para>Since EFL 1.23.</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="obj">The object to be wrapped.</param>
|
/// <param name="obj">The object to be wrapped.</param>
|
||||||
|
[SuppressMessage("Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods", Justification="Could not remove warning!")]
|
||||||
public Value(object obj) : this()
|
public Value(object obj) : this()
|
||||||
{
|
{
|
||||||
|
Contract.Requires(obj != null, nameof(obj));
|
||||||
var objType = obj.GetType();
|
var objType = obj.GetType();
|
||||||
|
|
||||||
if (objType == typeof(sbyte))
|
if (objType == typeof(sbyte))
|
||||||
|
@ -1424,6 +1427,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <param name="v">The value to be copied.</param>
|
/// <param name="v">The value to be copied.</param>
|
||||||
public Value(Value v)
|
public Value(Value v)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(v != null, nameof(v));
|
||||||
Handle = Alloc();
|
Handle = Alloc();
|
||||||
if (!eina_value_copy(v.Handle, this.Handle))
|
if (!eina_value_copy(v.Handle, this.Handle))
|
||||||
{
|
{
|
||||||
|
@ -1615,7 +1619,11 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
public static implicit operator ValueNative(Value v) => ToValueNative(v);
|
public static implicit operator ValueNative(Value v) => ToValueNative(v);
|
||||||
|
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
public static ValueNative ToValueNative(Value v) => v.GetNative();
|
public static ValueNative ToValueNative(Value v)
|
||||||
|
{
|
||||||
|
Contract.Requires(v != null, nameof(v));
|
||||||
|
return v.GetNative();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>Implicit conversion from native struct representation to managed wrapper.
|
/// <summary>Implicit conversion from native struct representation to managed wrapper.
|
||||||
/// <para>Since EFL 1.23.</para>
|
/// <para>Since EFL 1.23.</para>
|
||||||
|
@ -1655,6 +1663,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||||
public static byte ToByte(Value v)
|
public static byte ToByte(Value v)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(v != null, nameof(v));
|
||||||
byte b;
|
byte b;
|
||||||
v.Get(out b);
|
v.Get(out b);
|
||||||
|
|
||||||
|
@ -1691,6 +1700,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||||
public static sbyte ToSByte(Value v)
|
public static sbyte ToSByte(Value v)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(v != null, nameof(v));
|
||||||
sbyte b;
|
sbyte b;
|
||||||
v.Get(out b);
|
v.Get(out b);
|
||||||
|
|
||||||
|
@ -1727,6 +1737,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||||
public static short ToInt16(Value v)
|
public static short ToInt16(Value v)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(v != null, nameof(v));
|
||||||
short b;
|
short b;
|
||||||
v.Get(out b);
|
v.Get(out b);
|
||||||
|
|
||||||
|
@ -1763,6 +1774,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||||
public static ushort ToUInt16(Value v)
|
public static ushort ToUInt16(Value v)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(v != null, nameof(v));
|
||||||
ushort b;
|
ushort b;
|
||||||
v.Get(out b);
|
v.Get(out b);
|
||||||
|
|
||||||
|
@ -1800,6 +1812,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||||
public static int ToInt32(Value v)
|
public static int ToInt32(Value v)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(v != null, nameof(v));
|
||||||
int b;
|
int b;
|
||||||
v.Get(out b);
|
v.Get(out b);
|
||||||
|
|
||||||
|
@ -1836,6 +1849,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||||
public static uint ToUInt32(Value v)
|
public static uint ToUInt32(Value v)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(v != null, nameof(v));
|
||||||
uint b;
|
uint b;
|
||||||
v.Get(out b);
|
v.Get(out b);
|
||||||
|
|
||||||
|
@ -1872,6 +1886,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||||
public static long ToInt64(Value v)
|
public static long ToInt64(Value v)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(v != null, nameof(v));
|
||||||
long b;
|
long b;
|
||||||
v.Get(out b);
|
v.Get(out b);
|
||||||
|
|
||||||
|
@ -1908,6 +1923,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||||
public static ulong ToUInt64(Value v)
|
public static ulong ToUInt64(Value v)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(v != null, nameof(v));
|
||||||
ulong b;
|
ulong b;
|
||||||
v.Get(out b);
|
v.Get(out b);
|
||||||
|
|
||||||
|
@ -1944,6 +1960,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||||
public static float ToSingle(Value v)
|
public static float ToSingle(Value v)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(v != null, nameof(v));
|
||||||
float b;
|
float b;
|
||||||
v.Get(out b);
|
v.Get(out b);
|
||||||
|
|
||||||
|
@ -1980,6 +1997,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||||
public static double ToDouble(Value v)
|
public static double ToDouble(Value v)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(v != null, nameof(v));
|
||||||
double b;
|
double b;
|
||||||
v.Get(out b);
|
v.Get(out b);
|
||||||
|
|
||||||
|
@ -2016,6 +2034,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||||
public static string ToString(Value v)
|
public static string ToString(Value v)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(v != null, nameof(v));
|
||||||
string b;
|
string b;
|
||||||
v.Get(out b);
|
v.Get(out b);
|
||||||
|
|
||||||
|
@ -2171,6 +2190,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
/// <param name="v">The <see cref="Value" /> to be converted.</param>
|
||||||
public static Efl.Object ToObject(Value v)
|
public static Efl.Object ToObject(Value v)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(v != null, nameof(v));
|
||||||
Efl.Object obj;
|
Efl.Object obj;
|
||||||
v.Get(out obj);
|
v.Get(out obj);
|
||||||
|
|
||||||
|
@ -2714,6 +2734,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <returns><c>true</c> if the value was successfully stored.</returns>
|
/// <returns><c>true</c> if the value was successfully stored.</returns>
|
||||||
public bool Set(Efl.Object value)
|
public bool Set(Efl.Object value)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(value != null, nameof(value));
|
||||||
SanityChecks();
|
SanityChecks();
|
||||||
|
|
||||||
if (this.Optional)
|
if (this.Optional)
|
||||||
|
@ -2735,6 +2756,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <returns><c>true</c> if the value was successfully stored.</returns>
|
/// <returns><c>true</c> if the value was successfully stored.</returns>
|
||||||
public bool Set(Value value)
|
public bool Set(Value value)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(value != null, nameof(value));
|
||||||
OptionalSanityChecks();
|
OptionalSanityChecks();
|
||||||
ValueType subtype = value.GetValueType();
|
ValueType subtype = value.GetValueType();
|
||||||
|
|
||||||
|
@ -3321,6 +3343,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
/// <returns><c>true</c> if the value was successfully appended.</returns>
|
/// <returns><c>true</c> if the value was successfully appended.</returns>
|
||||||
public bool Append(object o)
|
public bool Append(object o)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(o != null, nameof(o));
|
||||||
ContainerSanityChecks();
|
ContainerSanityChecks();
|
||||||
|
|
||||||
switch (GetValueSubType())
|
switch (GetValueSubType())
|
||||||
|
@ -3508,6 +3531,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
Contract.Requires(value != null, nameof(value));
|
||||||
ContainerSanityChecks(i);
|
ContainerSanityChecks(i);
|
||||||
|
|
||||||
switch (GetValueSubType())
|
switch (GetValueSubType())
|
||||||
|
@ -3650,6 +3674,7 @@ public class ValueMarshaler : ICustomMarshaler
|
||||||
/// keeping the managed ownership.</summary>
|
/// keeping the managed ownership.</summary>
|
||||||
public IntPtr MarshalManagedToNative(object managedObj)
|
public IntPtr MarshalManagedToNative(object managedObj)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(managedObj != null, nameof(managedObj));
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Value v = (Value)managedObj;
|
Value v = (Value)managedObj;
|
||||||
|
@ -3703,6 +3728,7 @@ public class ValueMarshalerOwn : ICustomMarshaler
|
||||||
/// when not needed. </summary>
|
/// when not needed. </summary>
|
||||||
public IntPtr MarshalManagedToNative(object managedObj)
|
public IntPtr MarshalManagedToNative(object managedObj)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(managedObj != null, nameof(managedObj));
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Value v = (Value)managedObj;
|
Value v = (Value)managedObj;
|
||||||
|
|
|
@ -19,6 +19,7 @@ using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using System.Diagnostics.Contracts;
|
||||||
|
|
||||||
using static eldbus.EldbusMessageNativeFunctions;
|
using static eldbus.EldbusMessageNativeFunctions;
|
||||||
|
|
||||||
|
@ -948,12 +949,14 @@ public class ByteMessageArgument : BasicMessageArgument
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(msg != null, nameof(msg));
|
||||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(iter != null, nameof(iter));
|
||||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -997,12 +1000,14 @@ public class BoolMessageArgument : BasicMessageArgument
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(msg != null, nameof(msg));
|
||||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(iter != null, nameof(iter));
|
||||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1046,12 +1051,14 @@ public class Int16MessageArgument : BasicMessageArgument
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(msg != null, nameof(msg));
|
||||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(iter != null, nameof(iter));
|
||||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1095,12 +1102,14 @@ public class UInt16MessageArgument : BasicMessageArgument
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(msg != null, nameof(msg));
|
||||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(iter != null, nameof(iter));
|
||||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1144,12 +1153,14 @@ public class Int32MessageArgument : BasicMessageArgument
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(msg != null, nameof(msg));
|
||||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(iter != null, nameof(iter));
|
||||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1193,12 +1204,14 @@ public class UInt32MessageArgument : BasicMessageArgument
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(msg != null, nameof(msg));
|
||||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(iter != null, nameof(iter));
|
||||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1242,12 +1255,14 @@ public class Int64MessageArgument : BasicMessageArgument
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(msg != null, nameof(msg));
|
||||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(iter != null, nameof(iter));
|
||||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1291,12 +1306,14 @@ public class UInt64MessageArgument : BasicMessageArgument
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(msg != null, nameof(msg));
|
||||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(iter != null, nameof(iter));
|
||||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1340,12 +1357,14 @@ public class DoubleMessageArgument : BasicMessageArgument
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(msg != null, nameof(msg));
|
||||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(iter != null, nameof(iter));
|
||||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1371,12 +1390,14 @@ public abstract class StringLikeMessageArgument : BasicMessageArgument
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(msg != null, nameof(msg));
|
||||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(iter != null, nameof(iter));
|
||||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1522,12 +1543,14 @@ public class UnixFdMessageArgument : BasicMessageArgument
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.Message msg)
|
protected override bool InternalAppendTo(eldbus.Message msg)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(msg != null, nameof(msg));
|
||||||
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
return eldbus_message_arguments_append(msg.Handle, Signature, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||||
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
protected override bool InternalAppendTo(eldbus.MessageIterator iter)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(iter != null, nameof(iter));
|
||||||
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
return eldbus_message_iter_basic_append(iter.Handle, TypeCode, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics.Contracts;
|
||||||
|
|
||||||
using static eldbus.EldbusMessageNativeFunctions;
|
using static eldbus.EldbusMessageNativeFunctions;
|
||||||
|
|
||||||
|
@ -773,6 +774,7 @@ public class MessageIterator
|
||||||
/// <returns>A <see cref="eldbus.MessageIterator" />.</returns>
|
/// <returns>A <see cref="eldbus.MessageIterator" />.</returns>
|
||||||
public eldbus.MessageIterator AppendOpenContainer(string signature)
|
public eldbus.MessageIterator AppendOpenContainer(string signature)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(signature != null, nameof(signature));
|
||||||
CheckHandle();
|
CheckHandle();
|
||||||
|
|
||||||
IntPtr new_iter = IntPtr.Zero;
|
IntPtr new_iter = IntPtr.Zero;
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics.Contracts;
|
||||||
|
|
||||||
using static eldbus.EldbusProxyNativeFunctions;
|
using static eldbus.EldbusProxyNativeFunctions;
|
||||||
|
|
||||||
|
@ -123,6 +124,7 @@ public class Proxy : IDisposable
|
||||||
/// <param name="_interface">The interface name.</param>
|
/// <param name="_interface">The interface name.</param>
|
||||||
public Proxy(eldbus.Object obj, string _interface)
|
public Proxy(eldbus.Object obj, string _interface)
|
||||||
{
|
{
|
||||||
|
Contract.Requires(obj != null, nameof(obj));
|
||||||
InitNew(eldbus_proxy_get(obj.Handle, _interface), true);
|
InitNew(eldbus_proxy_get(obj.Handle, _interface), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue