public void RefreshCell(ScreenMain owner, Engine engine, int row) { string header; string items; object image; // Are we in the start up if (engine.GameState != EngineGameState.Playing) { return; } owner.GetContentEntry(row, out header, out items, out image); // For position we must generate text here if (row == 4) { // var gps = MainApp.Instance.GPS; // var location = ctrl .gps.IsValid ? gps.CoordinatesToString(gps.Latitude, gps.Longitude) : Catalog.GetString("Unknown"); // var altitude = gps.HasAltitude ? String.Format("{0:0}", gps.Altitude) : "\u0335"; // var accuracy = gps.HasAccuracy ? String.Format("{0:0}", gps.Accuracy) : Strings.Infinite; // var status = gps.IsValid ? Catalog.GetString("valid") : Catalog.GetString("invalid"); var location = Catalog.GetString("Unknown"); var altitude = "\u0335"; var accuracy = Strings.Infinite; var status = Catalog.GetString("invalid"); StringBuilder sb = new StringBuilder(); sb.AppendLine(location); sb.AppendLine(""); sb.Append(Catalog.GetString("Altitude")); sb.Append(":\t\t\t\t"); sb.Append(altitude); sb.AppendLine(" m"); sb.Append(Catalog.GetString("Accuracy")); sb.Append(":\t\t"); sb.Append(accuracy); sb.AppendLine(" m"); sb.Append(Catalog.GetString("Status")); sb.Append(":\t\t\t\t"); sb.AppendLine(status); items = sb.ToString(); } textTitle.Text = header; textItems.Text = items; textItems.SizeToFit(); imageIcon.Image = (UIImage)image; }
public void RefreshCell (ScreenMain owner, Engine engine, int row) { string header; string items; object image; // Are we in the start up if(engine.GameState != EngineGameState.Playing) return; owner.GetContentEntry (row, out header, out items, out image); // For position we must generate text here if (row == 4) { // var gps = MainApp.Instance.GPS; // var location = ctrl .gps.IsValid ? gps.CoordinatesToString(gps.Latitude, gps.Longitude) : Catalog.GetString("Unknown"); // var altitude = gps.HasAltitude ? String.Format("{0:0}", gps.Altitude) : "\u0335"; // var accuracy = gps.HasAccuracy ? String.Format("{0:0}", gps.Accuracy) : Strings.Infinite; // var status = gps.IsValid ? Catalog.GetString("valid") : Catalog.GetString("invalid"); var location = Catalog.GetString("Unknown"); var altitude = "\u0335"; var accuracy = Strings.Infinite; var status = Catalog.GetString ("invalid"); StringBuilder sb = new StringBuilder(); sb.AppendLine(location); sb.AppendLine(""); sb.Append(Catalog.GetString("Altitude")); sb.Append(":\t\t\t\t"); sb.Append(altitude); sb.AppendLine(" m"); sb.Append(Catalog.GetString("Accuracy")); sb.Append(":\t\t"); sb.Append(accuracy); sb.AppendLine(" m"); sb.Append(Catalog.GetString("Status")); sb.Append(":\t\t\t\t"); sb.AppendLine(status); items = sb.ToString(); } textTitle.Text = header; textItems.Text = items; textItems.SizeToFit (); imageIcon.Image = (UIImage)image; }
public MainScreenSource(ScreenMain owner, ScreenController ctrl) { this.owner = owner; this.ctrl = ctrl; }
public void InitController(Boolean stop) { if (stop) { // Check location was aborted with quit locationManager.StopUpdatingLocation (); DestroyEngine (); appDelegate.CartStop (); return; } locationManager.StopUpdatingLocation (); locationManager.DistanceFilter = 2.0; locationManager.HeadingFilter = 5.0; locationManager.Delegate = new LocationManagerDelegate (this); locationManager.StartUpdatingLocation (); locationManager.StartUpdatingHeading (); // Create Engine CreateEngine (cart); // Create screens screenMain = new ScreenMain(this); // Set left button var leftBarButton = new UIBarButtonItem (Catalog.GetString("Quit"), UIBarButtonItemStyle.Plain, (sender, args) => { ButtonPressed(null); quit(); }); leftBarButton.TintColor = Colors.NavBarButton; screenMain.NavigationItem.SetLeftBarButtonItem(leftBarButton, true); // Set right button var rightBarButton = new UIBarButtonItem (Catalog.GetString("Save"), UIBarButtonItemStyle.Plain, (sender, args) => { ButtonPressed(null); Save(); }); rightBarButton.TintColor = Colors.NavBarButton; screenMain.NavigationItem.SetRightBarButtonItem(rightBarButton, true); screenListLocations = new ScreenList (this, ScreenType.Locations); screenListItems = new ScreenList (this, ScreenType.Items); screenListInventory = new ScreenList (this, ScreenType.Inventory); screenListTasks = new ScreenList (this, ScreenType.Tasks); Delegate = new ScreenControllerDelegate(); // ... and push it to the UINavigationController while replacing the CheckLocation SetViewControllers (new UIViewController[] { screenMain }, animation); Title = cart.Name; if (restore) Restore(); else Start (); }
public void InitController(Boolean stop) { if (stop) { // Check location was aborted with quit locationManager.StopUpdatingLocation(); DestroyEngine(); appDelegate.CartStop(); return; } locationManager.StopUpdatingLocation(); locationManager.DistanceFilter = 2.0; locationManager.HeadingFilter = 5.0; locationManager.Delegate = new LocationManagerDelegate(this); locationManager.StartUpdatingLocation(); locationManager.StartUpdatingHeading(); // Create Engine CreateEngine(cart); // Create screens screenMain = new ScreenMain(this); // Set left button var leftBarButton = new UIBarButtonItem(Catalog.GetString("Quit"), UIBarButtonItemStyle.Plain, (sender, args) => { ButtonPressed(null); quit(); }); leftBarButton.TintColor = Colors.NavBarButton; screenMain.NavigationItem.SetLeftBarButtonItem(leftBarButton, true); // Set right button var rightBarButton = new UIBarButtonItem(Catalog.GetString("Save"), UIBarButtonItemStyle.Plain, (sender, args) => { ButtonPressed(null); Save(); }); rightBarButton.TintColor = Colors.NavBarButton; screenMain.NavigationItem.SetRightBarButtonItem(rightBarButton, true); screenListLocations = new ScreenList(this, ScreenType.Locations); screenListItems = new ScreenList(this, ScreenType.Items); screenListInventory = new ScreenList(this, ScreenType.Inventory); screenListTasks = new ScreenList(this, ScreenType.Tasks); Delegate = new ScreenControllerDelegate(); // ... and push it to the UINavigationController while replacing the CheckLocation SetViewControllers(new UIViewController[] { screenMain }, animation); Title = cart.Name; if (restore) { Restore(); } else { Start(); } }