зеркало из https://github.com/xamarin/ios-samples.git
ReachabilitySample sample ported to 64-bits
This commit is contained in:
Родитель
f891b5b531
Коммит
d52d003bc2
|
@ -11,21 +11,21 @@
|
|||
namespace reachability {
|
||||
|
||||
|
||||
// Base type probably should be MonoTouch.Foundation.NSObject or subclass
|
||||
[MonoTouch.Foundation.Register("ReachabilityAppDelegate")]
|
||||
// Base type probably should be Foundation.NSObject or subclass
|
||||
[Foundation.Register("ReachabilityAppDelegate")]
|
||||
public partial class ReachabilityAppDelegate {
|
||||
|
||||
private MonoTouch.UIKit.UIWindow __mt_window;
|
||||
private UIKit.UIWindow __mt_window;
|
||||
|
||||
private MonoTouch.UIKit.UIView __mt_contentView;
|
||||
private UIKit.UIView __mt_contentView;
|
||||
|
||||
private MonoTouch.UIKit.UILabel __mt_summaryLabel;
|
||||
private UIKit.UILabel __mt_summaryLabel;
|
||||
|
||||
#pragma warning disable 0169
|
||||
[MonoTouch.Foundation.Connect("window")]
|
||||
private MonoTouch.UIKit.UIWindow window {
|
||||
[Foundation.Connect("window")]
|
||||
private UIKit.UIWindow window {
|
||||
get {
|
||||
this.__mt_window = ((MonoTouch.UIKit.UIWindow)(this.GetNativeField("window")));
|
||||
this.__mt_window = ((UIKit.UIWindow)(this.GetNativeField("window")));
|
||||
return this.__mt_window;
|
||||
}
|
||||
set {
|
||||
|
@ -34,10 +34,10 @@ namespace reachability {
|
|||
}
|
||||
}
|
||||
|
||||
[MonoTouch.Foundation.Connect("contentView")]
|
||||
private MonoTouch.UIKit.UIView contentView {
|
||||
[Foundation.Connect("contentView")]
|
||||
private UIKit.UIView contentView {
|
||||
get {
|
||||
this.__mt_contentView = ((MonoTouch.UIKit.UIView)(this.GetNativeField("contentView")));
|
||||
this.__mt_contentView = ((UIKit.UIView)(this.GetNativeField("contentView")));
|
||||
return this.__mt_contentView;
|
||||
}
|
||||
set {
|
||||
|
@ -46,10 +46,10 @@ namespace reachability {
|
|||
}
|
||||
}
|
||||
|
||||
[MonoTouch.Foundation.Connect("summaryLabel")]
|
||||
private MonoTouch.UIKit.UILabel summaryLabel {
|
||||
[Foundation.Connect("summaryLabel")]
|
||||
private UIKit.UILabel summaryLabel {
|
||||
get {
|
||||
this.__mt_summaryLabel = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("summaryLabel")));
|
||||
this.__mt_summaryLabel = ((UIKit.UILabel)(this.GetNativeField("summaryLabel")));
|
||||
return this.__mt_summaryLabel;
|
||||
}
|
||||
set {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using CoreGraphics;
|
||||
using System.Net;
|
||||
using MonoTouch.CoreGraphics;
|
||||
using MonoTouch.Foundation;
|
||||
using MonoTouch.UIKit;
|
||||
using MonoTouch.SystemConfiguration;
|
||||
using MonoTouch.CoreFoundation;
|
||||
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
using SystemConfiguration;
|
||||
using CoreFoundation;
|
||||
|
||||
namespace reachability {
|
||||
public partial class ReachabilityAppDelegate : UIApplicationDelegate {
|
||||
|
@ -33,7 +33,7 @@ namespace reachability {
|
|||
|
||||
void AddTable ()
|
||||
{
|
||||
RectangleF tableFrame = UIScreen.MainScreen.ApplicationFrame;
|
||||
CGRect tableFrame = UIScreen.MainScreen.ApplicationFrame;
|
||||
|
||||
tableView = new UITableView (tableFrame, UITableViewStyle.Grouped) {
|
||||
AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight,
|
||||
|
@ -68,17 +68,17 @@ namespace reachability {
|
|||
return null;
|
||||
}
|
||||
|
||||
public override int RowsInSection (UITableView view, int section)
|
||||
public override nint RowsInSection (UITableView view, nint section)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public override int NumberOfSections (UITableView view)
|
||||
public override nint NumberOfSections (UITableView view)
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
public override string TitleForHeader (UITableView view, int section)
|
||||
public override string TitleForHeader (UITableView view, nint section)
|
||||
{
|
||||
switch (section) {
|
||||
case 0:
|
||||
|
@ -162,7 +162,7 @@ namespace reachability {
|
|||
|
||||
static void Main (string[] args)
|
||||
{
|
||||
UIApplication.Main (args, null, null);
|
||||
UIApplication.Main (args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
using MonoTouch.Foundation;
|
||||
using MonoTouch.UIKit;
|
||||
using MonoTouch.SystemConfiguration;
|
||||
using MonoTouch.CoreFoundation;
|
||||
using Foundation;
|
||||
using UIKit;
|
||||
using SystemConfiguration;
|
||||
using CoreFoundation;
|
||||
|
||||
public enum NetworkStatus {
|
||||
NotReachable,
|
||||
|
@ -70,7 +70,7 @@ public static class Reachability {
|
|||
{
|
||||
if (adHocWiFiNetworkReachability == null){
|
||||
adHocWiFiNetworkReachability = new NetworkReachability (new IPAddress (new byte [] {169,254,0,0}));
|
||||
adHocWiFiNetworkReachability.SetCallback (OnChange);
|
||||
adHocWiFiNetworkReachability.SetNotification (OnChange);
|
||||
adHocWiFiNetworkReachability.Schedule (CFRunLoop.Current, CFRunLoop.ModeDefault);
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ public static class Reachability {
|
|||
{
|
||||
if (defaultRouteReachability == null){
|
||||
defaultRouteReachability = new NetworkReachability (new IPAddress (0));
|
||||
defaultRouteReachability.SetCallback (OnChange);
|
||||
defaultRouteReachability.SetNotification (OnChange);
|
||||
defaultRouteReachability.Schedule (CFRunLoop.Current, CFRunLoop.ModeDefault);
|
||||
}
|
||||
if (!defaultRouteReachability.TryGetFlags (out flags))
|
||||
|
@ -106,7 +106,7 @@ public static class Reachability {
|
|||
// this only happens when you create NetworkReachability from a hostname
|
||||
reachable = remoteHostReachability.TryGetFlags (out flags);
|
||||
|
||||
remoteHostReachability.SetCallback (OnChange);
|
||||
remoteHostReachability.SetNotification (OnChange);
|
||||
remoteHostReachability.Schedule (CFRunLoop.Current, CFRunLoop.ModeDefault);
|
||||
} else
|
||||
reachable = remoteHostReachability.TryGetFlags (out flags);
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
<MtouchDebug>True</MtouchDebug>
|
||||
<MtouchArch>ARMv6</MtouchArch>
|
||||
<MtouchI18n />
|
||||
<MtouchExtraArgs>--registrar:static --nofastsim --override-abi x86_64</MtouchExtraArgs>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
|
||||
<DebugType>none</DebugType>
|
||||
|
@ -61,7 +62,9 @@
|
|||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="monotouch" />
|
||||
<Reference Include="Xamarin.iOS">
|
||||
<HintPath>\Developer\MonoTouch\usr\lib\mono\Xamarin.iOS\Xamarin.iOS.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="MainWindow.xib.designer.cs">
|
||||
|
|
Загрузка…
Ссылка в новой задаче