2005-11-26 Aaron Bockover <aaron@aaronbock.net>

* src/HalContext.cs: New Parent property that returns an instantiated
    Hal.Device object based on the info.parent HAL property, which returns     a UDI of a device's parent; added Context property to return the Device's
    HAL Context


svn path=/trunk/hal-sharp/; revision=53509
This commit is contained in:
Aaron Bockover 2005-11-26 18:33:40 +00:00
Родитель 360c41bcc7
Коммит c0d83bec7b
2 изменённых файлов: 28 добавлений и 0 удалений

Просмотреть файл

@ -1,3 +1,10 @@
2005-11-26 Aaron Bockover <aaron@aaronbock.net>
* src/HalContext.cs: New Parent property that returns an instantiated
Hal.Device object based on the info.parent HAL property, which returns
a UDI of a device's parent; added Context property to return the Device's
HAL Context
2005-11-18 Aaron Bockover <aaron@aaronbock.net>
* src/HalContext.cs:

Просмотреть файл

@ -211,6 +211,27 @@ namespace Hal
}
}
public Device Parent {
get {
if(!PropertyExists("info.parent")) {
return null;
}
string parent_udi = this["info.parent"];
if(parent_udi != null && parent_udi != String.Empty) {
return new Device(ctx, parent_udi);
}
return null;
}
}
public Context Context {
get {
return ctx;
}
}
public override string ToString()
{
return udi;