|
@@ -1,6 +1,8 @@
|
|
|
using ComPDFKit.PDFWatermark;
|
|
|
+using PDF_Master.Helper;
|
|
|
using PDF_Master.Model;
|
|
|
using PDF_Master.Model.EditTools.Watermark;
|
|
|
+using PDF_Master.Properties;
|
|
|
using Prism.Commands;
|
|
|
using Prism.Mvvm;
|
|
|
using Prism.Regions;
|
|
@@ -32,6 +34,38 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 价格优惠bord
|
|
|
+ /// </summary>
|
|
|
+ private Visibility _Vishalfprice = Visibility.Visible;
|
|
|
+
|
|
|
+ public Visibility Vishalfprice
|
|
|
+ {
|
|
|
+ get { return _Vishalfprice; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ SetProperty(ref _Vishalfprice, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 价格优惠
|
|
|
+ /// </summary>
|
|
|
+ private string _Textprice = "$39.99/year";
|
|
|
+
|
|
|
+ public string Textprice
|
|
|
+ {
|
|
|
+ get { return _Textprice; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ SetProperty(ref _Textprice, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
private string _uristore = "https://www.pdfreaderpro.com/windows/store/permanent";
|
|
|
public string Uristore
|
|
|
{
|
|
@@ -45,7 +79,7 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
|
|
|
|
|
|
public DelegateCommand LinkstoreCommand { get; set; }
|
|
|
public DelegateCommand WarermarkSavingCommand { get; set; }
|
|
|
-
|
|
|
+ public DelegateCommand RefreshCommand { get; set; }
|
|
|
private void InitString()
|
|
|
{
|
|
|
|
|
@@ -55,10 +89,22 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
|
|
|
|
|
|
public SubscriptionDialogViewModel(IRegionManager regionManager, IDialogService dialogService)
|
|
|
{
|
|
|
-
|
|
|
+ RefreshCommand = new DelegateCommand(Refresh);
|
|
|
LinkstoreCommand = new DelegateCommand(Linkstore);
|
|
|
WarermarkSavingCommand = new DelegateCommand(WarermarkSaving);
|
|
|
InitString();
|
|
|
+ if (Settings.Default.UserDate.subscribestatus == 2)
|
|
|
+ {
|
|
|
+ Textprice = "$79.99/year";
|
|
|
+ Vishalfprice = Visibility.Collapsed;
|
|
|
+ }
|
|
|
+
|
|
|
+ else
|
|
|
+ {
|
|
|
+
|
|
|
+ Textprice = "$39.99/year";
|
|
|
+ Vishalfprice = Visibility.Visible;
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
private void Linkstore()
|
|
@@ -67,25 +113,12 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
|
|
|
Process.Start(new ProcessStartInfo(Uristore));
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 水印保存
|
|
|
+ /// </summary>
|
|
|
private void WarermarkSaving()
|
|
|
{
|
|
|
|
|
|
- //string imagePath = "pack://application:,,,/PDF Master;component/Resources/Service/Warermark.png";
|
|
|
- //string imagePath = "D:/PDF Office/PDF Office/Resources/Service/Warermark.png";
|
|
|
- //Uri imageUri = new Uri(imagePath);
|
|
|
- //BitmapImage bitmapImage = new BitmapImage(imageUri);
|
|
|
- //byte[] imageArray;
|
|
|
- //using (MemoryStream memoryStream = new MemoryStream())
|
|
|
- //{
|
|
|
- // PngBitmapEncoder encoder = new PngBitmapEncoder();
|
|
|
- // encoder.Frames.Add(BitmapFrame.Create(bitmapImage));
|
|
|
- // encoder.Save(memoryStream);
|
|
|
- // imageArray = memoryStream.ToArray();
|
|
|
- //}
|
|
|
- //long imageSize = imageArray.Length;
|
|
|
- //int imageWidth = bitmapImage.PixelWidth;
|
|
|
- //int imageHeight = bitmapImage.PixelHeight;
|
|
|
-
|
|
|
|
|
|
Uri resourceUri = new Uri("pack://application:,,,/PDF Master;component/Resources/Service/Warermark.png");
|
|
|
StreamResourceInfo resourceInfo = Application.GetResourceStream(resourceUri);
|
|
@@ -141,6 +174,49 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// 刷新订阅状态按钮
|
|
|
+ /// </summary>
|
|
|
+ private void Refresh()
|
|
|
+ {
|
|
|
+
|
|
|
+ if (Settings.Default.AppProperties.LoginToken != "")
|
|
|
+ {
|
|
|
+ if (ServiceHelper.GetUser() == "401")
|
|
|
+ {
|
|
|
+ App.mainWindowViewModel.UserVis = Visibility.Collapsed;
|
|
|
+ App.mainWindowViewModel.LoginVis = Visibility.Visible;
|
|
|
+ App.mainWindowViewModel.OphVis = Visibility.Visible;
|
|
|
+
|
|
|
+ if (Settings.Default.UserDate.IsLoginoff == false)
|
|
|
+ {
|
|
|
+ App.mainWindowViewModel.OpenLoginoff();
|
|
|
+ Settings.Default.UserDate.IsLoginoff = true;
|
|
|
+ Settings.Default.Save();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ App.mainWindowViewModel.UserVis = Visibility.Collapsed;
|
|
|
+ App.mainWindowViewModel.LoginVis = Visibility.Visible;
|
|
|
+ App.mainWindowViewModel.OphVis = Visibility.Visible;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (Settings.Default.UserDate.subscribestatus == 1)
|
|
|
+ {
|
|
|
+ Close();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
public void Close()
|
|
|
{
|
|
|
RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
|