Ejemplo n.º 1
0
        internal Notification Build()
        {
            IntPtr extension          = IntPtr.Zero;
            IntPtr extensionBundlePtr = IntPtr.Zero;

            NotificationBinder.BindSafeHandle(this);

            Interop.Notification.GetExtensionBundle(Handle, out extension, out extensionBundlePtr);

            if (extension != IntPtr.Zero)
            {
                Bundle bundle = new Bundle(new SafeBundleHandle(extension, false));
                foreach (string key in bundle.Keys)
                {
                    if (key.StartsWith("_NOTIFICATION_EXTENSION_EVENT_"))
                    {
                        continue;
                    }

                    SafeBundleHandle sbh;
                    Interop.Notification.GetExtensionData(Handle, key, out sbh);
                    extraDataDictionary.Add(key, new Bundle(sbh));
                }
            }

            ProgressBinder.BindSafeHandle(this);
            AccessorySetBinder.BindSafeHandle(this);
            IndicatorBinder.BindSafeHandle(this);
            ActiveBinder.BindSafeHandle(this);
            LockBinder.BindSafehandle(this);

            return(this);
        }
Ejemplo n.º 2
0
        internal void Make()
        {
            NotificationBinder.BindObject(this);

            foreach (string key in GetextraDataDictionary().Keys)
            {
                Log.Info(LogTag, "Start to bind Notification.ExtenderData to SafeHandle");
                Interop.Notification.SetExtensionData(Handle, key, extraDataDictionary[key].SafeBundleHandle);
            }

            foreach (Notification.StyleBase style in styleDictionary.Values)
            {
                Log.Info(LogTag, "Start to bind Notification.Style to SafeHandle [" + style.Key + "]");
                style.Make(this);
            }

            if (Accessory != null)
            {
                Log.Info(LogTag, "Start to bind Notification.AccessetSet to SafeHandle");
                Accessory.Make(this);
            }

            if (Progress != null)
            {
                Log.Info(LogTag, "Start to bind Notification.Progress to SafeHandle");
                Progress.Make(this);
            }
        }