|
@@ -28,9 +28,10 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
|
|
|
get { return _password; }
|
|
|
set
|
|
|
{
|
|
|
- SetProperty(ref _password, value);
|
|
|
+ SetProperty(ref _password, value);
|
|
|
IsRightValue = "unknow";
|
|
|
- if (!string.IsNullOrEmpty(value)){
|
|
|
+ if (!string.IsNullOrEmpty(value))
|
|
|
+ {
|
|
|
ClearPasswordButtonVisibility = Visibility.Visible;
|
|
|
}
|
|
|
else
|
|
@@ -65,9 +66,10 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
|
|
|
public string IsRightValue
|
|
|
{
|
|
|
get { return _isRightValue; }
|
|
|
- set {
|
|
|
+ set
|
|
|
+ {
|
|
|
SetProperty(ref _isRightValue, value);
|
|
|
- if(value == "false")
|
|
|
+ if (value == "false")
|
|
|
{
|
|
|
ErrorPasswordMsgVisibility = Visibility.Visible;
|
|
|
}
|
|
@@ -123,8 +125,8 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (tempDocument.CheckOwnerPassword(Password))
|
|
|
- {
|
|
|
+ if (tempDocument.UnlockWithPassword(Password) && tempDocument.CheckOwnerPassword(Password))
|
|
|
+ {
|
|
|
var dialogResult = new DialogResult(ButtonResult.OK);
|
|
|
dialogResult.Parameters.Add(ParameterNames.Password, Password);
|
|
|
dialogResult.Parameters.Add(ParameterNames.PasswordResult, true);
|
|
@@ -147,7 +149,7 @@ namespace PDF_Master.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
|
|
|
|
|
|
private void ClearPassword()
|
|
|
{
|
|
|
- Password= "";
|
|
|
+ Password = "";
|
|
|
}
|
|
|
#endregion
|
|
|
|