public static implicit operator Value(byte x)
{
var v = new Eina.Value(ValueType.Byte);
- if (!v.Set(x))
- {
- throw new InvalidOperationException("Couldn't set value.");
- }
+ v.Set(x);
return v;
}
public static implicit operator byte(Value v)
{
byte b;
- if (!v.Get(out b))
- {
- throw new InvalidOperationException("Couldn't get value.");
- }
+ v.Get(out b);
return b;
}
public static implicit operator Value(sbyte x)
{
var v = new Eina.Value(ValueType.SByte);
- if (!v.Set(x))
- {
- throw new InvalidOperationException("Couldn't set value.");
- }
+ v.Set(x);
return v;
}
public static implicit operator sbyte(Value v)
{
sbyte b;
- if (!v.Get(out b))
- {
- throw new InvalidOperationException("Couldn't get value.");
- }
+ v.Get(out b);
return b;
}
public static implicit operator Value(short x)
{
var v = new Eina.Value(ValueType.Short);
- if (!v.Set(x))
- {
- throw new InvalidOperationException("Couldn't set value.");
- }
+ v.Set(x);
return v;
}
public static implicit operator short(Value v)
{
short b;
- if (!v.Get(out b))
- {
- throw new InvalidOperationException("Couldn't get value.");
- }
+ v.Get(out b);
return b;
}
public static implicit operator Value(ushort x)
{
var v = new Eina.Value(ValueType.UShort);
- if (!v.Set(x))
- {
- throw new InvalidOperationException("Couldn't set value.");
- }
+ v.Set(x);
return v;
}
public static implicit operator ushort(Value v)
{
ushort b;
- if (!v.Get(out b))
- {
- throw new InvalidOperationException("Couldn't get value.");
- }
+ v.Get(out b);
return b;
}
public static implicit operator Value(int x)
{
var v = new Eina.Value(ValueType.Int32);
- if (!v.Set(x))
- {
- throw new InvalidOperationException("Couldn't set value.");
- }
+ v.Set(x);
return v;
}
public static implicit operator int(Value v)
{
int b;
- if (!v.Get(out b))
- {
- throw new InvalidOperationException("Couldn't get value.");
- }
+ v.Get(out b);
return b;
}
public static implicit operator Value(uint x)
{
var v = new Eina.Value(ValueType.UInt32);
- if (!v.Set(x))
- {
- throw new InvalidOperationException("Couldn't set value.");
- }
+ v.Set(x);
return v;
}
public static implicit operator uint(Value v)
{
uint b;
- if (!v.Get(out b))
- {
- throw new InvalidOperationException("Couldn't get value.");
- }
+ v.Get(out b);
return b;
}
public static implicit operator Value(long x)
{
var v = new Eina.Value(ValueType.Long);
- if (!v.Set(x))
- {
- throw new InvalidOperationException("Couldn't set value.");
- }
+ v.Set(x);
return v;
}
public static implicit operator long(Value v)
{
long b;
- if (!v.Get(out b))
- {
- throw new InvalidOperationException("Couldn't get value.");
- }
+ v.Get(out b);
return b;
}
public static implicit operator Value(ulong x)
{
var v = new Eina.Value(ValueType.ULong);
- if (!v.Set(x))
- {
- throw new InvalidOperationException("Couldn't set value.");
- }
+ v.Set(x);
return v;
}
public static implicit operator ulong(Value v)
{
ulong b;
- if (!v.Get(out b))
- {
- throw new InvalidOperationException("Couldn't get value.");
- }
+ v.Get(out b);
return b;
}
public static implicit operator Value(float x)
{
var v = new Eina.Value(ValueType.Float);
- if (!v.Set(x))
- {
- throw new InvalidOperationException("Couldn't set value.");
- }
+ v.Set(x);
return v;
}
public static implicit operator float(Value v)
{
float b;
- if (!v.Get(out b))
- {
- throw new InvalidOperationException("Couldn't get value.");
- }
+ v.Get(out b);
return b;
}
public static implicit operator Value(double x)
{
var v = new Eina.Value(ValueType.Double);
- if (!v.Set(x))
- {
- throw new InvalidOperationException("Couldn't set value.");
- }
+ v.Set(x);
return v;
}
public static implicit operator double(Value v)
{
double b;
- if (!v.Get(out b))
- {
- throw new InvalidOperationException("Couldn't get value.");
- }
+ v.Get(out b);
return b;
}
public static implicit operator Value(string x)
{
var v = new Eina.Value(ValueType.String);
- if (!v.Set(x))
- {
- throw new InvalidOperationException("Couldn't set value.");
- }
+ v.Set(x);
return v;
}
public static implicit operator string(Value v)
{
string b;
- if (!v.Get(out b))
- {
- throw new InvalidOperationException("Couldn't get value.");
- }
+ v.Get(out b);
return b;
}
public static explicit operator Value(Efl.Object obj)
{
var v = new Eina.Value(ValueType.Object);
- if (!v.Set(obj))
- {
- throw new InvalidOperationException("Couldn't set value.");
- }
+ v.Set(obj);
return v;
}
public static explicit operator Efl.Object(Value v)
{
Efl.Object obj;
- if (!v.Get(out obj))
- {
- throw new InvalidOperationException("Couldn't get value.");
- }
+ v.Get(out obj);
return obj;
}