2 * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 namespace Tizen.Applications.NotificationEventListener
19 internal static class NotificationAccessoryAgsBinder
21 internal static void BindObject(NotificationEventArgs eventargs)
27 NotificationEventArgs.AccessoryArgs accessory = new NotificationEventArgs.AccessoryArgs();
29 Interop.NotificationEventListener.GetLed(eventargs.Handle, out type, out color);
30 accessory.LedOption = type;
31 if (type != AccessoryOption.Off)
35 Interop.NotificationEventListener.GetLedTime(eventargs.Handle, out on, out off);
36 accessory.LedOnMillisecond = on;
37 accessory.LedOffMillisecond = off;
39 if (type == AccessoryOption.Custom)
41 accessory.LedColor = new Common.Color(color >> 16 & 255, color >> 8 & 255, color >> 0 & 255, color >> 24 & 255);
45 Interop.NotificationEventListener.GetSound(eventargs.Handle, out type, out path);
46 accessory.SoundOption = type;
47 if (type == AccessoryOption.Custom)
49 accessory.SountPath = path;
52 Interop.NotificationEventListener.GetVibration(eventargs.Handle, out type, out path);
53 if (type == AccessoryOption.Off)
55 accessory.CanVibrate = false;
59 accessory.CanVibrate = true;
62 eventargs.Accessory = accessory;