Exemplo n.º 1
0
        internal static void BindSafehandle(Notification notification)
        {
            int applist;

            Interop.Notification.GetApplist(notification.Handle, out applist);

            if ((applist & (int)NotificationDisplayApplist.Lock) != 0)
            {
                string path;
                Notification.LockStyle lockStyle = new Notification.LockStyle();

                Interop.Notification.GetImage(notification.Handle, NotificationImage.IconForLock, out path);
                lockStyle.IconPath = path;

                Interop.Notification.GetImage(notification.Handle, NotificationImage.ThumbnailForLock, out path);
                lockStyle.ThumbnailPath = path;

                notification.AddStyle(lockStyle);
            }
        }
Exemplo n.º 2
0
        internal static void BindObject(Notification notification)
        {
            int flag;
            NotificationError ret = NotificationError.None;

            Notification.LockStyle style = (Notification.LockStyle)notification.GetStyle("Lock");

            ret = Interop.Notification.SetImage(notification.Handle, NotificationImage.IconForLock, style.IconPath);
            if (ret != NotificationError.None)
            {
                throw NotificationErrorFactory.GetException(ret, "unable to set lock icon");
            }

            ret = Interop.Notification.SetImage(notification.Handle, NotificationImage.ThumbnailForLock, style.ThumbnailPath);
            if (ret != NotificationError.None)
            {
                throw NotificationErrorFactory.GetException(ret, "unable to set lock thumbnail");
            }

            Interop.Notification.GetApplist(notification.Handle, out flag);
            Interop.Notification.SetApplist(notification.Handle, flag | (int)NotificationDisplayApplist.Lock);
        }