Search This Blog

Sunday, 11 December 2016

Change

  var TapJustNow = new TapGestureRecognizer();
            TapJustNow.Tapped += TapJustNow_Tapped;
            slJustNow.GestureRecognizers.Add(TapJustNow);

            var Tap15MinAgo = new TapGestureRecognizer();
            Tap15MinAgo.Tapped += Tap15MinAgo_Tapped;
            sl15MintsAgo.GestureRecognizers.Add(Tap15MinAgo);

            var Tap30MinAgo = new TapGestureRecognizer();
            Tap30MinAgo.Tapped += Tap30MinAgo_Tapped;
            sl30Mints.GestureRecognizers.Add(Tap30MinAgo);

            var Tap1HourAgo = new TapGestureRecognizer();
            Tap1HourAgo.Tapped += Tap1HourAgo_Tapped;
            sl1HourAgo.GestureRecognizers.Add(Tap1HourAgo);

            var Tap2HourAgo = new TapGestureRecognizer();
            Tap2HourAgo.Tapped += Tap2HourAgo_Tapped;
            sl2HoursAgo.GestureRecognizers.Add(Tap2HourAgo);
        }
        private void TapJustNow_Tapped(object sender, EventArgs e)
        {
            imgchangeJustNow.Source = "med_select.png";
            imgchange15Minago.Source = "med_deselect.png";
            imgchange30Minago.Source = "med_deselect.png";
            imgchange1HourAgo.Source = "med_deselect.png";
            imgchange2HourAgo.Source = "med_deselect.png";
            DateTime oDate = Convert.ToDateTime(App.strDateTime);
            long milli = (long)(oDate - new DateTime(1970, 1, 1)).TotalMilliseconds;
            var milliseconds = 0 * 60000;
            var diff = milli - milliseconds;
            string strNewTime = TimeUtility.getDate(diff.ToString());
            lblMainTime.Text = strNewTime;
        }
        private void Tap15MinAgo_Tapped(object sender, EventArgs e)
        {
            imgchange15Minago.Source = "med_select.png";
            imgchangeJustNow.Source = "med_deselect.png";
            imgchange30Minago.Source = "med_deselect.png";
            imgchange1HourAgo.Source = "med_deselect.png";
            imgchange2HourAgo.Source = "med_deselect.png";
            DateTime oDate = Convert.ToDateTime(App.strDateTime);
            long milli = (long)(oDate - new DateTime(1970, 1, 1)).TotalMilliseconds;
            var milliseconds = 15 * 60000;
            var diff = milli - milliseconds;
            string strNewTime = TimeUtility.getDate(diff.ToString());
            lblMainTime.Text = strNewTime;
        }
        private void Tap30MinAgo_Tapped(object sender, EventArgs e)
        {
            imgchange30Minago.Source = "med_select.png";
            imgchangeJustNow.Source = "med_deselect.png";
            imgchange15Minago.Source = "med_deselect.png";
            imgchange1HourAgo.Source = "med_deselect.png";
            imgchange2HourAgo.Source = "med_deselect.png";
            DateTime oDate = Convert.ToDateTime(App.strDateTime);
            long milli = (long)(oDate - new DateTime(1970, 1, 1)).TotalMilliseconds;
            var milliseconds = 30 * 60000;
            var diff = milli - milliseconds;
            string strNewTime = TimeUtility.getDate(diff.ToString());
            lblMainTime.Text = strNewTime;
        }
        private void Tap1HourAgo_Tapped(object sender, EventArgs e)
        {
            imgchange1HourAgo.Source = "med_select.png";
            imgchangeJustNow.Source = "med_deselect.png";
            imgchange15Minago.Source = "med_deselect.png";
            imgchange30Minago.Source = "med_deselect.png";
            imgchange2HourAgo.Source = "med_deselect.png";
            DateTime oDate = Convert.ToDateTime(App.strDateTime);
            long milli = (long)(oDate - new DateTime(1970, 1, 1)).TotalMilliseconds;
            var milliseconds = 60 * 60000;
            var diff = milli - milliseconds;
            string strNewTime = TimeUtility.getDate(diff.ToString());
            lblMainTime.Text = strNewTime;
        }
        private void Tap2HourAgo_Tapped(object sender, EventArgs e)
        {
            imgchange2HourAgo.Source = "med_select.png";
            imgchangeJustNow.Source = "med_deselect.png";
            imgchange15Minago.Source = "med_deselect.png";
            imgchange30Minago.Source = "med_deselect.png";
            imgchange1HourAgo.Source = "med_deselect.png";
            DateTime oDate = Convert.ToDateTime(App.strDateTime);
            long milli = (long)(oDate - new DateTime(1970, 1, 1)).TotalMilliseconds;
            var milliseconds = 120 * 60000;
            var diff = milli - milliseconds;
            string strNewTime = TimeUtility.getDate(diff.ToString());
            lblMainTime.Text = strNewTime;
        }

    }
}

No comments:

Post a Comment