зеркало из https://github.com/mono/hal-sharp.git
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:
Родитель
360c41bcc7
Коммит
c0d83bec7b
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче