private void button_EnterLeave(object sender, CustomButtonEventArgs e) { switch (e.Main) { case "disable": if (buttonDisable.Source == "Resources/enable.png") { textAddScript.Text = "활성화"; } else { textAddScript.Text = "비활성화"; } break; case "delete": textAddScript.Text = "삭제"; break; case "save": textAddScript.Text = "저장"; break; default: textAddScript.Text = ""; return; } }
private void item_Response(object sender, CustomButtonEventArgs e) { if (Response != null) { Response(this, e); } }
private void BackButton_Response(object sender, CustomButtonEventArgs e) { if (e.ActionType != "Click") { return; } if (NowContainer == null) { return; } Pair pair = StackHistory.Pop(); ChangeCaption(pair.First, -1); AniScrollViewer scroll = pair.Second as AniScrollViewer; AnimateContainer(NowContainer, 0, 150); AnimateContainer(scroll, 1, 0); NowCaption = pair.First; NowContainer = scroll; if (StackHistory.Count > 0) { buttonBack.ViewMode = ImageButton.Mode.Visible; } else { buttonBack.ViewMode = ImageButton.Mode.Hidden; } }
private void TabButton_Response(object sender, CustomButtonEventArgs e) { SetProperty(Tab, TabButton.Mode.Clickable); SetTabMode(e.Main); SetProperty(Tab, TabButton.Mode.Focused); SetTitlebar(Tab); }
private void EpisodeButton_Response(object sender, CustomButtonEventArgs e) { try { int delta = Convert.ToInt32(e.Main); if (Response != null) { Response(this, new CustomButtonEventArgs("Episode", this.Reference, delta.ToString())); } } catch { return; } }
private void Weekday_Click(object sender, CustomButtonEventArgs e) { int day = -1; try { day = Convert.ToInt32(e.Main); } catch { return; } RefreshAnitable(day); }
private void AnitableItem_Response(object sender, CustomButtonEventArgs e) { if (e.ActionType == "Anitable") { this.textboxTitle.Text = e.Main; this.comboboxWeekday.SelectedIndex = AnitableWeekday; this.textboxHour.Text = e.Detail.Substring(0, 2); this.textboxMinute.Text = e.Detail.Substring(2, 2); textboxKeyword.Focus(); } }
private void SubtitleItem_Response(object sender, CustomButtonEventArgs e) { switch (e.ActionType) { case "Maker": if (Status.Lite) { Function.ExecuteFile(new UriBuilder(e.Detail).Uri.ToString()); } else { RefreshSubtitle(e.ActionType, new Pair(e.Main, e.Detail)); } break; case "Maker2": RefreshSubtitle(e.ActionType, new Pair(e.Main, e.Detail)); break; case "Blog": if (e.Detail == "") { Notice("URL 분석 실패"); } else { Function.ExecuteFile(new UriBuilder(e.Detail).Uri.ToString()); } break; case "Expand": //Parser.ExpandNaverBlod(e.Detail); RefreshSubtitle(e.ActionType, new Pair(e.Main, e.Detail)); break; case "File": RefreshSubtitle(e.ActionType, new Pair(e.Main, e.Detail)); break; case "OpenZip": Function.ExecuteFile(e.Detail); break; case "InnerZip": if (Function.Unzip(e.Detail, e.Main, NowSubtitle) != "") { Notice("저장되었습니다."); } break; } }
private void TorrentItem_Response(object sender, CustomButtonEventArgs e) { if (e.ActionType == "Torrent" || e.ActionType == "TorrentRight") { BackgroundWorker bwDownload = new BackgroundWorker(); bwDownload.DoWork += bwDownload_DoWork; bwDownload.RunWorkerAsync(new Pair(e.Detail, e.Main)); if (e.ActionType == "TorrentRight") { RefreshDownloadControl("Subtitle"); } return; } }
private void TorrentEpisode_Response(object sender, CustomButtonEventArgs e) { int type = 0; try { type = Convert.ToInt32(e.Main); } catch { return; } if (!Data.DictSeason.ContainsKey(TorrentCaption)) { return; } string source = Data.DictSeason[TorrentCaption].ArchiveTitle; int episode = Math.Max(0, Data.DictArchive[source].Episode + type); textEpisode.Text = episode.ToString(); RefreshArchiveEpisode(source, episode); }
private void ImageButton_Response(object sender, CustomButtonEventArgs e) { switch (e.Main) { case "add": switch (Mode) { case ShowMode.None: ShowAddWindow(); break; case ShowMode.Add: case ShowMode.Modify: HideAddModifyWindow(); break; case ShowMode.Download: StopBackgroundWorker(BwTorrent); StopBackgroundWorker(BwSubtitle); AnimateDownloadWindow(0, -40); SetTitlebar(Tab); Mode = ShowMode.None; break; } break; case "close": if (Setting.Tray) { this.Opacity = 0; Notice("", false, 0); new AltTab().HideAltTab(this); } else { this.Close(); } break; case "disable": ToggleAvailable(ModifyTag); containArchive.RefreshContainer(); break; case "delete": DeleteItem(); break; case "save": AddOrModifyItem(); break; case "sort": ToggleSelectMode(); break; case "refresh": UpdateNotification(); break; case "shot": Notice("캡쳐를 저장했습니다"); string path = Function.SaveScreenShot(stackSeason, 0); if (File.Exists(path)) { string argument = string.Format("/select, \"{0}\"", path); Task.Factory.StartNew(() => Process.Start("explorer.exe", argument)); } break; case "arrange": ArrangeEpisode(); break; case "update": UpdateDownload(); break; case "vercheck": //MessageBox.Show(System.Reflection.Assembly.GetExecutingAssembly().Location); UpdateCheck(); break; case "openfolder": if (Status.Root) { Function.ExecuteFile(string.Format(@"X:Anime\{0}", getSafeFileName(ModifyTag))); } break; case "changelog": gridChangelog.Visibility = Visibility.Collapsed; break; default: Notice(e.Main); break; } }
private void Container_Response(object sender, CustomButtonEventArgs e) { switch (e.ActionType) { case "Click": if (e.Detail == "Season") { string arcTitle = Data.DictSeason[e.Main].ArchiveTitle; if (Data.DictArchive[arcTitle].Episode < 0) { RefreshArchiveEpisode(arcTitle, 0); containArchive.RefreshContainer(); } else { if (Status.Lite) { ShowNotificationDownloadWindow(); InitSubtitle(e.Main); } else { ShowDownloadWindow( e.Main, Data.DictArchive[arcTitle].Episode, Data.DictSeason[e.Main].Keyword); } } } else { if (Data.DictArchive[e.Main].Episode < 0) { RefreshArchiveEpisode(e.Main, 0); containArchive.RefreshContainer(); } else { if (!Status.Root) { return; } try { string d = string.Format(@"X:Anime\{0}", e.Main); if (Directory.Exists(d)) { Function.ExecuteFile(d); } } catch { } } } break; case "Modify": ModifyTag = e.Main; if (e.Detail == "Season") { AddOpenMode = OpenMode.SeasonModify; } else { AddOpenMode = OpenMode.ArchiveModify; } ShowModifyWindow(); break; case "OpenFolder": string dir = string.Format(@"X:Anime\{0}", getSafeFileName(e.Detail)); try { if (!Directory.Exists(dir)) { Notice("폴더가 생성되었습니다"); Directory.CreateDirectory(dir); } Function.ExecuteFile(dir); } catch { } break; case "CopyClipboard": string title = Function.CleanFileName(e.Main); string arctitle = e.Main; if (e.Detail == "Season") { arctitle = Data.DictSeason[e.Main].ArchiveTitle; } if (Data.DictArchive[arctitle].Episode < 0) { Clipboard.SetText(title); } else { try { Clipboard.SetText(string.Format("{0} - {1:D2}", title, Data.DictArchive[arctitle].Episode)); } catch { Notice("클립보드 복사 실패"); return; } } Notice("클립보드에 복사되었습니다"); break; case "Episode": int delta = 0; try { delta = Convert.ToInt32(e.Detail); } catch { return; } RefreshArchiveEpisode(e.Main, Data.DictArchive[e.Main].Episode + delta); break; } }
private void DownloadTab_Response(object sender, CustomButtonEventArgs e) { RefreshDownloadControl(e.Main); }
private void NotifyItem_Response(object sender, CustomButtonEventArgs e) { ShowNotificationDownloadWindow(); InitNotify(e.Main, e.Detail); }