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
ObjectPath.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_1ObjectPath.html
00012
public
class
classDBus_1_1DBusType_1_1ObjectPath.html
ObjectPath
:
interfaceDBus_1_1DBusType_1_1IDBusType.html
IDBusType
00013   {
classDBus_1_1DBusType_1_1ObjectPath.html#o0
00014
public
const
char
Code =
'o'
;
00015
private
string path = null;
00016
private
object val = null;
00017
private
classDBus_1_1Service.html
Service
service = null;
00018
00019
private
classDBus_1_1DBusType_1_1ObjectPath.html
ObjectPath
()
00020     {
00021     }
00022
classDBus_1_1DBusType_1_1ObjectPath.html#a0
00023
public
classDBus_1_1DBusType_1_1ObjectPath.html
ObjectPath
(object val,
classDBus_1_1Service.html
Service
service)
00024     {
00025
this
.val = val;
00026
this
.service = service;
00027     }
00028
classDBus_1_1DBusType_1_1ObjectPath.html#a1
00029
public
classDBus_1_1DBusType_1_1ObjectPath.html
ObjectPath
(IntPtr iter,
classDBus_1_1Service.html
Service
service)
00030     {
00031       IntPtr raw;
00032
00033
group__DBusMessage.html#ga35
dbus_message_iter_get_basic
(iter, out raw);
00034
00035
this
.path = Marshal.PtrToStringAnsi (raw);
00036
this
.service = service;
00037     }
00038
00039
private
string Path
00040     {
00041       get {
00042
if
(
this
.path == null &&
this
.val != null) {
00043
classDBus_1_1Handler.html
Handler
handler =
this
.service.
classDBus_1_1Service.html#d1
GetHandler
(
this
.val);
00044
this
.
classDBus_1_1Handler.html#r0
path
= handler.
classDBus_1_1Handler.html#01
Path
;
00045         }
00046
00047
return
this
.path;
00048       }
00049     }
00050
classDBus_1_1DBusType_1_1ObjectPath.html#a2
00051
public
void
Append(IntPtr iter)
00052     {
00053       IntPtr marshalVal = Marshal.StringToHGlobalAnsi (Path);
00054
00055
bool
success =
group__DBusMessage.html#ga43
dbus_message_iter_append_basic
(iter, (
int
) Code, ref marshalVal);
00056       Marshal.FreeHGlobal (marshalVal);
00057
00058
if
(!success)
00059
throw
new
ApplicationException(
"Failed to append OBJECT_PATH argument:"
+ val);
00060     }
00061
classDBus_1_1DBusType_1_1ObjectPath.html#e0
00062
public
static
bool
Suits(System.Type type)
00063     {
00064       object[] attributes = type.GetCustomAttributes(typeof(
classDBus_1_1InterfaceAttribute.html
InterfaceAttribute
),
false
);
00065
if
(attributes.Length == 1) {
00066
return
true
;
00067       }
else
{
00068
return
false
;
00069       }
00070     }
00071
classDBus_1_1DBusType_1_1ObjectPath.html#e1
00072
public
static
void
EmitMarshalIn(ILGenerator generator, Type type)
00073     {
00074
if
(type.IsByRef) {
00075         generator.Emit(OpCodes.Ldind_Ref);
00076       }
00077     }
00078
classDBus_1_1DBusType_1_1ObjectPath.html#e2
00079
public
static
void
EmitMarshalOut(ILGenerator generator, Type type,
bool
isReturn)
00080     {
00081       generator.Emit(OpCodes.Castclass, type);
00082
if
(!isReturn) {
00083         generator.Emit(OpCodes.Stind_Ref);
00084       }
00085     }
00086
classDBus_1_1DBusType_1_1ObjectPath.html#a3
00087
public
object Get()
00088     {
00089
throw
new
ArgumentException(
"Cannot call Get on an ObjectPath without specifying type."
);
00090     }
00091
classDBus_1_1DBusType_1_1ObjectPath.html#a4
00092
public
object Get(System.Type type)
00093     {
00094
try
{
00095
return
this
.service.GetObject(type, Path);
00096       }
catch
(Exception ex) {
00097
throw
new
ArgumentException(
"Cannot cast object pointed to by Object Path to type '"
+ type.ToString() +
"': "
+ ex);
00098       }
00099     }
00100
00101     [DllImport(
"dbus-1"
)]
00102
private
extern
static
void
group__DBusMessage.html#ga35
dbus_message_iter_get_basic
(IntPtr iter, out IntPtr path);
00103
00104     [DllImport(
"dbus-1"
)]
00105
private
extern
static
bool
group__DBusMessage.html#ga43
dbus_message_iter_append_basic
(IntPtr iter,
int
type, ref IntPtr path);
00106   }
00107 }
Generated on Tue Sep 13 01:28:08 2005 for D-BUS by
http://www.doxygen.org/index.html
doxygen
1.4.4
