Ejemplo n.º 1
0
        private void notifyMessange(string message, string hotennguoigui)
        {
            DevExpress.XtraBars.ToastNotifications.ToastNotification toastNotification1 = new DevExpress.XtraBars.ToastNotifications.ToastNotification();
            toastNotifiManager = new DevExpress.XtraBars.ToastNotifications.ToastNotificationsManager(this.components);
            toastNotifiManager.ApplicationId   = hotennguoigui;
            toastNotifiManager.ApplicationName = "CLB Tình nguyện Sinh viên Duy Tân";
            toastNotification1.Body            = message;
            toastNotification1.Header          = "Tin nhắn mới";
            toastNotification1.ID       = "faf7a0e2-d33b-46fb-8b40-6eb35e31192a";
            toastNotification1.Image    = global::CDIO_QLCLB.Properties.Resources.logo;
            toastNotification1.Template = DevExpress.XtraBars.ToastNotifications.ToastNotificationTemplate.ImageAndText03;
            toastNotification1.Body2    = "https://www.facebook.com/CLBTinhNguyenSinhVienDuyTan";
            toastNotifiManager.Notifications.AddRange(new DevExpress.XtraBars.ToastNotifications.IToastNotificationProperties[] { toastNotification1 });

            toastNotifiManager.ShowNotification(toastNotifiManager.Notifications[0]);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Used to show a message using the Alert Control or Toast Notification Manager
        /// </summary>
        /// <param name="title"></param>
        /// <param name="message"></param>
        /// <param name="showTime"></param>
        /// <param name="longText"></param>
        /// <param name="image"></param>
        public void ShowNotification(string title, string message, int showTime, bool longText, Image image)
        {
            try
            {
                Version win8version = new Version(6, 2, 9200, 0);

                if (Environment.OSVersion.Platform == PlatformID.Win32NT &&
                    Environment.OSVersion.Version >= win8version)
                {
                    var toastNotification = ToastNotificationsManager.Notifications[0];
                    toastNotification.Header   = title;
                    toastNotification.Body     = message;
                    toastNotification.Image    = image;
                    toastNotification.Sound    = DevExpress.XtraBars.ToastNotifications.ToastNotificationSound.NoSound;
                    toastNotification.Duration = showTime > 7000 ? DevExpress.XtraBars.ToastNotifications.ToastNotificationDuration.Long : DevExpress.XtraBars.ToastNotifications.ToastNotificationDuration.Default;
                    ToastNotificationsManager.ShowNotification(ToastNotificationsManager.Notifications[0].ID);
                }
                else
                {
                    NotificationManager.AutoFormDelay = showTime;
                    NotificationManager.AutoHeight    = longText;
                    if (image != null)
                    {
                        NotificationManager.Show(instance, title, message, image);
                    }
                    else
                    {
                        NotificationManager.Show(instance, title, message);
                    }
                }
            }
            catch (Exception ex)
            {
                if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex))
                {
                    throw ex;
                }
            }
        }
Ejemplo n.º 3
0
        public void toastnotifiManager()
        {
            caseData.txtRead        txtread = new caseData.txtRead();
            logical.GgSheetAPI      ggsheet = new logical.GgSheetAPI();
            string[]                idTable = txtread.readfile(0);
            IList <IList <Object> > values  = ggsheet.docfile(idTable[1], idTable[2]);

            for (int i = values.Count - 1; i >= 0; i--)
            {
                var row = values[i];
                if (row.Count < 13 && row.Count > 0)
                {
                    DateTime sigupTime = Convert.ToDateTime(row[0]);
                    DateTime datenow   = DateTime.Now;
                    TimeSpan timeSpan  = datenow - sigupTime;
                    if (timeSpan.TotalSeconds < 30)
                    {
                        DevExpress.XtraBars.ToastNotifications.ToastNotification toastNotification1 = new DevExpress.XtraBars.ToastNotifications.ToastNotification();
                        toastNotifiManager = new DevExpress.XtraBars.ToastNotifications.ToastNotificationsManager(this.components);
                        toastNotifiManager.ApplicationId   = row[0].ToString();
                        toastNotifiManager.ApplicationName = "CLB Tình nguyện Sinh viên Duy Tân";
                        toastNotification1.Body            = row[2].ToString() + " " + row[3].ToString();
                        toastNotification1.Header          = "Đăng ký thành viên mới";
                        toastNotification1.ID       = "faf7a0e2-d33b-46fb-8b40-6eb35e31192a";
                        toastNotification1.Image    = global::CDIO_QLCLB.Properties.Resources.logo;
                        toastNotification1.Template = DevExpress.XtraBars.ToastNotifications.ToastNotificationTemplate.ImageAndText03;
                        toastNotification1.Body2    = "https://www.facebook.com/CLBTinhNguyenSinhVienDuyTan";
                        toastNotifiManager.Notifications.AddRange(new DevExpress.XtraBars.ToastNotifications.IToastNotificationProperties[] { toastNotification1 });

                        toastNotifiManager.ShowNotification(toastNotifiManager.Notifications[0]);
                    }
                }
                else
                {
                    break;
                }
            }
        }