コード例 #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var tag = (sender as Button).Tag.ToString();

            HitomiArticle ha = Article as HitomiArticle;

            if (tag == "FindArtist")
            {
                if (ha.Artists != null)
                {
                    ArtistViewerWindow avw = new ArtistViewerWindow(ha.Artists[0]);
                    avw.Show();
                }
            }
            else if (tag == "FindGroup")
            {
                if (ha.Groups != null)
                {
                    GroupViewerWindow avw = new GroupViewerWindow(ha.Groups[0]);
                    avw.Show();
                }
            }
            else if (tag == "Preview")
            {
                PreviewWindow pw = new PreviewWindow(Article);
                pw.Show();
            }
            else if (tag == "ShowOnEX")
            {
                string result = ExHentaiTool.GetAddressFromMagicTitle(ha.Magic, ha.Title);
                if (result != "")
                {
                    System.Diagnostics.Process.Start(result);
                }
                else
                {
                    MainWindow.Instance.FadeOut_MiddlePopup("익헨 주소를 찾지 못했습니다 ㅠㅠ", false);
                }
            }
            else if (tag == "Comment")
            {
                string result = ExHentaiTool.GetAddressFromMagicTitle(ha.Magic, ha.Title);
                if (result != "")
                {
                    (new CommentWindow(result)).Show();
                }
                else
                {
                    MainWindow.Instance.FadeOut_MiddlePopup("익헨 주소를 찾지 못했습니다 ㅠㅠ", false);
                }
            }
        }
コード例 #2
0
        private void metroButton5_Click(object sender, EventArgs e)
        {
            string result = ExHentaiTool.GetAddressFromMagicTitle(ha.Magic, ha.OriginalTitle);

            if (result != "")
            {
                (new frmComment(parent, result)).Show();
            }
            else
            {
                MessageBox.Show("익헨 주소를 찾지 못했습니다.", "Hitomi Copy", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #3
0
 private void metroButton4_Click(object sender, EventArgs e)
 {
     if (!HitomiSetting.Instance.GetModel().UsingExHentaiBaseOpener)
     {
         System.Diagnostics.Process.Start($"https://hitomi.la/galleries/{ha.Magic}.html");
     }
     else
     {
         string result = ExHentaiTool.GetAddressFromMagicTitle(ha.Magic, ha.OriginalTitle);
         if (result != "")
         {
             System.Diagnostics.Process.Start(result);
         }
         else
         {
             MessageBox.Show("익헨 주소를 찾지 못했습니다.", "Hitomi Copy", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
コード例 #4
0
        private void button8_Click(object sender, EventArgs e)
        {
            string result = "";

            if (pic != null)
            {
                result = ExHentaiTool.GetAddressFromMagicTitle(pic.Article.Magic, pic.Article.OriginalTitle);
            }
            else
            {
                result = ExHentaiTool.GetAddressFromMagicTitle(metadata.ID.ToString(), metadata.Name);
            }
            if (result != "")
            {
                (new frmComment(this, result)).Show();
            }
            else
            {
                MessageBox.Show("익헨 주소를 찾지 못했습니다.", "Hitomi Copy", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #5
0
        private void button7_Click(object sender, EventArgs e)
        {
            string result = "";

            if (pic != null)
            {
                result = ExHentaiTool.GetAddressFromMagicTitle(pic.Article.Magic, pic.Article.OriginalTitle);
            }
            else
            {
                result = ExHentaiTool.GetAddressFromMagicTitle(metadata.ID.ToString(), metadata.Name);
            }
            if (result != "")
            {
                System.Diagnostics.Process.Start(result);
            }
            else
            {
                MessageBox.Show("익헨 주소를 찾지 못했습니다.", "Hitomi Copy", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #6
0
        /// <summary>
        /// 히토미아티클을 이용해 익헨 주소를 가져옵니다.
        /// </summary>
        /// <param name="args"></param>
        static void ProcessAddress(string[] args)
        {
            HitomiArticle article = null;

            try { article = JsonConvert.DeserializeObject <HitomiArticle>(args[0]); } catch { }
            if (article == null)
            {
                Console.Instance.WriteErrorLine("Not valid 'HitomiArticle' objects. Check your pipe or arguments.");
                return;
            }

            string result = ExHentaiTool.GetAddressFromMagicTitle(article.Magic, article.Title);

            if (result != "")
            {
                Console.Instance.WriteLine(result);
            }
            else
            {
                Console.Instance.WriteLine("Not found.");
            }
        }
コード例 #7
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            switch ((sender as Button).Tag.ToString())
            {
            case "Preview":
                (new PreviewWindow(Article)).Show();
                break;

            case "Artist":
            {
                if (Article is HitomiArticle ha)
                {
                    if (ha.Artists != null)
                    {
                        (new ArtistViewerWindow(ha.Artists[0])).Show();
                    }
                }
            }
            break;

            case "Group":
            {
                if (Article is HitomiArticle ha)
                {
                    if (ha.Groups != null)
                    {
                        (new GroupViewerWindow(ha.Groups[0])).Show();
                    }
                }
            }
            break;

            case "":
            case "Hitomi":
            {
                if (Article is HitomiArticle ha)
                {
                    System.Diagnostics.Process.Start($"{HitomiCommon.HitomiAddress}galleries/{ha.Magic}.html");
                }
            }
            break;

            case "Exhentai":
            {
                if (Article is HitomiArticle ha)
                {
                    string result = ExHentaiTool.GetAddressFromMagicTitle(ha.Magic, ha.Title);
                    if (result != "")
                    {
                        System.Diagnostics.Process.Start(result);
                    }
                    else
                    {
                        MainWindow.Instance.FadeOut_MiddlePopup("익헨 주소를 찾지 못했습니다 ㅠㅠ", false);
                    }
                }
            }
            break;

            case "Series":
            {
                if (Article is HitomiArticle ha)
                {
                    if (ha.Series != null)
                    {
                        (new FinderWindow($"series:{ha.Series[0].Replace(' ', '_')}")).Show();
                    }
                }
            }
            break;

            case "Character":
            {
                if (Article is HitomiArticle ha)
                {
                    if (ha.Characters != null)
                    {
                        (new FinderWindow($"character:{ha.Characters[0].Replace(' ', '_')}")).Show();
                    }
                }
            }
            break;

            case "Comment":
            {
                if (Article is HitomiArticle ha)
                {
                    string result = ExHentaiTool.GetAddressFromMagicTitle(ha.Magic, ha.Title);
                    if (result != "")
                    {
                        (new CommentWindow(result)).Show();
                    }
                    else
                    {
                        MainWindow.Instance.FadeOut_MiddlePopup("익헨 주소를 찾지 못했습니다 ㅠㅠ", false);
                    }
                }
            }
            break;

            case "Download":
            {
                if (Article is HitomiArticle ha)
                {
                    var prefix = HitomiCommon.MakeDownloadDirectory(ha);
                    Directory.CreateDirectory(prefix);

                    if (!ha.IsUnstable)
                    {
                        DownloadSpace.Instance.RequestDownload(ha.Title,
                                                               ha.ImagesLink.Select(y => HitomiCommon.GetDownloadImageAddress(ha.Magic, y)).ToArray(),
                                                               ha.ImagesLink.Select(y => Path.Combine(prefix, y)).ToArray(),
                                                               Koromo_Copy.Interface.SemaphoreExtends.Default, prefix, ha);
                    }
                    else
                    {
                        DownloaderHelper.ProcessUnstable(ha.UnstableModel);
                    }
                    MainWindow.Instance.FadeOut_MiddlePopup($"1개 항목 다운로드 시작...");
                    MainWindow.Instance.Activate();
                    MainWindow.Instance.FocusDownload();
                    Close();
                }
            }
            break;
            }
        }