2 using System.Collections.Generic;
4 namespace Tizen.Applications.AttachPanel
6 public partial class AttachPanel
8 private void StateEventListenStart()
10 Interop.AttachPanel.ErrorCode err = 0;
12 SetEventListener = (attachPanel, eventType, eventInfo, userData) =>
14 _eventEventHandler?.Invoke(null, new StateEventArgs(attachPanel, (EventType)eventType, eventInfo, userData));
16 err = Interop.AttachPanel.SetEventCb(_attachPanel, SetEventListener, IntPtr.Zero);
19 private void StateEventListenStop()
21 Interop.AttachPanel.ErrorCode err = 0;
22 err = Interop.AttachPanel.UnsetEventCb(_attachPanel);
26 private void ResultEventListenStart()
28 Interop.AttachPanel.ErrorCode err = 0;
29 SetResultListener = (attachPanel, category, resulthandler, resultCode, userData) =>
31 SafeAppControlHandle handle = new SafeAppControlHandle(resulthandler, false);
32 AppControl result = new AppControl(handle);
33 _resultEventHandler?.Invoke(null, new ResultEventArgs(attachPanel, (ContentCategory)category, result, (AppControlReplyResult)resultCode, userData));
35 err = Interop.AttachPanel.SetResultCb(_attachPanel, SetResultListener, IntPtr.Zero);
39 private void ResultEventListenStop()
41 Interop.AttachPanel.ErrorCode err = 0;
42 err = Interop.AttachPanel.UnsetResultCb(_attachPanel);
46 internal static void checkException(Interop.AttachPanel.ErrorCode err)
50 case Interop.AttachPanel.ErrorCode.InvalidParameter:
51 throw new InvalidOperationException("Invalid parameter error at unmanaged code");
52 case Interop.AttachPanel.ErrorCode.OutOfMemory:
53 throw new InvalidOperationException("Out of Memory");
54 case Interop.AttachPanel.ErrorCode.PermissionDenied:
55 throw new UnauthorizedAccessException();
56 case Interop.AttachPanel.ErrorCode.AlreadyExists:
57 throw new InvalidOperationException("Already Exists");
58 case Interop.AttachPanel.ErrorCode.NotInitialized:
59 throw new InvalidOperationException("Not initialized");
60 case Interop.AttachPanel.ErrorCode.UnsupportedContentCategory:
61 throw new InvalidOperationException("Unsupported Content Category");
62 case Interop.AttachPanel.ErrorCode.AlreadyDestroyed:
63 throw new InvalidOperationException("Already Destroyed");