mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 23:01:52 +01:00
Fixed remove Bug
This commit is contained in:
parent
7693316701
commit
1893c7cddc
@ -73,6 +73,11 @@ namespace Borepin.PageModel.AddServerProcess
|
|||||||
}
|
}
|
||||||
public async Task ConnectToServerExecute()
|
public async Task ConnectToServerExecute()
|
||||||
{
|
{
|
||||||
|
if (Host == "" || Host == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
IsBusy = true;
|
IsBusy = true;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -108,7 +108,7 @@ namespace Borepin.PageModel
|
|||||||
{"intance", null },
|
{"intance", null },
|
||||||
};
|
};
|
||||||
|
|
||||||
await _NavigationService.NavigateAsync("ScanPage", parameters).ConfigureAwait(false);
|
await _NavigationService.NavigateAsync("ScanURNPage", parameters).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ using Prism.Services;
|
|||||||
using Prism.Services.Dialogs;
|
using Prism.Services.Dialogs;
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Resources;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
@ -22,6 +21,7 @@ namespace Borepin.PageModel
|
|||||||
#region Private Fields
|
#region Private Fields
|
||||||
private readonly IDialogService _DialogService;
|
private readonly IDialogService _DialogService;
|
||||||
private readonly ILoginStorageService _LoginStorageService;
|
private readonly ILoginStorageService _LoginStorageService;
|
||||||
|
private bool IsDialog = false;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
@ -71,7 +71,7 @@ namespace Borepin.PageModel
|
|||||||
InstanceIsDefaultConnection = true;
|
InstanceIsDefaultConnection = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(instance == null && Connection_Item == null)
|
if(instance == null && Connection_Item == null && IsDialog == false)
|
||||||
{
|
{
|
||||||
throw new InstanceIncorrectException();
|
throw new InstanceIncorrectException();
|
||||||
}
|
}
|
||||||
@ -206,6 +206,7 @@ namespace Borepin.PageModel
|
|||||||
{ "instance", Connection_Item },
|
{ "instance", Connection_Item },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
IsDialog = true;
|
||||||
_DialogService.ShowDialog("ConfirmDialog", parameters, DeleteCommandExecute_Dialog);
|
_DialogService.ShowDialog("ConfirmDialog", parameters, DeleteCommandExecute_Dialog);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,9 +214,9 @@ namespace Borepin.PageModel
|
|||||||
{
|
{
|
||||||
if(string.Equals(result.Parameters.GetValue<string>("result"), "confirm", StringComparison.Ordinal))
|
if(string.Equals(result.Parameters.GetValue<string>("result"), "confirm", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
await _API.Disconnect().ConfigureAwait(true);
|
await _API.Disconnect().ConfigureAwait(false);
|
||||||
_API.UnbindAllEvents();
|
_API.UnbindAllEvents();
|
||||||
await _LoginStorageService.Remove(Connection_Item).ConfigureAwait(false);
|
await _LoginStorageService.Remove(result.Parameters.GetValue<ConnectionData>("instance")).ConfigureAwait(false);
|
||||||
|
|
||||||
Device.BeginInvokeOnMainThread(async () =>
|
Device.BeginInvokeOnMainThread(async () =>
|
||||||
{
|
{
|
||||||
|
@ -64,7 +64,7 @@ namespace Borepin.Service.Storage
|
|||||||
await _SaveConnectionData(connectionData_List).ConfigureAwait(false);
|
await _SaveConnectionData(connectionData_List).ConfigureAwait(false);
|
||||||
|
|
||||||
ConnectionData connectionData_default = await GetDefault().ConfigureAwait(false);
|
ConnectionData connectionData_default = await GetDefault().ConfigureAwait(false);
|
||||||
if (connectionData_default.Equals(connectionData))
|
if (connectionData_default != null && connectionData_default.Equals(connectionData))
|
||||||
{
|
{
|
||||||
await RemoveDefault().ConfigureAwait(false);
|
await RemoveDefault().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user