public AccessControl (Context context, ObjectPath opath) { this.access_control = context.GetObject<IAccessControl> (opath); access_control.ACLAdded += OnACLAdded; access_control.ACLRemoved += OnACLRemoved; }
public Device(Context ctx, string udi) { if(ctx == null) { throw new ApplicationException("Cannot create HAL device; context is null"); } this.ctx = ctx; this.udi = udi; }
public Manager (Context context) { this.context = context; this.manager = context.GetObject<IManager> (new ObjectPath ("/org/freedesktop/Hal/Manager")); manager.DeviceAdded += OnDeviceAdded; manager.DeviceRemoved += OnDeviceRemoved; manager.NewCapability += OnNewCapability; manager.GlobalInterfaceLockAcquired += OnGlobalInterfaceLockAcquired; manager.GlobalInterfaceLockReleased += OnGlobalInterfaceLockReleased; }
public Device (Context context, ObjectPath object_path) { this.context = context; this.object_path = object_path; this.device = context.GetObject<IDevice> (object_path); device.PropertyModified += OnPropertyModified; device.Condition += OnCondition; device.InterfaceLockAcquired += OnInterfaceLockAcquired; device.InterfaceLockReleased += OnInterfaceLockReleased; }
public static string[] GetAllUdis(Context ctx) { return FindUdis(ctx, FindBy.MatchAll, null, null); }
public static Device[] GetAll(Context ctx) { return UdisToDevices(ctx, GetAllUdis(ctx)); }
public static string[] FindUdis(Context ctx, FindBy findMethod, string key, string query) { IntPtr ptr; string [] deviceUdis; int device_count; if(ctx == null) { return new string[0]; } switch(findMethod) { case FindBy.StringMatch: ptr = Unmanaged.libhal_manager_find_device_string_match( ctx.Raw, key, query, out device_count, IntPtr.Zero); break; case FindBy.Capability: ptr = Unmanaged.libhal_find_device_by_capability(ctx.Raw, query, out device_count, IntPtr.Zero); break; case FindBy.MatchAll: default: ptr = Unmanaged.libhal_get_all_devices(ctx.Raw, out device_count, IntPtr.Zero); break; } deviceUdis = UnixMarshal.PtrToStringArray(device_count, ptr); Unmanaged.libhal_free_string_array(ptr); return deviceUdis; }
public LightSensor (Context context, ObjectPath opath) { this.light_sensor = context.GetObject<ILightSensor> (opath); }
public Volume (Context context, Device device) : this (context, device.ObjectPath) { }
public SystemPowerManagement (Context context, Device device) : this (context, device.ObjectPath) { }
public LaptopPanel (Context context, ObjectPath opath) { this.laptop_panel = context.GetObject<ILaptopPanel> (opath); }
public AccessControl (Context context, Device device) : this (context, device.ObjectPath) { }
public Storage (Context context, ObjectPath opath) { this.storage = context.GetObject<IStorage> (opath); }
public Storage (Context context, Device device) : this (context, device.ObjectPath) { }
public VolumeCrypto (Context context, ObjectPath opath) { this.crypto = context.GetObject<IVolumeCrypto> (opath); }
public KillSwitch (Context context, ObjectPath opath) { this.killswitch = context.GetObject<IKillSwitch> (opath); }
public KillSwitch (Context context, Device device) : this (context, device.ObjectPath) { }
public static Device[] UdisToDevices(Context ctx, string [] udis) { if(ctx == null) { return new Device[0]; } Device [] devices = new Device[udis.Length]; for(int i = 0; i < udis.Length; i++) { devices[i] = new Device(ctx, udis[i]); } return devices; }
// static members public static bool DeviceExists(Context ctx, string udi) { return ctx == null ? false : Unmanaged.libhal_device_exists(ctx.Raw, udi, IntPtr.Zero); }
public LaptopPanel (Context context, Device device) : this (context, device.ObjectPath) { }
public static Device[] FindByCapability(Context ctx, string cap) { return UdisToDevices(ctx, FindUdiByCapability(ctx, cap)); }
public static Device[] FindByStringMatch(Context ctx, string key, string val) { return UdisToDevices(ctx, FindUdiByStringMatch(ctx, key, val)); }
public SystemPowerManagement (Context context) : this (context, new ObjectPath (root_path)) { }
public static string[] FindUdiByCapability(Context ctx, string cap) { return FindUdis(ctx, FindBy.Capability, null, cap); }
public SystemPowerManagement (Context context, ObjectPath opath) { this.power_management = context.GetObject<ISystemPowerManagement> (opath); }
public static string[] FindUdiByStringMatch(Context ctx, string key, string val) { return FindUdis(ctx, FindBy.StringMatch, key, val); }
public Volume (Context context, ObjectPath opath) { this.volume = context.GetObject<IVolume> (opath); }
public LightSensor (Context context, Device device) : this (context, device.ObjectPath) { }