示例#1
0
        private void Webtoon_DownloadTargetChanged(WebtoonPageInformation info)
        {
            CheckForIllegalCrossThreadCalls = false;

            starImage.Visible            = true;
            webtoonStarRateLabel.Visible = true;

            uploadDateImage.Visible        = true;
            webtoonUploadDateLabel.Visible = true;

            webtoonTitleLabel.Text      = info.title;
            webtoonStarRateLabel.Text   = info.starRate;
            webtoonUploadDateLabel.Text = info.uploadDate;

            webtoonTitleLabel.Location = new Point(9, 180);
            webtoonTitleLabel.Size     = new Size(583, 25);

            webtoonDescriptionLabel.Location = new Point(9, 210);
            webtoonDescriptionLabel.Size     = new Size(583, 60);

            thumbnailImage.Location = new Point(199, 50);
            thumbnailImage.Size     = new Size(202, 120);

            try
            {
                thumbnailImage.Visible = true;
                thumbnailImage.Load(info.thumbnailURL);
            }
            catch (Exception)
            {
                thumbnailImage.Image = null;
            }
        }
示例#2
0
        public static ViewerCreateResult Create(string directory, WebtoonPageInformation info)
        {
            try
            {
                System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US");

                string[]      files  = Directory.GetFiles(directory + @"\이미지", "image_*.jpg", SearchOption.TopDirectoryOnly);
                StringBuilder htmlSB = new StringBuilder(GlobalVar.viewerBaseHTMLString);

                htmlSB.Replace("#title", info.title);

                // 이미지들 이름에 따라 정렬 (Natural Sort)
                Array.Sort(files, new Sort.NaturalStringComparer( ));

                StringBuilder imageSB = new StringBuilder( );

                foreach (string i in files)
                {
                    if (File.Exists(i))
                    {
                        imageSB.AppendLine("<img src = '이미지/" + Path.GetFileName(i) + "' />");
                    }
                }

                htmlSB.Replace("#images", imageSB.ToString( ));

                File.WriteAllText(directory + "\\웹툰 뷰어.html", htmlSB.ToString( ), Encoding.UTF8);

                return(ViewerCreateResult.Success);
            }
            catch (DirectoryNotFoundException ex)
            {
                Utility.WriteErrorLog(ex.Message, "DirectoryNotFoundException");
                return(ViewerCreateResult.DirectoryNotFoundException);
            }
            catch (IOException ex)
            {
                Utility.WriteErrorLog(ex.Message, "IOException");
                return(ViewerCreateResult.IOException);
            }
            catch (UnauthorizedAccessException ex)
            {
                Utility.WriteErrorLog(ex.Message, "UnauthorizedAccessException");
                return(ViewerCreateResult.UnauthorizedAccessException);
            }
            catch (Exception ex)
            {
                Utility.WriteErrorLog(ex.Message, "Exception");
                return(ViewerCreateResult.Unknown);
            }
        }
        public WebtoonListChild(WebtoonPageInformation info)
        {
            InitializeComponent( );

            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);

            this.info = info;

            webtoonTitleLabel.Text      = info.title;
            webtoonStarRateLabel.Text   = info.starRate;
            webtoonUploadDateLabel.Text = info.uploadDate;

            try
            {
                thumbnailImage.Load(info.thumbnailURL);
            }
            catch (Exception)
            {
                thumbnailImage.Image = null;
            }
        }