Inheritance: IDisposable
Exemplo n.º 1
0
		public AccessControl (Context context, ObjectPath opath)
		{
			this.access_control = context.GetObject<IAccessControl> (opath);
			
			access_control.ACLAdded += OnACLAdded;
			access_control.ACLRemoved += OnACLRemoved;
		}
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
		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;
		}
Exemplo n.º 4
0
		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;
		}
Exemplo n.º 5
0
 public static string[] GetAllUdis(Context ctx)
 {
     return FindUdis(ctx, FindBy.MatchAll, null, null);
 }
Exemplo n.º 6
0
 public static Device[] GetAll(Context ctx)
 {
     return UdisToDevices(ctx, GetAllUdis(ctx));
 }
Exemplo n.º 7
0
        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;
        }
Exemplo n.º 8
0
		public LightSensor (Context context, ObjectPath opath)
		{
			this.light_sensor = context.GetObject<ILightSensor> (opath);
		}
Exemplo n.º 9
0
		public Volume (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
Exemplo n.º 10
0
		public SystemPowerManagement (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
Exemplo n.º 11
0
		public LaptopPanel (Context context, ObjectPath opath)
		{
			this.laptop_panel = context.GetObject<ILaptopPanel> (opath);
		}
Exemplo n.º 12
0
		public AccessControl (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
Exemplo n.º 13
0
		public Storage (Context context, ObjectPath opath)
		{
			this.storage = context.GetObject<IStorage> (opath);
		}
Exemplo n.º 14
0
		public Storage (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
Exemplo n.º 15
0
		public VolumeCrypto (Context context, ObjectPath opath)
		{
			this.crypto = context.GetObject<IVolumeCrypto> (opath);
		}
Exemplo n.º 16
0
		public KillSwitch (Context context, ObjectPath opath)
		{
			this.killswitch = context.GetObject<IKillSwitch> (opath);
		}
Exemplo n.º 17
0
		public KillSwitch (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
Exemplo n.º 18
0
        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;
        }
Exemplo n.º 19
0
 // static members
 public static bool DeviceExists(Context ctx, string udi)
 {
     return ctx == null ? false : Unmanaged.libhal_device_exists(ctx.Raw, udi, IntPtr.Zero);
 }
Exemplo n.º 20
0
		public LaptopPanel (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
Exemplo n.º 21
0
 public static Device[] FindByCapability(Context ctx, string cap)
 {
     return UdisToDevices(ctx, FindUdiByCapability(ctx, cap));
 }
Exemplo n.º 22
0
 public static Device[] FindByStringMatch(Context ctx, string key, 
     string val)
 {
     return UdisToDevices(ctx, FindUdiByStringMatch(ctx, key, val));
 }
Exemplo n.º 23
0
		public SystemPowerManagement (Context context)
			: this (context, new ObjectPath (root_path))
		{
		}
Exemplo n.º 24
0
 public static string[] FindUdiByCapability(Context ctx, string cap)
 {
     return FindUdis(ctx, FindBy.Capability, null, cap);
 }
Exemplo n.º 25
0
		public SystemPowerManagement (Context context, ObjectPath opath)
		{
			this.power_management = context.GetObject<ISystemPowerManagement> (opath);
		}
Exemplo n.º 26
0
 public static string[] FindUdiByStringMatch(Context ctx, string key, 
     string val)
 {
     return FindUdis(ctx, FindBy.StringMatch, key, val);
 }
Exemplo n.º 27
0
		public Volume (Context context, ObjectPath opath)
		{
			this.volume = context.GetObject<IVolume> (opath);
		}
Exemplo n.º 28
0
		public LightSensor (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}