예제 #1
0
        private bool InternetStatus()
        {
            switch (Global.CheckInternetConnection())
            {
            case "None":
                if (MeteredNotification != null && MeteredNotification.GetHeight() > 0)
                {
                    MeteredNotification.DestroyNotification();
                }
                if (NoInternetConnection == null)
                {
                    NoInternetConnection = this.Notifications.CreateNotification("NoInternetNotification", "No internet connection", "Error", false);
                }
                if (NoInternetConnection != null && NoInternetConnection.GetHeight() == 0)
                {
                    NoInternetConnection.ShowNotification();
                }
                return(false);

            case "Metered":
                if (NoInternetConnection != null && NoInternetConnection.GetHeight() > 0)
                {
                    NoInternetConnection.DestroyNotification();
                }
                if (ConnectionDismiss == false)
                {
                    if (MeteredNotification == null)
                    {
                        MeteredNotification = this.Notifications.CreateNotification("MeteredNotification", "On metered connection", "Warning");
                    }
                    if (MeteredNotification != null && MeteredNotification.GetHeight() == 0)
                    {
                        MeteredNotification.ShowNotification();
                    }
                }
                break;

            case "Wifi":
                ConnectionDismiss = false;
                if (NoInternetConnection != null && NoInternetConnection.GetHeight() > 0)
                {
                    NoInternetConnection.DestroyNotification();
                }
                if (MeteredNotification != null && MeteredNotification.GetHeight() > 0)
                {
                    MeteredNotification.DestroyNotification();
                }
                break;

            default:
                break;
            }

            return(true);
        }
예제 #2
0
    protected void Checkbtn_Click(object sender, EventArgs e)
    {
        NotificationControl.NoteType      = "error";
        NotificationControl.NewNoteHeader = "Oopss.....";
        NotificationControl.NewMessage    = "it works";
        NotificationControl.NoteVisible   = true;

        NotificationControl.ShowNotification();
        //NotificationControl
        //notificationdiv.Visible = true;
        // notediv.Visible = true;
        //notediv.Attributes["class"]= "alert alert-danger alert-dismissible fade show";
        //notediv.InnerHtml = "<button type='button' class='close' data-dismiss='alert' aria-label='Close'><span aria-hidden='true'>&times;</span></button> <strong> Holy guacamole!</strong> You should check in on some of those fields below.";
    }