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