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 NotificationButtonActionArgBinder
21 internal static void BindObject(NotificationEventArgs eventargs, int index)
24 bool isExisted = false;
25 SafeAppControlHandle appcontrol = null;
26 NotificationEventArgs.ButtonActionArgs button = new NotificationEventArgs.ButtonActionArgs();
28 button.Index = (ButtonIndex)index;
30 Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.Button_1 + index, out text);
31 if (string.IsNullOrEmpty(text) == false)
34 button.ImagePath = text;
37 Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.FirstButton + index, out text);
38 if (string.IsNullOrEmpty(text) == false)
44 Interop.NotificationEventListener.GetEventHandler(eventargs.Handle, index, out appcontrol);
46 if (appcontrol != null && appcontrol.IsInvalid == false)
48 button.Action = new AppControl(appcontrol);
54 (eventargs.Style["Active"] as NotificationEventArgs.ActiveStyleArgs).Button.Add(button);