瀏覽代碼

远程广告大更新

lvle 1 年之前
父節點
當前提交
a63edbd39c

+ 348 - 38
PDF Office/Helper/ADServiceHelper.cs

@@ -55,51 +55,355 @@ namespace PDF_Master.Helper
                     }
                     Console.WriteLine(responseData);
 
-                   
+
                     if (jobject["code"].ToObject<string>().ToLower() == "200")
                     {
-                        //Console.WriteLine(jobject["list"].ToObject<string>());
-                        JArray jarr = JArray.Parse(jobject["list"].ToString());
-                        foreach (var j in jarr)
+
+                        // 从 JObject 获取 list 数组
+
+                        JArray list = (JArray)jobject["list"];
+
+                        JObject RecommondContentPDFPro = (JObject)JObject.Parse(list[0]["detail"].ToString())["recommondContent"][0]["RecommondContentPDFPro"];
+
+                        JObject RecommondContentOther = (JObject)JObject.Parse(list[0]["detail"].ToString())["recommondContent"][0]["RecommondContentOther"];
+              
+                        JArray advertisement = (JArray)JObject.Parse(list[0]["detail"].ToString())["advertisement"];
+                       
+
+                        #region RecommondContentPDFPro参数配置                  
+                        Settings.Default.ADDate.RecommondContentPDFPro_nameen = RecommondContentPDFPro["name"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondContentPDFPro_namezh_CN = RecommondContentPDFPro["name"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondContentPDFPro_namezh_TW = RecommondContentPDFPro["name"]["zh_TW"].ToString();
+                        //RecommondPDFPro
+                        JArray RecommondPDFPro = (JArray)RecommondContentPDFPro["content"];
+                        //recommondPDF - Mac
+                        Settings.Default.ADDate.RecommondPDFPro_Macshow = RecommondPDFPro[0]["show"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Mactype = RecommondPDFPro[0]["type"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_MacsubscriptionType = RecommondPDFPro[0]["subscriptionType"].ToString();                   
+                        Settings.Default.ADDate.RecommondPDFPro_MacstartTime = RecommondPDFPro[0]["startTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondPDFPro_MacendTime = RecommondPDFPro[0]["endTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondPDFPro_Macnameen = RecommondPDFPro[0]["name"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Macnamezh_CN = RecommondPDFPro[0]["name"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Macnamezh_TW = RecommondPDFPro[0]["name"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Mactooltipen = RecommondPDFPro[0]["tooltip"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Mactooltipzh_CN = RecommondPDFPro[0]["tooltip"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Mactooltipzh_TW = RecommondPDFPro[0]["tooltip"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_MaclinkURLen = RecommondPDFPro[0]["linkURL"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_MaclinkURLzh_CN = RecommondPDFPro[0]["linkURL"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_MaclinkURLzh_TW = RecommondPDFPro[0]["linkURL"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Macimagenormal = RecommondPDFPro[0]["image"]["normal_Light"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Macimagehover = RecommondPDFPro[0]["image"]["hover_Light"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Macimageen = RecommondPDFPro[0]["image"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Macimagezh_CN = RecommondPDFPro[0]["image"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Macimagezh_TW = RecommondPDFPro[0]["image"]["zh_TW"].ToString();
+                        string FileNameMac = App.CachePath.ADFilePath + "\\" + "Mac" + ".png";
+                        if (RecommondPDFPro[0]["version"].ToString() != Settings.Default.ADDate.RecommondPDFPro_Macversion|| File.Exists(FileNameMac) == false)
                         {
-                            
-                            Console.WriteLine(j["detail"].ToString());
-                            JObject jobject2 = (JObject)JsonConvert.DeserializeObject(j["detail"].ToString());
-                            Settings.Default.ADDate.ADhiddenSidebar = jobject2["productsidebar"]["hidden"].ToObject<string>();
-                            Settings.Default.ADDate.ADStartTime = jobject2["startTime"].ToObject<long>();
-                            Settings.Default.ADDate.ADEndTime = jobject2["endTime"].ToObject<long>();
-                            if (Settings.Default.ADDate.ADVersion != jobject2["version"].ToObject<string>())
-                            { 
-                                //清除ADTemp文件夹及该目录中的所有子内容
-                                string ADPath = Path.Combine(App.CurrentPath, "ADTemp");
-                                DirectoryInfo Scantempfolder = new DirectoryInfo(ADPath);
-                                if (Scantempfolder.Exists)
-                                {
-                                    Directory.Delete(ADPath, true);
-                                }
-                                IsUpdate = true;
-
-                                Settings.Default.ADDate.ADSidebar = jobject2["productsidebar"]["imageURL"]["en"].ToObject<string>();
-                                Settings.Default.ADDate.ADLinkSidebar = jobject2["productsidebar"]["linkURL"]["en"].ToObject<string>();
-                                
-
-                                Settings.Default.ADDate.ADVersion = jobject2["version"].ToObject<string>();
-                                Settings.Default.Save();
+                            Settings.Default.ADDate.RecommondPDFPro_Macversion = RecommondPDFPro[0]["version"].ToString();
+                            if (File.Exists(FileNameMac) == true)
+                            {
+                                File.Delete(FileNameMac);
                             }
-                            
-                    
+                            WebClient client = new WebClient();
+                            client.DownloadFile(Settings.Default.ADDate.RecommondPDFPro_Macimageen, FileNameMac);
                         }
-                        if(IsUpdate==true)
+                       
+                        //recommondPDF - iPad
+                        Settings.Default.ADDate.RecommondPDFPro_iPadshow = RecommondPDFPro[1]["show"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadtype = RecommondPDFPro[1]["type"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadsubscriptionType = RecommondPDFPro[1]["subscriptionType"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadstartTime = RecommondPDFPro[1]["startTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadendTime = RecommondPDFPro[1]["endTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadnameen = RecommondPDFPro[1]["name"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadnamezh_CN = RecommondPDFPro[1]["name"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadnamezh_TW = RecommondPDFPro[1]["name"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadtooltipen = RecommondPDFPro[1]["tooltip"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadtooltipzh_CN = RecommondPDFPro[1]["tooltip"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadtooltipzh_TW = RecommondPDFPro[1]["tooltip"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadlinkURLen = RecommondPDFPro[1]["linkURL"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadlinkURLzh_CN = RecommondPDFPro[1]["linkURL"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadlinkURLzh_TW = RecommondPDFPro[1]["linkURL"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadimagenormal = RecommondPDFPro[1]["image"]["normal_Light"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadimagehover = RecommondPDFPro[1]["image"]["hover_Light"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadimageen = RecommondPDFPro[1]["image"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadimagezh_CN = RecommondPDFPro[1]["image"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_iPadimagezh_TW = RecommondPDFPro[1]["image"]["zh_TW"].ToString();
+                        string FileNameiPad = App.CachePath.ADFilePath + "\\" + "iPad" + ".png";
+                        if (RecommondPDFPro[1]["version"].ToString() != Settings.Default.ADDate.RecommondPDFPro_iPadversion|| File.Exists(FileNameiPad) == false)
                         {
-                            string path = App.CachePath.ADFilePath;
-                            string FileName = path + "\\" + 1 + ".png";
-                          
-                            WebClient client = new WebClient();                       
-                            client.DownloadFile(Settings.Default.ADDate.ADSidebar, FileName);
+                            Settings.Default.ADDate.RecommondPDFPro_iPadversion = RecommondPDFPro[1]["version"].ToString();
+                           
+                            if (File.Exists(FileNameiPad) == true)
+                            {
+                                File.Delete(FileNameiPad);
+                            }
+                            WebClient client = new WebClient();
+                            client.DownloadFile(Settings.Default.ADDate.RecommondPDFPro_iPadimageen, FileNameiPad);
                         }
-                       
+                        //recommondPDF - Android
+                        Settings.Default.ADDate.RecommondPDFPro_Androidshow = RecommondPDFPro[2]["show"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Androidtype = RecommondPDFPro[2]["type"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_AndroidsubscriptionType = RecommondPDFPro[2]["subscriptionType"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_AndroidstartTime = RecommondPDFPro[2]["startTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondPDFPro_AndroidendTime = RecommondPDFPro[2]["endTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondPDFPro_Androidnameen = RecommondPDFPro[2]["name"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Androidnamezh_CN = RecommondPDFPro[2]["name"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Androidnamezh_TW = RecommondPDFPro[2]["name"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Androidtooltipen = RecommondPDFPro[2]["tooltip"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Androidtooltipzh_CN = RecommondPDFPro[2]["tooltip"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Androidtooltipzh_TW = RecommondPDFPro[2]["tooltip"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_AndroidlinkURLen = RecommondPDFPro[2]["linkURL"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_AndroidlinkURLzh_CN = RecommondPDFPro[2]["linkURL"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_AndroidlinkURLzh_TW = RecommondPDFPro[2]["linkURL"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Androidimagenormal = RecommondPDFPro[2]["image"]["normal_Light"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Androidimagehover = RecommondPDFPro[2]["image"]["hover_Light"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Androidimageen = RecommondPDFPro[2]["image"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Androidimagezh_CN = RecommondPDFPro[2]["image"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondPDFPro_Androidimagezh_TW = RecommondPDFPro[2]["image"]["zh_TW"].ToString();
+                        string FileNameAndroid = App.CachePath.ADFilePath + "\\" + "Android" + ".png";
+                        if (RecommondPDFPro[2]["version"].ToString() != Settings.Default.ADDate.RecommondPDFPro_Androidversion|| File.Exists(FileNameAndroid) == false)
+                        {
+                            Settings.Default.ADDate.RecommondPDFPro_Androidversion = RecommondPDFPro[2]["version"].ToString();
+                            if (File.Exists(FileNameAndroid) == true)
+                            {
+                                File.Delete(FileNameAndroid);
+                            }
+                            WebClient client = new WebClient();
+                            client.DownloadFile(Settings.Default.ADDate.RecommondPDFPro_Androidimageen, FileNameAndroid);
+                        }
+                        #endregion
+
+                        #region RecommondContentOther参数配置                  
+                        Settings.Default.ADDate.RecommondContentOther_version = RecommondContentOther["version"].ToString();
+                        Settings.Default.ADDate.RecommondContentOther_nameen = RecommondContentOther["name"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondContentOther_namezh_CN = RecommondContentOther["name"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondContentOther_namezh_TW = RecommondContentOther["name"]["zh_TW"].ToString();
+                        //RecommondOther
+                        JArray RecommondOther = (JArray)RecommondContentOther["content"];
+                        //recommondPDF-ComPDFKit
+                        Settings.Default.ADDate.RecommondOther_ComPDFKitshow = RecommondOther[0]["show"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKittype = RecommondOther[0]["type"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKitsubscriptionType = RecommondOther[0]["subscriptionType"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKitstartTime = RecommondOther[0]["startTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKitendTime = RecommondOther[0]["endTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKitnameen = RecommondOther[0]["name"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKitnamezh_CN = RecommondOther[0]["name"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKitnamezh_TW = RecommondOther[0]["name"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKittooltipen = RecommondOther[0]["tooltip"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKittooltipzh_CN = RecommondOther[0]["tooltip"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKittooltipzh_TW = RecommondOther[0]["tooltip"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKitlinkURLen = RecommondOther[0]["linkURL"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKitlinkURLzh_CN = RecommondOther[0]["linkURL"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKitlinkURLzh_TW = RecommondOther[0]["linkURL"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKitimagenormal = RecommondOther[0]["image"]["normal_Light"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKitimagehover = RecommondOther[0]["image"]["hover_Light"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKitimageen = RecommondOther[0]["image"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKitimagezh_CN = RecommondOther[0]["image"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComPDFKitimagezh_TW = RecommondOther[0]["image"]["zh_TW"].ToString();
+                        string FileNameComPDFKit = App.CachePath.ADFilePath + "\\" + "ComPDFKit" + ".png";
+                        if (RecommondOther[0]["version"].ToString() != Settings.Default.ADDate.RecommondOther_ComPDFKitversion|| File.Exists(FileNameComPDFKit) ==false)
+                        {
+                            Settings.Default.ADDate.RecommondOther_ComPDFKitversion = RecommondOther[0]["version"].ToString();
+                            if (File.Exists(FileNameComPDFKit) == true)
+                            {
+                                File.Delete(FileNameComPDFKit);
+                            }
+                            WebClient client = new WebClient();
+                            client.DownloadFile(Settings.Default.ADDate.RecommondOther_ComPDFKitimageen, FileNameComPDFKit);
+                        }
+                        //recommondPDF-ComVideoKit
+                        Settings.Default.ADDate.RecommondOther_ComVideoKitshow = RecommondOther[1]["show"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKittype = RecommondOther[1]["type"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKitsubscriptionType = RecommondOther[1]["subscriptionType"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKitstartTime = RecommondOther[1]["startTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKitendTime = RecommondOther[1]["endTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKitnameen = RecommondOther[1]["name"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKitnamezh_CN = RecommondOther[1]["name"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKitnamezh_TW = RecommondOther[1]["name"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKittooltipen = RecommondOther[1]["tooltip"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKittooltipzh_CN = RecommondOther[1]["tooltip"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKittooltipzh_TW = RecommondOther[1]["tooltip"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKitlinkURLen = RecommondOther[1]["linkURL"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKitlinkURLzh_CN = RecommondOther[1]["linkURL"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKitlinkURLzh_TW = RecommondOther[1]["linkURL"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKitimagenormal = RecommondOther[1]["image"]["normal_Light"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKitimagehover = RecommondOther[1]["image"]["hover_Light"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKitimageen = RecommondOther[1]["image"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKitimagezh_CN = RecommondOther[1]["image"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_ComVideoKitimagezh_TW = RecommondOther[1]["image"]["zh_TW"].ToString();
+                        string FileNameComVideoKit = App.CachePath.ADFilePath + "\\" + "ComVideoKit" + ".png";
+                        if (RecommondOther[1]["version"].ToString() != Settings.Default.ADDate.RecommondOther_ComVideoKitversion|| File.Exists(FileNameComVideoKit) == false)
+                        {
+                            Settings.Default.ADDate.RecommondOther_ComVideoKitversion = RecommondOther[1]["version"].ToString();                         
+                            if (File.Exists(FileNameComVideoKit) == true)
+                            {
+                                File.Delete(FileNameComVideoKit);
+                            }
+                            WebClient client = new WebClient();
+                            client.DownloadFile(Settings.Default.ADDate.RecommondOther_ComVideoKitimageen, FileNameComVideoKit);
+                        }
+                        //recommondPDF-SignFlow
+                        Settings.Default.ADDate.RecommondOther_SignFlowshow = RecommondOther[2]["show"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlowtype = RecommondOther[2]["type"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlowsubscriptionType = RecommondOther[2]["subscriptionType"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlowstartTime = RecommondOther[2]["startTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondOther_SignFlowendTime = RecommondOther[2]["endTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondOther_SignFlownameen = RecommondOther[2]["name"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlownamezh_CN = RecommondOther[2]["name"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlownamezh_TW = RecommondOther[2]["name"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlowtooltipen = RecommondOther[2]["tooltip"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlowtooltipzh_CN = RecommondOther[2]["tooltip"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlowtooltipzh_TW = RecommondOther[2]["tooltip"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlowlinkURLen = RecommondOther[2]["linkURL"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlowlinkURLzh_CN = RecommondOther[2]["linkURL"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlowlinkURLzh_TW = RecommondOther[2]["linkURL"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlowimagenormal = RecommondOther[2]["image"]["normal_Light"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlowimagehover = RecommondOther[2]["image"]["hover_Light"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlowimageen = RecommondOther[2]["image"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlowimagezh_CN = RecommondOther[2]["image"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_SignFlowimagezh_TW = RecommondOther[2]["image"]["zh_TW"].ToString();
+                        string FileNameSignFlow = App.CachePath.ADFilePath + "\\" + "SignFlow" + ".png";
+                        if (RecommondOther[2]["version"].ToString() != Settings.Default.ADDate.RecommondOther_SignFlowversion|| File.Exists(FileNameSignFlow) == false)
+                        {
+                            Settings.Default.ADDate.RecommondOther_SignFlowversion = RecommondOther[2]["version"].ToString();
+                            if (File.Exists(FileNameSignFlow) == true)
+                            {
+                                File.Delete(FileNameSignFlow);
+                            }
+                            WebClient client = new WebClient();
+                            client.DownloadFile(Settings.Default.ADDate.RecommondOther_SignFlowimageen, FileNameSignFlow);
+                        }
+                        //recommondPDF-FilmageEditor
+                        Settings.Default.ADDate.RecommondOther_FilmageEditorshow = RecommondOther[3]["show"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditortype = RecommondOther[3]["type"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditorsubscriptionType = RecommondOther[3]["subscriptionType"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditorstartTime = RecommondOther[3]["startTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditorendTime = RecommondOther[3]["endTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditornameen = RecommondOther[3]["name"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditornamezh_CN = RecommondOther[3]["name"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditornamezh_TW = RecommondOther[3]["name"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditortooltipen = RecommondOther[3]["tooltip"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditortooltipzh_CN = RecommondOther[3]["tooltip"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditortooltipzh_TW = RecommondOther[3]["tooltip"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditorlinkURLen = RecommondOther[3]["linkURL"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditorlinkURLzh_CN = RecommondOther[3]["linkURL"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditorlinkURLzh_TW = RecommondOther[3]["linkURL"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditorimagenormal = RecommondOther[3]["image"]["normal_Light"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditorimagehover = RecommondOther[3]["image"]["hover_Light"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditorimageen = RecommondOther[3]["image"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditorimagezh_CN = RecommondOther[3]["image"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageEditorimagezh_TW = RecommondOther[3]["image"]["zh_TW"].ToString();
+                        string FileNameFilmageEditor = App.CachePath.ADFilePath + "\\" + "FilmageEditor" + ".png";
+                        if (RecommondOther[3]["version"].ToString() != Settings.Default.ADDate.RecommondOther_FilmageEditorversion|| File.Exists(FileNameFilmageEditor) == false)
+                        {
+                            Settings.Default.ADDate.RecommondOther_FilmageEditorversion = RecommondOther[3]["version"].ToString();
+                            if (File.Exists(FileNameFilmageEditor) == true)
+                            {
+                                File.Delete(FileNameFilmageEditor);
+                            }
+                            WebClient client = new WebClient();
+                            client.DownloadFile(Settings.Default.ADDate.RecommondOther_FilmageEditorimageen, FileNameFilmageEditor);
+                        }
+                        //recommondPDF-FilmageScreen
+                        Settings.Default.ADDate.RecommondOther_FilmageScreenshow = RecommondOther[4]["show"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreentype = RecommondOther[4]["type"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreensubscriptionType = RecommondOther[4]["subscriptionType"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreenstartTime = RecommondOther[4]["startTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreenendTime = RecommondOther[4]["endTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreennameen = RecommondOther[4]["name"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreennamezh_CN = RecommondOther[4]["name"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreennamezh_TW = RecommondOther[4]["name"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreentooltipen = RecommondOther[4]["tooltip"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreentooltipzh_CN = RecommondOther[4]["tooltip"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreentooltipzh_TW = RecommondOther[4]["tooltip"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreenlinkURLen = RecommondOther[4]["linkURL"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreenlinkURLzh_CN = RecommondOther[4]["linkURL"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreenlinkURLzh_TW = RecommondOther[4]["linkURL"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreenimagenormal = RecommondOther[4]["image"]["normal_Light"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreenimagehover = RecommondOther[4]["image"]["hover_Light"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreenimageen = RecommondOther[4]["image"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreenimagezh_CN = RecommondOther[4]["image"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FilmageScreenimagezh_TW = RecommondOther[4]["image"]["zh_TW"].ToString();
+                        string FileNameFilmageScreen = App.CachePath.ADFilePath + "\\" + "FilmageScreen" + ".png";
+                        if (RecommondOther[4]["version"].ToString() != Settings.Default.ADDate.RecommondOther_FilmageScreenversion|| File.Exists(FileNameFilmageScreen) == false)
+                        {
+                            Settings.Default.ADDate.RecommondOther_FilmageScreenversion = RecommondOther[4]["version"].ToString();
+                            if (File.Exists(FileNameFilmageScreen) == true)
+                            {
+                                File.Delete(FileNameFilmageScreen);
+                            }
+                            WebClient client = new WebClient();
+                            client.DownloadFile(Settings.Default.ADDate.RecommondOther_FilmageScreenimageen, FileNameFilmageScreen);
+                        }
+                        //recommondPDF-FreePDFTemplates
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatesshow = RecommondOther[5]["show"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatestype = RecommondOther[5]["type"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatessubscriptionType = RecommondOther[5]["subscriptionType"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatesstartTime = RecommondOther[5]["startTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatesendTime = RecommondOther[5]["endTime"].ToObject<long>();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatesnameen = RecommondOther[5]["name"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatesnamezh_CN = RecommondOther[5]["name"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatesnamezh_TW = RecommondOther[5]["name"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatestooltipen = RecommondOther[5]["tooltip"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatestooltipzh_CN = RecommondOther[5]["tooltip"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatestooltipzh_TW = RecommondOther[5]["tooltip"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplateslinkURLen = RecommondOther[5]["linkURL"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplateslinkURLzh_CN = RecommondOther[5]["linkURL"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplateslinkURLzh_TW = RecommondOther[5]["linkURL"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatesimagenormal = RecommondOther[5]["image"]["normal_Light"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatesimagehover = RecommondOther[5]["image"]["hover_Light"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatesimageen = RecommondOther[5]["image"]["en"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatesimagezh_CN = RecommondOther[5]["image"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.RecommondOther_FreePDFTemplatesimagezh_TW = RecommondOther[5]["image"]["zh_TW"].ToString();
+                        string FileNameFreePDFTemplates = App.CachePath.ADFilePath + "\\" + "FreePDFTemplates" + ".png";
+                        if (RecommondOther[5]["version"].ToString() != Settings.Default.ADDate.RecommondOther_FreePDFTemplatesversion|| File.Exists(FileNameFreePDFTemplates) == false)
+                        {
+                            Settings.Default.ADDate.RecommondOther_FreePDFTemplatesversion = RecommondOther[5]["version"].ToString();
+                            if (File.Exists(FileNameFreePDFTemplates) == true)
+                            {
+                                File.Delete(FileNameFreePDFTemplates);
+                            }
+                            WebClient client = new WebClient();
+                            client.DownloadFile(Settings.Default.ADDate.RecommondOther_FreePDFTemplatesimageen, FileNameFreePDFTemplates);
+                        }
+                        #endregion
+
+                        #region advertisement参数配置                  
+                        Settings.Default.ADDate.advertisement_BlackFridayshow = advertisement[0]["show"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridaytype = advertisement[0]["type"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridaysubscriptionType = advertisement[0]["subscriptionType"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridaystartTime = advertisement[0]["startTime"].ToObject<long>();
+                        Settings.Default.ADDate.advertisement_BlackFridayendTime = advertisement[0]["endTime"].ToObject<long>();
+                        Settings.Default.ADDate.advertisement_BlackFridayshowCloseBtn = advertisement[0]["showCloseBtn"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridaynameen = advertisement[0]["name"]["en"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridaynamezh_CN = advertisement[0]["name"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridaynamezh_TW = advertisement[0]["name"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridaytooltipen = advertisement[0]["tooltip"]["en"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridaytooltipzh_CN = advertisement[0]["tooltip"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridaytooltipzh_TW = advertisement[0]["tooltip"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridaylinkURLen = advertisement[0]["linkURL"]["en"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridaylinkURLzh_CN = advertisement[0]["linkURL"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridaylinkURLzh_TW = advertisement[0]["linkURL"]["zh_TW"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridayimagenormal = advertisement[0]["image"]["normal_Light"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridayimagehover = advertisement[0]["image"]["hover_Light"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridayimageen = advertisement[0]["image"]["en"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridayimagezh_CN = advertisement[0]["image"]["zh_CN"].ToString();
+                        Settings.Default.ADDate.advertisement_BlackFridayimagezh_TW = advertisement[0]["image"]["zh_TW"].ToString();
+                        string FileNameBlackFriday = App.CachePath.ADFilePath + "\\" + "advertisement" + ".png";
+                        if (advertisement[0]["version"].ToString() != Settings.Default.ADDate.advertisement_BlackFridayversion|| File.Exists(FileNameBlackFriday) == false)
+                        {
+                            if (File.Exists(FileNameBlackFriday) == true)
+                            {
+                                File.Delete(FileNameBlackFriday);
+                            }
+                            WebClient client = new WebClient();
+                            client.DownloadFile(Settings.Default.ADDate.advertisement_BlackFridayimageen, FileNameBlackFriday);
+                        }
+                        #endregion
+
+                        Settings.Default.Save();
                     }
-                    string str1 = System.Environment.CurrentDirectory;
+
                     return jobject["code"].ToObject<string>().ToLower();
                 }
                
@@ -113,9 +417,15 @@ namespace PDF_Master.Helper
                 {
                     return "404";
                 }
-                else return "0000";
+                else
+                    return "0000";
+
 
             }
+            catch(Exception e)
+            {
+                return "0000";
+            }
 
         }
 

+ 10 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/CreateFromScannerDialogsViewModel.cs

@@ -274,6 +274,16 @@ namespace PDF_Master.ViewModels.Dialog.HomePageToolsDialogs
 
                     if (j == SeIndex)
                     {
+                        //device = deviceManager.DeviceInfos[i].Connect();
+                        //const string WIA_SCAN_COLOR_MODE = "{B9F49665-9A07-4B70-9AE7-B06FC1A4BE3D}";
+                        //const string WIA_HORIZONTAL_RESOLUTION = "{6146}";
+                        //const string WIA_VERTICAL_RESOLUTION = "{6147}";
+                        //var scanner = deviceManager.DeviceInfos[i].Connect();
+                        //var item = device.Items[1] as Item;
+                        //item.Properties["6146"].set_Value(300);
+                        //item.Properties[WIA_SCAN_COLOR_MODE].set_Value(2);
+                        //item.Properties[WIA_HORIZONTAL_RESOLUTION].set_Value(300);
+                        //item.Properties[WIA_VERTICAL_RESOLUTION].set_Value(300);
                         device = deviceManager.DeviceInfos[i].Connect();
                         items = dialog.ShowSelectItems(device, SingleSelect: true);
                         if (items != null)

+ 1 - 1
PDF Office/ViewModels/MainWindowViewModel.cs

@@ -348,7 +348,7 @@ namespace PDF_Master.ViewModels
                 ));
 
                 App.IsFirstOpen = false;
-                //ADServiceHelper.GetAD("PDFMasterWindows");
+                ADServiceHelper.GetAD("PDFMasterWindows");
 
 
             }

+ 12 - 10
PDF Office/Views/Dialog/ServiceDialog/UserDialog.xaml

@@ -64,16 +64,20 @@
                             Width="48"
                             Height="48"
                             HorizontalAlignment="Center"
+                            VerticalAlignment="Center"
                             Background="#1770F4"
                             CornerRadius="100">
-                            <TextBlock
-                        VerticalAlignment="Center"
-                        HorizontalAlignment="Center"
-                      FontFamily="SF Pro Text"
-                        FontSize="28"                             
-                        FontWeight="SemiBold"
-                        Foreground="White"
-                      Text="{Binding Useremailchar,Mode=TwoWay}" />
+                            <Grid HorizontalAlignment="Center" VerticalAlignment="Center" >
+                                <TextBlock
+                                    HorizontalAlignment="Center"
+                                    VerticalAlignment="Center"
+                                    Height="Auto"
+                                    FontSize="28"
+                                    FontWeight="SemiBold"
+                                    Foreground="White"
+                                    Text="O" />
+                            </Grid>
+
                         </Border>
                         <TextBlock
                             Margin="0,20,0,0"
@@ -87,14 +91,12 @@
                             Text="{Binding Text_admail}" />
                         <TextBlock
                             Width="172"
-                          
                             Margin="0,10,0,0"
                             HorizontalAlignment="Center"
                             FontFamily="Segoe UI"
                             FontSize="14"
                             FontStyle="Normal"
                             Foreground="#252629"
-          
                             Text="{Binding UserEmail}"
                             TextAlignment="Center"
                             TextWrapping="Wrap" />

+ 11 - 4
PDF Office/Views/HomePanel/PromotionContent.xaml

@@ -54,9 +54,12 @@
                     <Expander.Header>
                         <Grid Name="GridHeader" Height="32">
                             <TextBlock
+                                x:Name="Text_PDFPro"
                                 Margin="16,0"
                                 VerticalAlignment="Center"
-                                Text="PDF Pro Series"
+                                FontFamily="Segoe UI"
+                                FontSize="12"
+                                FontWeight="SemiBold"
                                 TextAlignment="Left" />
                         </Grid>
                     </Expander.Header>
@@ -98,7 +101,12 @@
                             Height="32"
                             Margin="16,0"
                             HorizontalAlignment="Center">
-                            <TextBlock VerticalAlignment="Center" Text="Others" />
+                            <TextBlock
+                                x:Name="Text_Others"
+                                VerticalAlignment="Center"
+                                FontFamily="Segoe UI"
+                                FontSize="12"
+                                FontWeight="SemiBold" />
                         </Grid>
                     </Expander.Header>
                     <Border CornerRadius="4">
@@ -137,8 +145,7 @@
                 Height="243"
                 Margin="0,24"
                 VerticalAlignment="Bottom"
-                PreviewMouseLeftButtonDown="ImgeActivity_PreviewMouseLeftButtonDown"
-                 />
+                PreviewMouseLeftButtonDown="ImgeActivity_PreviewMouseLeftButtonDown" />
         </Grid>
     </ScrollViewer>
 </UserControl>

+ 54 - 41
PDF Office/Views/HomePanel/PromotionContent.xaml.cs

@@ -28,72 +28,78 @@ namespace PDF_Master.Views.HomePanel
         /// <summary>
         /// 活动链接
         /// </summary>
-        public string ActiveUri = @"https://apps.apple.com/app/apple-store/id1475051178?pt=118745145&ct=pdfmac-promo&mt=8";
+        public string ActiveUri = Settings.Default.ADDate.advertisement_BlackFridaylinkURLen;
 
-        public string WindowsUri = @"https://www.pdfreaderpro.com/windows";
+        public string iPad = Settings.Default.ADDate.RecommondPDFPro_iPadlinkURLen;
 
-        public string iPad = @"https://www.pdfreaderpro.com/ios";
+        public string Mac = Settings.Default.ADDate.RecommondPDFPro_MaclinkURLen;
 
-        public string Mac = @"https://www.pdfreaderpro.com/mac";
+        public string Android = Settings.Default.ADDate.RecommondPDFPro_AndroidlinkURLen;
 
-        public string Android = @"https://www.pdfreaderpro.com/android";
+        public string ComPDFKit = Settings.Default.ADDate.RecommondOther_ComPDFKitlinkURLen;
 
-        public string ComPDFKit = @"https://www.compdf.com?utm_source=macapp&utm_medium=pdfmac&utm_campaign=compdfkit-promp";
+        public string ComVideoKit = Settings.Default.ADDate.RecommondOther_ComVideoKitlinkURLen;
 
-        public string ComVideoKit = @"https://www.filmagepro.com/video-sdk?utm_source=macapp&utm_medium=pdfmac&utm_campaign=comvideosdk-promo";
+        public string SignFlow = Settings.Default.ADDate.RecommondOther_SignFlowlinkURLen;
 
-        public string SignFlow = @"https://apps.apple.com/app/apple-store/id1584624017?pt=118745145&ct=pdfmac-promo&mt=8";
+        public string FilmageEditor = Settings.Default.ADDate.RecommondOther_FilmageEditorlinkURLen;
 
-        public string FilmageEditor = @"https://apps.apple.com/app/apple-store/id1475051178?pt=118745145&ct=pdfmac-promo&mt=8";
+        public string FilmageScreen = Settings.Default.ADDate.RecommondOther_FilmageScreenlinkURLen;
 
-        public string FilmageScreen = @"https://apps.apple.com/app/apple-store/id1475049179?pt=118745145&ct=pdfmac-promo&mt=8";
-
-        public string FreePDFTemplates = @"https://www.pdfreaderpro.com/templates?utm_source=MacApp&utm_campaign=PDFProMac&utm_medium=pdfmac_promo";
+        public string FreePDFTemplates = Settings.Default.ADDate.RecommondOther_FreePDFTemplateslinkURLen;
 
         public PromotionContent()
         {
             InitializeComponent();
             InitPromotionBanner();
-            //LoadPromotionContents();
             ADDispaly();
-            string path = App.CachePath.ADFilePath;
-            string FileName = path + "\\" + 1 + ".png";
-            ImgeActivity.Source =new BitmapImage(new Uri(  path + "\\" + 1 + ".png"));
-
-
         }
 
         private void InitPromotionBanner()
         {
-            PDFProPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/Mac.png", "Mac",Mac));
-            PDFProPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/IPhoneiPad.png", "IPhone /iPad",iPad));
-            PDFProPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/Android.png", "Android",Android));
-            PDFProListview.ItemsSource = PDFProPromotion;
-
-            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/ComPDFKit.png", "ComPDFKit",ComPDFKit));
-            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/ComVideoKit.png", "ComVideoKit",ComVideoKit));
-            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/SignFlow.png", "SignFlow",SignFlow));
-            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/FilmageEditor.png", "Filmage Editor",FilmageEditor));
-            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/FilmageScreen.png", "Filmage Screen",FilmageEditor));
-            OthersPromotion.Add(new PromotionBanner("pack://application:,,,/Resources/PromotionIcon/FreePDFTemplates.png", "Free PDF Templates",FreePDFTemplates));
-            OthersListview.ItemsSource = OthersPromotion;
+            try 
+            {
+                Text_PDFPro.Text = Settings.Default.ADDate.RecommondContentPDFPro_nameen;
+                Text_Others.Text = Settings.Default.ADDate.RecommondContentOther_nameen;
+                PDFProPromotion.Add(new PromotionBanner(App.CachePath.ADFilePath + "\\" + "Mac" + ".png", Settings.Default.ADDate.RecommondPDFPro_Macnameen, Mac));
+                PDFProPromotion.Add(new PromotionBanner(App.CachePath.ADFilePath + "\\" + "iPad" + ".png", Settings.Default.ADDate.RecommondPDFPro_iPadnameen, iPad));
+                PDFProPromotion.Add(new PromotionBanner(App.CachePath.ADFilePath + "\\" + "Android" + ".png", Settings.Default.ADDate.RecommondPDFPro_Androidnameen, Android));
+                PDFProListview.ItemsSource = PDFProPromotion;
+
+                OthersPromotion.Add(new PromotionBanner(App.CachePath.ADFilePath + "\\" + "ComPDFKit" + ".png", Settings.Default.ADDate.RecommondOther_ComPDFKitnameen, ComPDFKit));
+                OthersPromotion.Add(new PromotionBanner(App.CachePath.ADFilePath + "\\" + "ComVideoKit" + ".png", Settings.Default.ADDate.RecommondOther_ComVideoKitnameen, ComVideoKit));
+                OthersPromotion.Add(new PromotionBanner(App.CachePath.ADFilePath + "\\" + "SignFlow" + ".png", Settings.Default.ADDate.RecommondOther_SignFlownameen, SignFlow));
+                OthersPromotion.Add(new PromotionBanner(App.CachePath.ADFilePath + "\\" + "FilmageEditor" + ".png", Settings.Default.ADDate.RecommondOther_FilmageEditornameen, FilmageEditor));
+                OthersPromotion.Add(new PromotionBanner(App.CachePath.ADFilePath + "\\" + "FilmageScreen" + ".png", Settings.Default.ADDate.RecommondOther_FilmageScreennameen, FilmageScreen));
+                OthersPromotion.Add(new PromotionBanner(App.CachePath.ADFilePath + "\\" + "FreePDFTemplates" + ".png", Settings.Default.ADDate.RecommondOther_FreePDFTemplatesnameen, FreePDFTemplates));
+                OthersListview.ItemsSource = OthersPromotion;
+            }
+           catch { };
+
+
+
         }
 
 
         private void ADDispaly()
         {
-            DateTime targetstartTime = DateTimeOffset.FromUnixTimeMilliseconds(Settings.Default.ADDate.ADStartTime).DateTime; 
-            DateTime targetendTime = DateTimeOffset.FromUnixTimeMilliseconds(Settings.Default.ADDate.ADEndTime).DateTime; 
-            DateTime localTime = DateTime.Now; 
-            
-            if (Settings.Default.ADDate.ADhiddenSidebar.ToLower()=="false"&& localTime<targetendTime&&localTime>targetstartTime)
-            {
-                ImgeActivity.Visibility = Visibility.Visible;
-            }
-            else 
+            try
             {
-                ImgeActivity.Visibility = Visibility.Collapsed;
+                ImgeActivity.Source = new BitmapImage(new Uri(App.CachePath.ADFilePath + "\\" + "advertisement" + ".png"));
+                DateTime targetstartTime = DateTimeOffset.FromUnixTimeMilliseconds(Settings.Default.ADDate.advertisement_BlackFridaystartTime).DateTime;
+                DateTime targetendTime = DateTimeOffset.FromUnixTimeMilliseconds(Settings.Default.ADDate.advertisement_BlackFridayendTime).DateTime;
+                DateTime localTime = DateTime.Now;
+
+                if (localTime < targetendTime && localTime > targetstartTime)
+                {
+                    ImgeActivity.Visibility = Visibility.Visible;
+                }
+                else
+                {
+                    ImgeActivity.Visibility = Visibility.Collapsed;
+                }
             }
+            catch { };
         }
 
         private void LoadPromotionContents()                                          
@@ -129,7 +135,14 @@ namespace PDF_Master.Views.HomePanel
 
         private void ImgeActivity_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
-            GotoURI(Settings.Default.ADDate.ADLinkSidebar);
+            try
+            {
+                GotoURI(Settings.Default.ADDate.advertisement_BlackFridaylinkURLen);
+            }
+            catch
+            {
+
+            }
         }
 
         /// <summary>

+ 257 - 7
PDFSettings/ADDate.cs

@@ -8,15 +8,265 @@ namespace PDFSettings
 {
    public class ADDate
     {
-         public string ADVersion { get; set; }
-        public long ADStartTime { get; set; }
-        public long ADEndTime { get; set; }
-        
 
+        #region RecommondContentPDFPro
+        //RecommondContentPDFPro表头
+        public string RecommondContentPDFPro_version { get; set; }
+        public string RecommondContentPDFPro_nameen { get; set; }
+        public string RecommondContentPDFPro_namezh_CN { get; set; }
+        public string RecommondContentPDFPro_namezh_TW { get; set; }
+
+
+        //RecommondPDFPro-MAC
+        public string RecommondPDFPro_Macshow { get; set; }
+        public string RecommondPDFPro_Mactype { get; set; }
+        public string RecommondPDFPro_MacsubscriptionType { get; set; }
+        public string RecommondPDFPro_Macversion { get; set; }
+        public long RecommondPDFPro_MacstartTime { get; set; }
+        public long RecommondPDFPro_MacendTime { get; set; }
+        public string RecommondPDFPro_Macnameen { get; set; }
+        public string RecommondPDFPro_Macnamezh_CN { get; set; }
+        public string RecommondPDFPro_Macnamezh_TW { get; set; }
+        public string RecommondPDFPro_Mactooltipen { get; set; }
+        public string RecommondPDFPro_Mactooltipzh_CN { get; set; }
+        public string RecommondPDFPro_Mactooltipzh_TW { get; set; }
+        public string RecommondPDFPro_MaclinkURLen { get; set; }
+        public string RecommondPDFPro_MaclinkURLzh_CN { get; set; }
+        public string RecommondPDFPro_MaclinkURLzh_TW { get; set; }
+        public string RecommondPDFPro_Macimagenormal { get; set; }
+        public string RecommondPDFPro_Macimagehover { get; set; }
+        public string RecommondPDFPro_Macimageen { get; set; }
+        public string RecommondPDFPro_Macimagezh_CN { get; set; }
+        public string RecommondPDFPro_Macimagezh_TW { get; set; }
+
+
+
+        //RecommondPDFPro-ipad
+        public string RecommondPDFPro_iPadshow { get; set; }
+        public string RecommondPDFPro_iPadtype { get; set; }
+        public string RecommondPDFPro_iPadsubscriptionType { get; set; }
+        public string RecommondPDFPro_iPadversion { get; set; }
+        public long RecommondPDFPro_iPadstartTime { get; set; }
+        public long RecommondPDFPro_iPadendTime { get; set; }
+        public string RecommondPDFPro_iPadnameen { get; set; }
+        public string RecommondPDFPro_iPadnamezh_CN { get; set; }
+        public string RecommondPDFPro_iPadnamezh_TW { get; set; }
+        public string RecommondPDFPro_iPadtooltipen { get; set; }
+        public string RecommondPDFPro_iPadtooltipzh_CN { get; set; }
+        public string RecommondPDFPro_iPadtooltipzh_TW { get; set; }
+        public string RecommondPDFPro_iPadlinkURLen { get; set; }
+        public string RecommondPDFPro_iPadlinkURLzh_CN { get; set; }
+        public string RecommondPDFPro_iPadlinkURLzh_TW { get; set; }
+        public string RecommondPDFPro_iPadimagenormal { get; set; }
+        public string RecommondPDFPro_iPadimagehover { get; set; }
+        public string RecommondPDFPro_iPadimageen { get; set; }
+        public string RecommondPDFPro_iPadimagezh_CN { get; set; }
+        public string RecommondPDFPro_iPadimagezh_TW { get; set; }
+
+
+
+        //RecommondPDFPro-Android
+        public string RecommondPDFPro_Androidshow { get; set; }
+        public string RecommondPDFPro_Androidtype { get; set; }
+        public string RecommondPDFPro_AndroidsubscriptionType { get; set; }
+        public string RecommondPDFPro_Androidversion { get; set; }
+        public long RecommondPDFPro_AndroidstartTime { get; set; }
+        public long RecommondPDFPro_AndroidendTime { get; set; }
+        public string RecommondPDFPro_Androidnameen { get; set; }
+        public string RecommondPDFPro_Androidnamezh_CN { get; set; }
+        public string RecommondPDFPro_Androidnamezh_TW { get; set; }
+        public string RecommondPDFPro_Androidtooltipen { get; set; }
+        public string RecommondPDFPro_Androidtooltipzh_CN { get; set; }
+        public string RecommondPDFPro_Androidtooltipzh_TW { get; set; }
+        public string RecommondPDFPro_AndroidlinkURLen { get; set; }
+        public string RecommondPDFPro_AndroidlinkURLzh_CN { get; set; }
+        public string RecommondPDFPro_AndroidlinkURLzh_TW { get; set; }
+        public string RecommondPDFPro_Androidimagenormal { get; set; }
+        public string RecommondPDFPro_Androidimagehover { get; set; }
+        public string RecommondPDFPro_Androidimageen { get; set; }
+        public string RecommondPDFPro_Androidimagezh_CN { get; set; }
+        public string RecommondPDFPro_Androidimagezh_TW { get; set; }
+
+        #endregion
+
+
+        #region RecommondContentPDFOther
+        //RecommondContentPDFOther表头
+        public string RecommondContentOther_version { get; set; }
+        public string RecommondContentOther_nameen { get; set; }
+        public string RecommondContentOther_namezh_CN { get; set; }
+        public string RecommondContentOther_namezh_TW { get; set; }
+
+
+        //RecommondOther-ComPDFKit
+        public string RecommondOther_ComPDFKitshow { get; set; }
+        public string RecommondOther_ComPDFKittype { get; set; }
+        public string RecommondOther_ComPDFKitsubscriptionType { get; set; }
+        public string RecommondOther_ComPDFKitversion { get; set; }
+        public long RecommondOther_ComPDFKitstartTime { get; set; }
+        public long RecommondOther_ComPDFKitendTime { get; set; }
+        public string RecommondOther_ComPDFKitnameen { get; set; }
+        public string RecommondOther_ComPDFKitnamezh_CN { get; set; }
+        public string RecommondOther_ComPDFKitnamezh_TW { get; set; }
+        public string RecommondOther_ComPDFKittooltipen { get; set; }
+        public string RecommondOther_ComPDFKittooltipzh_CN { get; set; }
+        public string RecommondOther_ComPDFKittooltipzh_TW { get; set; }
+        public string RecommondOther_ComPDFKitlinkURLen { get; set; }
+        public string RecommondOther_ComPDFKitlinkURLzh_CN { get; set; }
+        public string RecommondOther_ComPDFKitlinkURLzh_TW { get; set; }
+        public string RecommondOther_ComPDFKitimagenormal { get; set; }
+        public string RecommondOther_ComPDFKitimagehover { get; set; }
+        public string RecommondOther_ComPDFKitimageen { get; set; }
+        public string RecommondOther_ComPDFKitimagezh_CN { get; set; }
+        public string RecommondOther_ComPDFKitimagezh_TW { get; set; }
+
+
+
+        //RecommondOther-ComVideoKit
+        public string RecommondOther_ComVideoKitshow { get; set; }
+        public string RecommondOther_ComVideoKittype { get; set; }
+        public string RecommondOther_ComVideoKitsubscriptionType { get; set; }
+        public string RecommondOther_ComVideoKitversion { get; set; }
+        public long RecommondOther_ComVideoKitstartTime { get; set; }
+        public long RecommondOther_ComVideoKitendTime { get; set; }
+        public string RecommondOther_ComVideoKitnameen { get; set; }
+        public string RecommondOther_ComVideoKitnamezh_CN { get; set; }
+        public string RecommondOther_ComVideoKitnamezh_TW { get; set; }
+        public string RecommondOther_ComVideoKittooltipen { get; set; }
+        public string RecommondOther_ComVideoKittooltipzh_CN { get; set; }
+        public string RecommondOther_ComVideoKittooltipzh_TW { get; set; }
+        public string RecommondOther_ComVideoKitlinkURLen { get; set; }
+        public string RecommondOther_ComVideoKitlinkURLzh_CN { get; set; }
+        public string RecommondOther_ComVideoKitlinkURLzh_TW { get; set; }
+        public string RecommondOther_ComVideoKitimagenormal { get; set; }
+        public string RecommondOther_ComVideoKitimagehover { get; set; }
+        public string RecommondOther_ComVideoKitimageen { get; set; }
+        public string RecommondOther_ComVideoKitimagezh_CN { get; set; }
+        public string RecommondOther_ComVideoKitimagezh_TW { get; set; }
+
+
+
+
+
+        //RecommondOther-SignFlow
+        public string RecommondOther_SignFlowshow { get; set; }
+        public string RecommondOther_SignFlowtype { get; set; }
+        public string RecommondOther_SignFlowsubscriptionType { get; set; }
+        public string RecommondOther_SignFlowversion { get; set; }
+        public long RecommondOther_SignFlowstartTime { get; set; }
+        public long RecommondOther_SignFlowendTime { get; set; }
+        public string RecommondOther_SignFlownameen { get; set; }
+        public string RecommondOther_SignFlownamezh_CN { get; set; }
+        public string RecommondOther_SignFlownamezh_TW { get; set; }
+        public string RecommondOther_SignFlowtooltipen { get; set; }
+        public string RecommondOther_SignFlowtooltipzh_CN { get; set; }
+        public string RecommondOther_SignFlowtooltipzh_TW { get; set; }
+        public string RecommondOther_SignFlowlinkURLen { get; set; }
+        public string RecommondOther_SignFlowlinkURLzh_CN { get; set; }
+        public string RecommondOther_SignFlowlinkURLzh_TW { get; set; }
+        public string RecommondOther_SignFlowimagenormal { get; set; }
+        public string RecommondOther_SignFlowimagehover { get; set; }
+        public string RecommondOther_SignFlowimageen { get; set; }
+        public string RecommondOther_SignFlowimagezh_CN { get; set; }
+        public string RecommondOther_SignFlowimagezh_TW { get; set; }
+
+
+
+        //RecommondOther-FilmageEditor
+        public string RecommondOther_FilmageEditorshow { get; set; }
+        public string RecommondOther_FilmageEditortype { get; set; }
+        public string RecommondOther_FilmageEditorsubscriptionType { get; set; }
+        public string RecommondOther_FilmageEditorversion { get; set; }
+        public long RecommondOther_FilmageEditorstartTime { get; set; }
+        public long RecommondOther_FilmageEditorendTime { get; set; }
+        public string RecommondOther_FilmageEditornameen { get; set; }
+        public string RecommondOther_FilmageEditornamezh_CN { get; set; }
+        public string RecommondOther_FilmageEditornamezh_TW { get; set; }
+        public string RecommondOther_FilmageEditortooltipen { get; set; }
+        public string RecommondOther_FilmageEditortooltipzh_CN { get; set; }
+        public string RecommondOther_FilmageEditortooltipzh_TW { get; set; }
+        public string RecommondOther_FilmageEditorlinkURLen { get; set; }
+        public string RecommondOther_FilmageEditorlinkURLzh_CN { get; set; }
+        public string RecommondOther_FilmageEditorlinkURLzh_TW { get; set; }
+        public string RecommondOther_FilmageEditorimagenormal { get; set; }
+        public string RecommondOther_FilmageEditorimagehover { get; set; }
+        public string RecommondOther_FilmageEditorimageen { get; set; }
+        public string RecommondOther_FilmageEditorimagezh_CN { get; set; }
+        public string RecommondOther_FilmageEditorimagezh_TW { get; set; }
+
+
+        //RecommondOther-FilmageScreen
+        public string RecommondOther_FilmageScreenshow { get; set; }
+        public string RecommondOther_FilmageScreentype { get; set; }
+        public string RecommondOther_FilmageScreensubscriptionType { get; set; }
+        public string RecommondOther_FilmageScreenversion { get; set; }
+        public long RecommondOther_FilmageScreenstartTime { get; set; }
+        public long RecommondOther_FilmageScreenendTime { get; set; }
+        public string RecommondOther_FilmageScreennameen { get; set; }
+        public string RecommondOther_FilmageScreennamezh_CN { get; set; }
+        public string RecommondOther_FilmageScreennamezh_TW { get; set; }
+        public string RecommondOther_FilmageScreentooltipen { get; set; }
+        public string RecommondOther_FilmageScreentooltipzh_CN { get; set; }
+        public string RecommondOther_FilmageScreentooltipzh_TW { get; set; }
+        public string RecommondOther_FilmageScreenlinkURLen { get; set; }
+        public string RecommondOther_FilmageScreenlinkURLzh_CN { get; set; }
+        public string RecommondOther_FilmageScreenlinkURLzh_TW { get; set; }
+        public string RecommondOther_FilmageScreenimagenormal { get; set; }
+        public string RecommondOther_FilmageScreenimagehover { get; set; }
+        public string RecommondOther_FilmageScreenimageen { get; set; }
+        public string RecommondOther_FilmageScreenimagezh_CN { get; set; }
+        public string RecommondOther_FilmageScreenimagezh_TW { get; set; }
+
+
+        //RecommondOther-FreePDFTemplates
+        public string RecommondOther_FreePDFTemplatesshow { get; set; }
+        public string RecommondOther_FreePDFTemplatestype { get; set; }
+        public string RecommondOther_FreePDFTemplatessubscriptionType { get; set; }
+        public string RecommondOther_FreePDFTemplatesversion { get; set; }
+        public long RecommondOther_FreePDFTemplatesstartTime { get; set; }
+        public long RecommondOther_FreePDFTemplatesendTime { get; set; }
+        public string RecommondOther_FreePDFTemplatesnameen { get; set; }
+        public string RecommondOther_FreePDFTemplatesnamezh_CN { get; set; }
+        public string RecommondOther_FreePDFTemplatesnamezh_TW { get; set; }
+        public string RecommondOther_FreePDFTemplatestooltipen { get; set; }
+        public string RecommondOther_FreePDFTemplatestooltipzh_CN { get; set; }
+        public string RecommondOther_FreePDFTemplatestooltipzh_TW { get; set; }
+        public string RecommondOther_FreePDFTemplateslinkURLen { get; set; }
+        public string RecommondOther_FreePDFTemplateslinkURLzh_CN { get; set; }
+        public string RecommondOther_FreePDFTemplateslinkURLzh_TW { get; set; }
+        public string RecommondOther_FreePDFTemplatesimagenormal { get; set; }
+        public string RecommondOther_FreePDFTemplatesimagehover { get; set; }
+        public string RecommondOther_FreePDFTemplatesimageen { get; set; }
+        public string RecommondOther_FreePDFTemplatesimagezh_CN { get; set; }
+        public string RecommondOther_FreePDFTemplatesimagezh_TW { get; set; }
+        #endregion
+
+
+        #region advertisement
+        //advertisement-BlackFriday
+        public string advertisement_BlackFridayshow { get; set; }
+        public string advertisement_BlackFridaytype { get; set; }
+        public string advertisement_BlackFridaysubscriptionType { get; set; }
+        public string advertisement_BlackFridayversion { get; set; }
+        public long advertisement_BlackFridaystartTime { get; set; }
+        public long advertisement_BlackFridayendTime { get; set; }
+        public string advertisement_BlackFridayshowCloseBtn { get; set; }
+        public string advertisement_BlackFridaynameen { get; set; }
+        public string advertisement_BlackFridaynamezh_CN { get; set; }
+        public string advertisement_BlackFridaynamezh_TW { get; set; }
+        public string advertisement_BlackFridaytooltipen { get; set; }
+        public string advertisement_BlackFridaytooltipzh_CN { get; set; }
+        public string advertisement_BlackFridaytooltipzh_TW { get; set; }
+        public string advertisement_BlackFridaylinkURLen { get; set; }
+        public string advertisement_BlackFridaylinkURLzh_CN { get; set; }
+        public string advertisement_BlackFridaylinkURLzh_TW { get; set; }
+        public string advertisement_BlackFridayimagenormal { get; set; }
+        public string advertisement_BlackFridayimagehover { get; set; }
+        public string advertisement_BlackFridayimageen { get; set; }
+        public string advertisement_BlackFridayimagezh_CN { get; set; }
+        public string advertisement_BlackFridayimagezh_TW { get; set; } 
+        #endregion
 
-        public string ADSidebar { get; set; }
-        public string ADLinkSidebar { get; set; }
-        public string ADhiddenSidebar{ get; set; }
 
     }
 

+ 1 - 1
PDFSettings/UserDate.cs

@@ -14,7 +14,7 @@ using System.Threading.Tasks;
         public string id { get; set; }
         public string companyId { get; set; }
         public string appId { get; set; }
-        public string Email { get; set; }
+        public string Email { get; set; } = "";
         public string fullName { get; set; }
         public string subscriberType { get; set; }