Esempio n. 1
0
        private Connection NewConnection(Android.Database.ICursor cursor)
        {
            var id = cursor.GetString (0);
            var source =cursor.GetString (1);
            Connection connection = new Connection (id, source);

            return (connection);
        }
Esempio n. 2
0
		private static string GetStringForDay (Android.Content.Context context, int day)
		{
			if (day == 1)
				return context.GetString (Resource.String.bloom_time_begin);
			else if (day > 27)
				return context.GetString (Resource.String.bloom_time_end);
			else
				return context.GetString (Resource.String.bloom_time_middle);
		}
Esempio n. 3
0
        private Score MapScores(Android.Database.ICursor cursor)
        {
            Score scr = new Score ();
            scr.ScoreID = cursor.GetInt (0);
            scr.ScoreDate = cursor.GetString (1);
            scr.PlayerName = cursor.GetString (2);
            scr.ScoreNumber = cursor.GetInt (3);

            return (scr);
        }
Esempio n. 4
0
        private Station NewStation(Android.Database.ICursor cursor)
        {
            var id = cursor.GetString (1);
            var locationX = cursor.GetString (2);
            var locationY = cursor.GetString (3);
            var name = cursor.GetString (4);
            var standardName = cursor.GetString (5);
            Station station = new Station (id, locationX, locationY, name, standardName);

            return station;
        }
Esempio n. 5
0
        private Question NewQuestion(Android.Database.ICursor cursor)
        {
            Question qst = new Question ();
            qst.ImageID = cursor.GetInt (1);
            qst.QuestionString = cursor.GetString (2);
            qst.CorrectAnswer = cursor.GetString (3);
            qst.WrongAnswer1 = cursor.GetString (4);
            qst.WrongAnswer2 = cursor.GetString (5);
            qst.WrongAnswer3 = cursor.GetString (6);

            return (qst);
        }
 private ContactInfo GetContactInfoFromCursor(Android.Database.ICursor cursor)
 {
     var displayName = cursor.GetString(cursor.GetColumnIndex(projection[1]));
     var nameParts = displayName.Split(' ');
     var lastName = nameParts.Length > 1 ? nameParts[1] : null;
     return new ContactInfo()
     {
         Id = cursor.GetString(cursor.GetColumnIndex(ContactsContract.ContactsColumns.LookupKey)),
         GivenName = nameParts[0],
         AdditionalName = null,
         FamilyName = lastName
     };
 }
Esempio n. 7
0
		public static string ClinicalPollutionToString(Android.Content.Context context, int pollution)
		{
			switch (pollution)
			{				
				case 1:
					return context.GetString(Resource.String.clinical_pollution_low);
				case 2:
					return context.GetString(Resource.String.clinical_pollution_intermediate);
				case 3:
					return context.GetString(Resource.String.clinical_pollution_high);
				case 4:
					return context.GetString(Resource.String.clinical_pollution_veryhigh);
			}

			return "Unknown";
		}
Esempio n. 8
0
        private Tweet NewTweet(Android.Database.ICursor cursor)
        {
            var j = JsonValue.Parse (cursor.GetString (1));
            Tweet twt = new Tweet (j);

            return (twt);
        }
Esempio n. 9
0
		public static string BloomTimeToString (Android.Content.Context context, DateTime bloomStart, DateTime bloomEnd)
		{
			var start = GetStringForDay (context, bloomStart.Day);
			var end = GetStringForDay (context, bloomEnd.Day);

			var result = start + " " + bloomStart.ToString ("MMMMM") + " " + context.GetString (Resource.String.bloom_time_until) + " " + end + " " + bloomEnd.ToString ("MMMM");
			return result;
		}
Esempio n. 10
0
		public override View NewView (Context context, Android.Database.ICursor cursor, ViewGroup parent)
		{
			LayoutInflater inflater = LayoutInflater.From (context);
			TextView view = (TextView) inflater.Inflate (
				Android.Resource.Layout.SimpleDropDownItem1Line, parent, false);
			view.Text = cursor.GetString (COLUMN_DISPLAY_NAME);

			return view;
		}
Esempio n. 11
0
 private Score MapScores(Android.Database.ICursor cursor)
 {
     Score scr = new Score();
     scr.ScoreID = cursor.GetInt(0);
     scr.ScoreDate = cursor.GetString(1);
     scr.ScoreNumber = cursor.GetInt(2);
     scr.Rating = cursor.GetDouble(3);
     scr.Slope = cursor.GetInt(4);
     return (scr);
 }
Esempio n. 12
0
		public override void BindView (View view, Context context, Android.Database.ICursor cursor)
		{
			((TextView) view).Text = cursor.GetString (COLUMN_DISPLAY_NAME);
		}
Esempio n. 13
0
        private void populateListFromDB(Android.Database.ICursor sqldb_cursor)
        {
            if (sqldb_cursor != null)
            {

                sqldb_cursor.MoveToFirst();
                do {
                    var itm = new TableItem {
                        Id = sqldb_cursor.GetString(0),
                        Heading = sqldb_cursor.GetString(1) ,
                        SubHeading = sqldb_cursor.GetString(2),
                        DownloadUrl = sqldb_cursor.GetString(3),
                        ImageName = sqldb_cursor.GetString(4)
                    };
                    items.Add (itm);
                } while (sqldb_cursor.MoveToNext());

            }
            progress.Dismiss();
            ListAdapter = new HomeScreenAdapter(this, items);
            ListView.FastScrollEnabled = true;
        }