index.html
Main Page
|
modules.html
Modules
|
namespaces.html
Namespace List
|
hierarchy.html
Class Hierarchy
|
annotated.html
Data Structures
|
dirs.html
Directories
|
files.html
File List
|
namespacemembers.html
Namespace Members
|
functions.html
Data Fields
|
pages.html
Related Pages
dir_000000.html
mono
&raquo
dir_000001.html
DBusType
Byte.cs
00001
using
System;
00002
using
System.Runtime.InteropServices;
00003
using
System.Reflection.Emit;
00004
00005
using
DBus;
00006
00007
namespace
DBus.DBusType
00008 {
classDBus_1_1DBusType_1_1Byte.html
00012
public
class
classDBus_1_1DBusType_1_1Byte.html
Byte
:
interfaceDBus_1_1DBusType_1_1IDBusType.html
IDBusType
00013   {
classDBus_1_1DBusType_1_1Byte.html#o0
00014
public
const
char
Code =
'y'
;
00015
private
System.Byte val;
00016
00017
private
classDBus_1_1DBusType_1_1Byte.html
Byte
()
00018     {
00019     }
00020
classDBus_1_1DBusType_1_1Byte.html#a0
00021
public
classDBus_1_1DBusType_1_1Byte.html
Byte
(System.Byte val,
classDBus_1_1Service.html
Service
service)
00022     {
00023
this
.val = val;
00024     }
00025
classDBus_1_1DBusType_1_1Byte.html#a1
00026
public
classDBus_1_1DBusType_1_1Byte.html
Byte
(System.Char val,
classDBus_1_1Service.html
Service
service)
00027     {
00028
this
.val = (byte) val;
00029     }
00030
classDBus_1_1DBusType_1_1Byte.html#a2
00031
public
classDBus_1_1DBusType_1_1Byte.html
Byte
(IntPtr iter,
classDBus_1_1Service.html
Service
service)
00032     {
00033
group__DBusMessage.html#ga35
dbus_message_iter_get_basic
(iter, out
this
.val);
00034       }
00035
classDBus_1_1DBusType_1_1Byte.html#a3
00036
public
void
Append(IntPtr iter)
00037     {
00038
if
(!
group__DBusMessage.html#ga43
dbus_message_iter_append_basic
(iter, (
int
) Code, ref val))
00039
throw
new
ApplicationException(
"Failed to append BYTE argument:"
+ val);
00040     }
00041
classDBus_1_1DBusType_1_1Byte.html#e0
00042
public
static
bool
Suits(System.Type type)
00043     {
00044
if
(type.IsEnum && Enum.GetUnderlyingType (type) == typeof(System.Byte)) {
00045
return
true
;
00046       }
00047
00048
switch
(type.ToString()) {
00049
case
"System.Byte"
:
00050
case
"System.Byte&"
:
00051
case
"System.Char"
:
00052
case
"System.Char&"
:
00053
return
true
;
00054       }
00055
00056
return
false
;
00057     }
00058
classDBus_1_1DBusType_1_1Byte.html#e1
00059
public
static
void
EmitMarshalIn(ILGenerator generator, Type type)
00060     {
00061
if
(type.IsByRef) {
00062         generator.Emit(OpCodes.Ldind_U1);
00063       }
00064     }
00065
classDBus_1_1DBusType_1_1Byte.html#e2
00066
public
static
void
EmitMarshalOut(ILGenerator generator, Type type,
bool
isReturn)
00067     {
00068       generator.Emit(OpCodes.Unbox, type);
00069       generator.Emit(OpCodes.Ldind_U1);
00070
if
(!isReturn) {
00071         generator.Emit(OpCodes.Stind_I1);
00072       }
00073     }
00074
classDBus_1_1DBusType_1_1Byte.html#a4
00075
public
object Get()
00076     {
00077
return
this
.val;
00078     }
00079
classDBus_1_1DBusType_1_1Byte.html#a5
00080
public
object Get(System.Type type)
00081     {
00082
if
(type.IsEnum) {
00083
return
Enum.ToObject(type,
this
.val);
00084       }
00085
00086
switch
(type.ToString()) {
00087
case
"System.Byte"
:
00088
case
"System.Byte&"
:
00089
return
this
.val;
00090
case
"System.Char"
:
00091
case
"System.Char&"
:
00092
char
charVal = (char)
this
.val;
00093
return
charVal;
00094
default
:
00095
throw
new
ArgumentException(
"Cannot cast DBus.Type.Byte to type '"
+ type.ToString() +
"'"
);
00096       }
00097     }
00098
00099     [DllImport(
"dbus-1"
)]
00100
private
extern
static
void
group__DBusMessage.html#ga35
dbus_message_iter_get_basic
(IntPtr iter, out byte value);
00101
00102     [DllImport(
"dbus-1"
)]
00103
private
extern
static
bool
group__DBusMessage.html#ga43
dbus_message_iter_append_basic
(IntPtr iter,
int
type, ref byte value);
00104   }
00105 }
Generated on Tue Sep 13 01:28:06 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
