This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LoginCheckAppStart : MvxNavigatingObject, IMvxAppStart | |
{ | |
private readonly IApplicationSettings _applicationSettings; | |
private readonly ISecureStorageService _secureStorage; | |
public LoginCheckAppStart(IApplicationSettings applicationSettings, ISecureStorageService secureStorage) | |
{ | |
_applicationSettings = applicationSettings; | |
_secureStorage = secureStorage; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SecureStorageService : ISecureStorageService | |
{ | |
public void RemoveAdalRecords() | |
{ | |
try | |
{ | |
var query = new SecRecord(SecKind.GenericPassword); | |
SecKeyChain.Remove(query); | |
} | |
catch (Exception ex) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SecureStorageService : ISecureStorageService | |
{ | |
private const string SharedPreferencesName = "ActiveDirectoryAuthenticationLibrary"; | |
private const string SharedPreferencesKey = "cache"; | |
private static ISharedPreferences SharedPreferences => | |
Application.Context.GetSharedPreferences(SharedPreferencesName, FileCreationMode.Private); | |
public void RemoveAdalRecords() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface ISecureStorageService | |
{ | |
void RemoveAdalRecords(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in Setup class for iOS project | |
protected override NinjectDependenciesProvider GetNinjectDependenciesProvider() | |
{ | |
return new NinjectIosDependenciesProvider(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class NinjectMvxIosSetup : MvxIosSetup | |
{ | |
protected NinjectMvxIosSetup(IMvxApplicationDelegate applicationDelegate, UIWindow window) | |
: base(applicationDelegate, window) | |
{ | |
} | |
protected NinjectMvxIosSetup(IMvxApplicationDelegate applicationDelegate, IMvxIosViewPresenter presenter) : base(applicationDelegate, presenter) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NinjectMvxIoCProvider : MvxSingleton<IMvxIoCProvider>, IMvxIoCProvider | |
{ | |
public bool CanResolve<T>() => //... | |
public T Create<T>() => // ... | |
public object GetSingleton(Type type) => //... | |
public T Resolve<T>() => //... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class NinjectMvxDroidSetup : MvxAndroidSetup | |
{ | |
protected NinjectMvxDroidSetup(Context applicationContext) : base(applicationContext) | |
{ | |
} | |
protected override void InitializeLastChance() | |
{ | |
base.InitializeLastChance(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NinjectIosDependenciesProvider : NinjectDependenciesProvider | |
{ | |
protected override IEnumerable<INinjectModule> GetPlatformSpecificModules() | |
{ | |
return new[] { new IosNinjectModule() }; | |
} | |
protected override IEnumerable<INinjectModule> GetPortableNinjectModules() | |
{ | |
return new[] { new CommonDependenciesModule() }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NinjectDroidDependenciesProvider : NinjectDependenciesProvider | |
{ | |
protected override IEnumerable<INinjectModule> GetPlatformSpecificModules() | |
{ | |
return new[] { new DroidNinjectModule() }; | |
} | |
protected override IEnumerable<INinjectModule> GetPortableNinjectModules() | |
{ | |
return new[] { new CommonDependenciesModule() }; |