示例#1
0
        public virtual void UpdateGoogleProductRecord(FormDownload FormDownload)
        {
            if (FormDownload == null)
            {
                throw new ArgumentNullException("FormDownload");
            }

            repository.Update(FormDownload);
        }
示例#2
0
 public FormDownload FormData(FormDownload info)
 {
     info.Id       = this.Id;
     info.Title    = this.Title;
     info.WorkType = this.WorkType;
     info.Imgurl   = this.Imgurl;
     info.ImgName  = this.ImgName;
     info.ImgSLT   = this.ImgSLT;
     return(info);
 }
示例#3
0
 public FormDownloadModel ToModel(FormDownload info)
 {
     this.Id       = info.Id;
     this.Title    = info.Title;
     this.WorkType = info.WorkType;
     this.Imgurl   = info.Imgurl;
     this.ImgName  = info.ImgName;
     this.ImgSLT   = info.ImgSLT;
     return(this);
 }
示例#4
0
        public FormDownload ToInfo()
        {
            FormDownload info = new FormDownload();

            info.Id       = this.Id;
            info.Title    = this.Title;
            info.WorkType = this.WorkType;
            info.Imgurl   = this.Imgurl;
            info.ImgName  = this.ImgName;
            info.ImgSLT   = this.ImgSLT;
            return(info);
        }
示例#5
0
 public void OnShowDownloadPage(object sender, EventArgs e)
 {
     try
     {
         if (!IsWebSiteReachable)
         {
             return;
         }
         FormDownload.Show(dockPanel, DockState.Document);
     }
     catch (Exception ex)
     {
         _log.Error(ex.Message);
     }
 }
示例#6
0
        /// <summary>
        /// Download the Skitter data.
        /// </summary>
        /// <param name="sender">The sender object.</param>
        /// <param name="e">The sender arguments.</param>
        private void OnDownloadSkitter(object sender, EventArgs e)
        {
            this.buttonSkitter.Enabled = false;

            FormDownload formDownload = new FormDownload();

            formDownload.FormClosed += OnFormClosed;
            formDownload.Text = "Download Skitter Data";
            formDownload.DownloadCompleted += this.OnSkitterDownloadCompleted;

            formDownload.Download(
                this,
                "Download Skitter Data",
                this.config.SkitterFolder,
                this.config.FileFormat,
                this.config.SkitterUrl,
                this.config.SkitterDateFrom,
                this.config.SkitterDateTo,
                Resources.DownloadTermsSkitter);
        }
示例#7
0
        static void Main()
        {
            // Enable TLS 1.0, 1.1, 1.2, by default .NET 4.0 will enable TLS 1.0 only
            // https://stackoverflow.com/questions/47269609/
            ServicePointManager.SecurityProtocol = (SecurityProtocolType)(0xc0 | 0x300 | 0xc00);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Retrieve HTML listing
            FormDownload formDownload = new FormDownload(RepoUrl, TempListFile);

            Application.Run(formDownload);

            if (!formDownload.Success)
            {
                return;
            }

            // Create destination Folder
            if (!Directory.Exists(SchemesFolder))
            {
                Directory.CreateDirectory(SchemesFolder);

                // Set custom folder icon
                if (File.Exists(SoundSchemeIcon))
                {
                    string desktopIniFile = Path.Combine(SchemesFolder, "desktop.ini");
                    File.WriteAllLines(desktopIniFile, new[] {
                        "[.ShellClassInfo]",
                        "IconFile=" + Path.GetFullPath(SoundSchemeIcon),
                        "IconIndex=0"
                    });
                    DirectoryInfo dirInfo = new DirectoryInfo(SchemesFolder);
                    dirInfo.Attributes |= FileAttributes.System;
                    FileInfo fileInfo = new FileInfo(desktopIniFile);
                    fileInfo.Attributes |= FileAttributes.Hidden;
                }
            }

            // Find THS file names in HTML listing and build URL => LocalPath pairs
            IEnumerable <KeyValuePair <string, string> > schemes
                = File.ReadAllText(TempListFile)
                  .Split(new[] { '>', '<' })
                  .Where(item => item.EndsWith(".ths"))
                  .Select(filename => new KeyValuePair <string, string>(
                              String.Format(FileUrlFormat, RepoUrl, filename),
                              Path.Combine(SchemesFolder, filename)));

            File.Delete(TempListFile);

            // Download all sound schemes
            formDownload = new FormDownload(schemes);
            Application.Run(formDownload);

            if (!formDownload.Success)
            {
                return;
            }

            // Offer to apply the default sound scheme for the current OS
            if (SchemesPerNtVersion.ContainsKey(WindowsNtVersion))
            {
                string schemeFile = Path.Combine(SchemesFolder, SchemesPerNtVersion[WindowsNtVersion]);
                if (File.Exists(SoundManagerExe) && File.Exists(schemeFile))
                {
                    Process.Start(SoundManagerExe, String.Format("\"{0}\"", schemeFile));
                }
            }
        }