Inheritance: 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
ファイル: HalDevice.cs プロジェクト: mono/hal-sharp
        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
ファイル: Manager.cs プロジェクト: ArsenShnurkov/beagle-1
		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
ファイル: Device.cs プロジェクト: ArsenShnurkov/beagle-1
		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
ファイル: HalDevice.cs プロジェクト: mono/hal-sharp
 public static string[] GetAllUdis(Context ctx)
 {
     return FindUdis(ctx, FindBy.MatchAll, null, null);
 }
コード例 #6
0
ファイル: HalDevice.cs プロジェクト: mono/hal-sharp
 public static Device[] GetAll(Context ctx)
 {
     return UdisToDevices(ctx, GetAllUdis(ctx));
 }
コード例 #7
0
ファイル: HalDevice.cs プロジェクト: mono/hal-sharp
        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
ファイル: LightSensor.cs プロジェクト: ArsenShnurkov/beagle-1
		public LightSensor (Context context, ObjectPath opath)
		{
			this.light_sensor = context.GetObject<ILightSensor> (opath);
		}
コード例 #9
0
ファイル: Volume.cs プロジェクト: ArsenShnurkov/beagle-1
		public Volume (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
コード例 #10
0
		public SystemPowerManagement (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
コード例 #11
0
ファイル: LaptopPanel.cs プロジェクト: ArsenShnurkov/beagle-1
		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
ファイル: Storage.cs プロジェクト: ArsenShnurkov/beagle-1
		public Storage (Context context, ObjectPath opath)
		{
			this.storage = context.GetObject<IStorage> (opath);
		}
コード例 #14
0
ファイル: Storage.cs プロジェクト: ArsenShnurkov/beagle-1
		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
ファイル: KillSwitch.cs プロジェクト: ArsenShnurkov/beagle-1
		public KillSwitch (Context context, ObjectPath opath)
		{
			this.killswitch = context.GetObject<IKillSwitch> (opath);
		}
コード例 #17
0
ファイル: KillSwitch.cs プロジェクト: ArsenShnurkov/beagle-1
		public KillSwitch (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
コード例 #18
0
ファイル: HalDevice.cs プロジェクト: mono/hal-sharp
        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
ファイル: HalDevice.cs プロジェクト: mono/hal-sharp
 // 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
ファイル: LaptopPanel.cs プロジェクト: ArsenShnurkov/beagle-1
		public LaptopPanel (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}
コード例 #21
0
ファイル: HalDevice.cs プロジェクト: mono/hal-sharp
 public static Device[] FindByCapability(Context ctx, string cap)
 {
     return UdisToDevices(ctx, FindUdiByCapability(ctx, cap));
 }
コード例 #22
0
ファイル: HalDevice.cs プロジェクト: mono/hal-sharp
 public static Device[] FindByStringMatch(Context ctx, string key, 
     string val)
 {
     return UdisToDevices(ctx, FindUdiByStringMatch(ctx, key, val));
 }
コード例 #23
0
		public SystemPowerManagement (Context context)
			: this (context, new ObjectPath (root_path))
		{
		}
コード例 #24
0
ファイル: HalDevice.cs プロジェクト: mono/hal-sharp
 public static string[] FindUdiByCapability(Context ctx, string cap)
 {
     return FindUdis(ctx, FindBy.Capability, null, cap);
 }
コード例 #25
0
		public SystemPowerManagement (Context context, ObjectPath opath)
		{
			this.power_management = context.GetObject<ISystemPowerManagement> (opath);
		}
コード例 #26
0
ファイル: HalDevice.cs プロジェクト: mono/hal-sharp
 public static string[] FindUdiByStringMatch(Context ctx, string key, 
     string val)
 {
     return FindUdis(ctx, FindBy.StringMatch, key, val);
 }
コード例 #27
0
ファイル: Volume.cs プロジェクト: ArsenShnurkov/beagle-1
		public Volume (Context context, ObjectPath opath)
		{
			this.volume = context.GetObject<IVolume> (opath);
		}
コード例 #28
0
ファイル: LightSensor.cs プロジェクト: ArsenShnurkov/beagle-1
		public LightSensor (Context context, Device device)
			: this (context, device.ObjectPath)
		{
		}