public DiscogsSelectReleaseWindow(string initialData = null) { this.discogs = new Discogs3(); InitializeComponent(); int releaseId = 0; if (releaseId == 0 && initialData != null) { releaseId = DiscogsUtility.GetReleaseId(initialData); } if (releaseId == 0 && Clipboard.ContainsText()) { releaseId = DiscogsUtility.GetReleaseId(Clipboard.GetText()); } if (releaseId != 0) { textReleaseId.Text = Clipboard.GetText(); DownloadRelease(releaseId); } else { HideRelease(StatusNoRelease); } }
private void textBox_TextChanged(object sender, RoutedEventArgs e) { int releaseId = DiscogsUtility.GetReleaseId(this.textBox.Text); if (releaseId != 0) { this.textBox.SetCurrentValue(TextBox.TextProperty, releaseId.ToString()); } }
private void btnGo_Click(object sender, RoutedEventArgs e) { int releaseId = DiscogsUtility.GetReleaseId(textReleaseId.Text); if (releaseId == 0) { HideRelease(StatusInvalidId); return; } DownloadRelease(releaseId); }