Inheritance: IDisposable
Esempio n. 1
0
		public AccessControl (Context context, ObjectPath opath)
		{
			this.access_control = context.GetObject<IAccessControl> (opath);
			
			access_control.ACLAdded += OnACLAdded;
			access_control.ACLRemoved += OnACLRemoved;
		}
Esempio 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;
        }
Esempio 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;
		}
Esempio 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;
		}
Esempio n. 5
0
 public static string[] GetAllUdis(Context ctx)
 {
     return FindUdis(ctx, FindBy.MatchAll, null, null);
 }
Esempio n. 6
0
 public static Device[] GetAll(Context ctx)
 {
     return UdisToDevices(ctx, GetAllUdis(ctx));
 }
Esempio 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;
        }
Esempio n. 8
0
		public LightSensor (Context context, ObjectPath opath)
		{
			this.light_sensor = context.GetObject<ILightSensor> (opath);
		}
Esempio n. 9
0
		public Volume (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
		public SystemPowerManagement (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
Esempio n. 11
0
		public LaptopPanel (Context context, ObjectPath opath)
		{
			this.laptop_panel = context.GetObject<ILaptopPanel> (opath);
		}
Esempio n. 12
0
		public AccessControl (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
Esempio n. 13
0
		public Storage (Context context, ObjectPath opath)
		{
			this.storage = context.GetObject<IStorage> (opath);
		}
Esempio n. 14
0
		public Storage (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
Esempio n. 15
0
		public VolumeCrypto (Context context, ObjectPath opath)
		{
			this.crypto = context.GetObject<IVolumeCrypto> (opath);
		}
Esempio n. 16
0
		public KillSwitch (Context context, ObjectPath opath)
		{
			this.killswitch = context.GetObject<IKillSwitch> (opath);
		}
Esempio n. 17
0
		public KillSwitch (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
Esempio 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;
        }
Esempio 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);
 }
Esempio n. 20
0
		public LaptopPanel (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
Esempio n. 21
0
 public static Device[] FindByCapability(Context ctx, string cap)
 {
     return UdisToDevices(ctx, FindUdiByCapability(ctx, cap));
 }
Esempio n. 22
0
 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))
		{
		}
Esempio n. 24
0
 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);
		}
Esempio n. 26
0
 public static string[] FindUdiByStringMatch(Context ctx, string key, 
     string val)
 {
     return FindUdis(ctx, FindBy.StringMatch, key, val);
 }
Esempio n. 27
0
		public Volume (Context context, ObjectPath opath)
		{
			this.volume = context.GetObject<IVolume> (opath);
		}
Esempio n. 28
0
		public LightSensor (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}