mirror of
https://github.com/bitwarden/mobile
synced 2025-12-19 01:33:22 +00:00
moved view controllers to core library for reuse
This commit is contained in:
@@ -1,57 +1,19 @@
|
||||
using System;
|
||||
using Foundation;
|
||||
using Bit.App;
|
||||
using Foundation;
|
||||
using Bit.iOS.Core.Models;
|
||||
|
||||
namespace Bit.iOS.Extension.Models
|
||||
{
|
||||
public class Context
|
||||
public class Context : AppExtensionContext
|
||||
{
|
||||
private string _uriString;
|
||||
|
||||
public NSExtensionContext ExtContext { get; set; }
|
||||
public string ProviderType { get; set; }
|
||||
public Uri Uri
|
||||
{
|
||||
get
|
||||
{
|
||||
Uri uri;
|
||||
if(string.IsNullOrWhiteSpace(UrlString) || !Uri.TryCreate(UrlString, UriKind.Absolute, out uri))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
public string UrlString
|
||||
{
|
||||
get
|
||||
{
|
||||
return _uriString;
|
||||
}
|
||||
set
|
||||
{
|
||||
_uriString = value;
|
||||
if(_uriString != null && !_uriString.StartsWith(Constants.iOSAppProtocol) && _uriString.Contains("."))
|
||||
{
|
||||
if(!_uriString.Contains("://") && !_uriString.Contains(" "))
|
||||
{
|
||||
_uriString = string.Concat("http://", _uriString);
|
||||
}
|
||||
}
|
||||
|
||||
if(!_uriString.StartsWith("http") && !_uriString.StartsWith(Constants.iOSAppProtocol))
|
||||
{
|
||||
_uriString = string.Concat(Constants.iOSAppProtocol, _uriString);
|
||||
}
|
||||
}
|
||||
}
|
||||
public string LoginTitle { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
public string OldPassword { get; set; }
|
||||
public string Notes { get; set; }
|
||||
public PasswordGenerationOptions PasswordOptions { get; set; }
|
||||
public PageDetails Details { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Bit.iOS.Extension.Models
|
||||
{
|
||||
public class PasswordGenerationOptions
|
||||
{
|
||||
public int MinLength { get; set; }
|
||||
public int MaxLength { get; set; }
|
||||
public bool RequireDigits { get; set; }
|
||||
public bool RequireSymbols { get; set; }
|
||||
public string ForbiddenCharacters { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user