Skip to content
Permalink
Browse files

Unified API ヽ(´ー`)ノ

  • Loading branch information...
Cheesebaron committed Jan 21, 2015
1 parent 2f81b4f commit 8e57a7cb53f8ec575ad9c48e478e7ab44bcb93a0
Showing with 146 additions and 142 deletions.
  1. +3 −3 AppId/Touch/AppId.Touch.csproj
  2. +2 −2 AppId/Touch/AppIdGenerator.cs
  3. +14 −7 AzureAccessControl/AzureAccessControl.Touch/AzureAccessControl.Touch.csproj
  4. +2 −2 AzureAccessControl/AzureAccessControl.Touch/LoginIdentityProviderTask.cs
  5. +6 −6 AzureAccessControl/AzureAccessControl.Touch/Views/AccessControlWebAuthController.cs
  6. +19 −9 AzureAccessControl/AzureAccessControl.Touch/Views/DefaultLoginIdentityProviderTableViewController.cs
  7. +3 −3 Connectivity/Touch/Connectivity.Touch.csproj
  8. +32 −26 Connectivity/Touch/Reachability.cs
  9. +3 −3 Notifications/Touch/Notifications.Touch.csproj
  10. +3 −3 Notifications/Touch/NotificationsAppDelegate.cs
  11. +2 −2 Notifications/Touch/TouchNotificationConfiguration.cs
  12. +2 −2 Notifications/Touch/TouchNotifications.cs
  13. +3 −3 SMS/Touch/SMS.Touch.csproj
  14. +3 −3 SMS/Touch/SmsTask.cs
  15. +3 −3 Samples/AzureAccessControl/Touch/AppDelegate.cs
  16. +3 −5 Samples/AzureAccessControl/Touch/AzureAccessControl.Sample.Touch.csproj
  17. +1 −1 Samples/AzureAccessControl/Touch/Main.cs
  18. +4 −4 Samples/AzureAccessControl/Touch/Views/TestView.cs
  19. +2 −2 Samples/AzureAccessControl/Touch/Views/UIKitExtensions.cs
  20. +2 −2 Samples/ModernHttpClient/Touch/AppDelegate.cs
  21. +1 −6 Samples/ModernHttpClient/Touch/Main.cs
  22. +3 −3 Samples/ModernHttpClient/Touch/ModernHttpClient.Sample.Touch.csproj
  23. +3 −2 Samples/ModernHttpClient/Touch/Views/TestView.cs
  24. +2 −2 Samples/Notifications/Touch/AppDelegate.cs
  25. +3 −3 Samples/Notifications/Touch/LinkerPleaseInclude.cs
  26. +1 −6 Samples/Notifications/Touch/Main.cs
  27. +3 −3 Samples/Notifications/Touch/Notifications.Sample.Touch.csproj
  28. +4 −3 Samples/Notifications/Touch/Views/TestView.cs
  29. +2 −6 Samples/SMS/Touch/AppDelegate.cs
  30. +1 −6 Samples/SMS/Touch/Main.cs
  31. +3 −3 Samples/SMS/Touch/SMS.Sample.Touch.csproj
  32. +3 −3 Settings/Cheesebaron.MvxPlugins.Settings.Touch/Cheesebaron.MvxPlugins.Settings.Touch.csproj
  33. +2 −2 Settings/Cheesebaron.MvxPlugins.Settings.Touch/Settings.cs
  34. +3 −3 ...en/Cheesebaron.MvxPlugins.SimpleWebToken.Touch/Cheesebaron.MvxPlugins.SimpleWebToken.Touch.csproj
@@ -6,7 +6,7 @@
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{2E4FF295-9763-4D2A-BDF7-838CF0E5886C}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Cheesebaron.MvxPlugins.AppId</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
@@ -47,13 +47,13 @@
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Core\AppId.Core.csproj">
<Project>{19159A7C-569A-4A2A-B4DC-A2305F384E23}</Project>
<Name>AppId.Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
</Project>
@@ -1,5 +1,5 @@
//---------------------------------------------------------------------------------
// Copyright 2013 Tomasz Cielecki (tomasz@ostebaronen.dk)
// Copyright 2013-2015 Tomasz Cielecki (tomasz@ostebaronen.dk)
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -15,7 +15,7 @@
//---------------------------------------------------------------------------------

using System;
using MonoTouch.UIKit;
using UIKit;

namespace Cheesebaron.MvxPlugins.AppId
{
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{0EBF0D71-7D85-45DC-90DD-B85C50B01FCE}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Cheesebaron.MvxPlugins.AzureAccessControl.Touch</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
@@ -41,8 +41,9 @@
<Compile Include="Views\DefaultLoginIdentityProviderTableViewController.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="BTProgressHUD">
<HintPath>..\..\submodules\BTProgressHUD\BTProgressHUD\bin\classic\Debug\BTProgressHUD.dll</HintPath>
<Reference Include="BTProgressHUD, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Components\btprogresshud-1.15\lib\ios-unified\BTProgressHUD.dll</HintPath>
</Reference>
<Reference Include="Cirrious.CrossCore">
<HintPath>..\..\submodules\MvvmCross\bin\Debug\Mvx\Touch\Cirrious.CrossCore.dll</HintPath>
@@ -86,7 +87,7 @@
<Reference Include="System.Windows" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Settings\Cheesebaron.MvxPlugins.Settings\Cheesebaron.MvxPlugins.Settings.csproj">
@@ -102,5 +103,11 @@
<Name>AzureAccessControl.Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
</Project>
<ItemGroup>
<XamarinComponentReference Include="btprogresshud">
<Visible>False</Visible>
<Version>1.15</Version>
</XamarinComponentReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
</Project>
@@ -22,8 +22,8 @@
using Cirrious.CrossCore.Touch.Platform;
using Cirrious.CrossCore.Touch.Views;
using Cirrious.MvvmCross.Plugins.Messenger;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;

namespace Cheesebaron.MvxPlugins.AzureAccessControl.Touch
{
@@ -1,5 +1,5 @@
//---------------------------------------------------------------------------------
// Copyright 2013 Tomasz Cielecki (tomasz@ostebaronen.dk)
// Copyright 2013-2015 Tomasz Cielecki (tomasz@ostebaronen.dk)
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -15,15 +15,15 @@
//---------------------------------------------------------------------------------

using System;
using System.Drawing;
using System.Text;

using Cheesebaron.MvxPlugins.AzureAccessControl.Messages;

using Cirrious.CrossCore;
using Cirrious.MvvmCross.Plugins.Messenger;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using CoreGraphics;
using Foundation;
using UIKit;

namespace Cheesebaron.MvxPlugins.AzureAccessControl.Touch.Views
{
@@ -76,7 +76,7 @@ public override void ViewDidLoad()
if (!string.IsNullOrEmpty(IdentityProviderName))
Title = IdentityProviderName;

_webView = new UIWebView(new RectangleF(0,0, View.Bounds.Width, View.Bounds.Height))
_webView = new UIWebView(new CGRect(0,0, View.Bounds.Width, View.Bounds.Height))
{
AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleBottomMargin
};
@@ -128,7 +128,7 @@ private bool ShouldStartLoad(UIWebView webView, NSUrlRequest request, UIWebViewN
return false;
}

internal class LoginConnectionDelegate : NSUrlConnectionDelegate
internal class LoginConnectionDelegate : NSUrlConnectionDataDelegate
{
private readonly AccessControlWebAuthController _controller;
private NSMutableData _data;
@@ -1,5 +1,5 @@
//---------------------------------------------------------------------------------
// Copyright 2013 Tomasz Cielecki (tomasz@ostebaronen.dk)
// Copyright 2013-2015 Tomasz Cielecki (tomasz@ostebaronen.dk)
// Licensed under the Apache License, Version 2.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
@@ -31,8 +31,8 @@
using Cirrious.MvvmCross.Dialog.Touch;
using Cirrious.MvvmCross.ViewModels;
using CrossUI.Touch.Dialog.Elements;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Foundation;
using UIKit;

namespace Cheesebaron.MvxPlugins.AzureAccessControl.Touch.Views
{
@@ -108,7 +108,8 @@ public override void ViewDidLoad()
Root.Remove(_loginDetailSection);
});

_loadingToken = ViewModel.WeakSubscribe(() => ViewModel.LoadingIdentityProviders, (sender, args) => InvokeOnMainThread(() =>
_loadingToken = ViewModel.WeakSubscribe(() => ViewModel.LoadingIdentityProviders,
(sender, args) => InvokeOnMainThread(() =>
{
if (ViewModel.LoadingIdentityProviders)
{
@@ -158,9 +159,9 @@ private void LoginDefaultProvider()
ViewModel.LoginSelectedIdentityProviderCommand.Execute(provider);
}

public Task<int> ShowAlert(string title, string message, params string[] buttons)
public Task<nint> ShowAlert(string title, string message, params string[] buttons)
{
var tcs = new TaskCompletionSource<int>();
var tcs = new TaskCompletionSource<nint>();
var alert = new UIAlertView
{
Title = title,
@@ -213,7 +214,8 @@ protected virtual void SetItemsSource(IEnumerable value)
_itemsSource = value;
if (_itemsSource != null && !(_itemsSource is IList))
MvxBindingTrace.Trace(MvxTraceLevel.Warning,
"Binding to IEnumerable rather than IList - this can be inefficient, especially for large lists");
@"Binding to IEnumerable rather than IList - this can be inefficient,
especially for large lists");
var newObservable = _itemsSource as INotifyCollectionChanged;
if (newObservable != null)
_subscription = newObservable.WeakSubscribe(OnItemsSourceCollectionChanged);
@@ -260,7 +262,12 @@ public class CustomStringElement
public CustomStringElement()
{
this.CreateBindingContext();
this.DelayBind(() => this.CreateBinding().For(me => me.Caption).To<DefaultIdentityProviderViewModel>(p => p.Name).Apply());
this.DelayBind(
() =>
this.CreateBinding()
.For(me => me.Caption)
.To<DefaultIdentityProviderViewModel>(p => p.Name)
.Apply());
}


@@ -269,7 +276,10 @@ public CustomStringElement()
protected override UITableViewCell GetCellImpl(UITableView tv)
{
var uiTableViewCell = tv.DequeueReusableCell(Value == null ? Skey : SkeyValue) ??
new UITableViewCell(Value == null ? UITableViewCellStyle.Default : UITableViewCellStyle.Value1, Skey)
new UITableViewCell(
Value == null ?
UITableViewCellStyle.Default :
UITableViewCellStyle.Value1, Skey)
{
SelectionStyle = UITableViewCellSelectionStyle.Blue
};
@@ -6,7 +6,7 @@
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6A795862-873A-40DE-AC3D-A39B34DE5923}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Cheesebaron.MvxPlugins.Connectivity</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
@@ -62,7 +62,7 @@
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
</Project>
@@ -2,26 +2,35 @@
* reachability.cs from
* https://github.com/xamarin/monotouch-samples/blob/master/ReachabilitySample/reachability.cs
*
* Copyright 2009-2011 Novell Inc and the individuals listed
* on the ChangeLog entries.
*
* Copyright 2011 Xamarin Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

using System;
using System.Net;
using MonoTouch.SystemConfiguration;
using MonoTouch.CoreFoundation;
using SystemConfiguration;
using CoreFoundation;

namespace Cheesebaron.MvxPlugins.Connectivity
{
@@ -55,7 +64,7 @@ public static bool IsReachableWithoutRequiringConnection(NetworkReachabilityFlag
// Is the host reachable with the current network configuration
public static bool IsHostReachable(string host)
{
if (host == null || host.Length == 0)
if (string.IsNullOrEmpty(host))
return false;

using (var r = new NetworkReachability(host))
@@ -90,36 +99,34 @@ static void OnChange(NetworkReachabilityFlags flags)
// out parameter
//
static NetworkReachability adHocWiFiNetworkReachability;

public static bool IsAdHocWiFiNetworkAvailable(out NetworkReachabilityFlags flags)
{
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);
}

if (!adHocWiFiNetworkReachability.TryGetFlags(out flags))
return false;

return IsReachableWithoutRequiringConnection(flags);
return adHocWiFiNetworkReachability.TryGetFlags(out flags) && IsReachableWithoutRequiringConnection(flags);
}

static NetworkReachability defaultRouteReachability;

static bool IsNetworkAvailable(out NetworkReachabilityFlags flags)
{
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))
return false;
return IsReachableWithoutRequiringConnection(flags);
return defaultRouteReachability.TryGetFlags(out flags) && IsReachableWithoutRequiringConnection(flags);
}

static NetworkReachability remoteHostReachability;

public static NetworkStatus RemoteHostStatus()
{
NetworkReachabilityFlags flags;
@@ -133,7 +140,7 @@ public static NetworkStatus RemoteHostStatus()
// 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
@@ -155,10 +162,9 @@ public static NetworkStatus InternetConnectionStatus()
{
NetworkReachabilityFlags flags;
bool defaultNetworkAvailable = IsNetworkAvailable(out flags);
if (defaultNetworkAvailable)
if (defaultNetworkAvailable && ((flags & NetworkReachabilityFlags.IsDirect) != 0))
{
if ((flags & NetworkReachabilityFlags.IsDirect) != 0)
return NetworkStatus.NotReachable;
return NetworkStatus.NotReachable;
}
else if ((flags & NetworkReachabilityFlags.IsWWAN) != 0)
return NetworkStatus.ReachableViaCarrierDataNetwork;
@@ -6,7 +6,7 @@
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6F32FBE1-5D8C-42BB-8DC7-F199DAB71271}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<RootNamespace>Cheesebaron.MvxPlugins.Notifications</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
@@ -77,7 +77,7 @@
<Reference Include="System.Json" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
</Project>

0 comments on commit 8e57a7c

Please sign in to comment.
You can’t perform that action at this time.