protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.TrainPosition); Window.SetStatusBarColor(new Android.Graphics.Color(Android.Support.V4.Content.ContextCompat.GetColor(this, Resource.Color.colorPrimary))); var line = Intent.GetStringExtra("Line"); jrhLine = JrhLineCreater.FromString(line); trainPostionLinearLayout = FindViewById <LinearLayout>(Resource.Id.TrainpositionLinearLayout); var backButton = FindViewById <ImageView>(Resource.Id.BackButton); favoriteButton = FindViewById <ImageView>(Resource.Id.FavoriteButton); var TitleTextView = FindViewById <TextView>(Resource.Id.ToolbarText); swipeRefreshLayout = FindViewById <SwipeRefreshLayout>(Resource.Id.swipe_refresh); GettedTimeTextView = FindViewById <TextView>(Resource.Id.GetedTimeTextView); favoriteButton.Click += FavoriteButton_Click; backButton.Click += BackButton_Click; TitleTextView.Text = jrhLine.GetName(); swipeRefreshLayout.Refresh += SwipeRefreshLayout_Refresh; IsFavorited = UserConfigManager.IsFavoriteLine(jrhLine); favoriteButton.SetImageResource(IsFavorited ? Resource.Drawable.FavoritedIcon : Resource.Drawable.AddFavoriteIcon); RenderData(jrhLine); }
/// <summary> /// CSV形式の駅データを読み取ります。 /// </summary> /// <param name="data"></param> /// <returns></returns> public static Station[] ReadCsvData(string[] data) { var stations = new Station[data.Length]; for (var i = 0; i < data.Length; i++) { var split = data[i].Split(','); var id = int.Parse(split[0]); var isEnd = bool.Parse(split[5]); var area = int.Parse(split[6]); var jrhLine = JrhLineCreater.FromString(split[7]); var pos = int.Parse(split[8]); stations[i] = new Station(id, split[1], split[2], split[3], split[4], area, isEnd, jrhLine, pos); } return(stations); }
public IEnumerable <JrhLine> GetFavoriteJrhLines() { return(FavoriteLineString.Select(str => JrhLineCreater.FromString(str))); }