[MapDemo]Formatting fixes re. feedback from Oleg

This commit is contained in:
Amy Burns 2016-01-18 20:19:23 -05:00
Родитель efe5ff3f4f
Коммит 485eac3b81
3 изменённых файлов: 32 добавлений и 89 удалений

Просмотреть файл

@ -1,61 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
namespace MapDemo
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
public class AppDelegate : UIApplicationDelegate
{
public override UIWindow Window {
get;
set;
}
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
// Override point for customization after application launch.
// If not required for your application you can safely delete this method
return true;
}
public override void OnResignActivation (UIApplication application)
{
// Invoked when the application is about to move from active to inactive state.
// This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message)
// or when the user quits the application and it begins the transition to the background state.
// Games should use this method to pause the game.
}
public override void DidEnterBackground (UIApplication application)
{
// Use this method to release shared resources, save user data, invalidate timers and store the application state.
// If your application supports background exection this method is called instead of WillTerminate when the user quits.
}
public override void WillEnterForeground (UIApplication application)
{
// Called as part of the transiton from background to active state.
// Here you can undo many of the changes made on entering the background.
}
public override void OnActivated (UIApplication application)
{
// Restart any tasks that were paused (or not yet started) while the application was inactive.
// If the application was previously in the background, optionally refresh the user interface.
}
public override void WillTerminate (UIApplication application)
{
// Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground.
}
}
}

Просмотреть файл

@ -1,20 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
namespace MapDemo
{
public class Application
{
// This is the main entry point of the application.
static void Main (string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main (args, null, "AppDelegate");
}
}
public class Application
{
// This is the main entry point of the application.
static void Main (string[] args)
{
UIApplication.Main (args, null, "AppDelegate");
}
}
}

Просмотреть файл

@ -1,6 +1,4 @@
using Foundation;
using System;
using System.CodeDom.Compiler;
using UIKit;
using CoreLocation;
using MapKit;
@ -30,15 +28,15 @@ namespace MapDemo
map.Bounds = View.Bounds;
// set map center and region
double lat = 42.374260;
double lon = -71.120824;
const double lat = 42.374260;
const double lon = -71.120824;
var mapCenter = new CLLocationCoordinate2D (lat, lon);
var mapRegion = MKCoordinateRegion.FromDistance (mapCenter, 2000, 2000);
map.CenterCoordinate = mapCenter;
map.Region = mapRegion;
// add an annotation
map.AddAnnotation (new MKPointAnnotation () {
map.AddAnnotation (new MKPointAnnotation {
Title = "MyAnnotation",
Coordinate = new CLLocationCoordinate2D (42.364260, -71.120824)
});
@ -72,9 +70,6 @@ namespace MapDemo
searchController.HidesNavigationBarDuringPresentation = false;
NavigationItem.TitleView = searchController.SearchBar;
DefinesPresentationContext = true;
}
public class SearchResultsUpdator : UISearchResultsUpdating