/// <summary> /// /// </summary> private void _Initialize() { // ヘッダ情報・ヘッダ幅 var data = new Dictionary <string, int>() { { "タイトル", 300 }, { "話", 50 }, { "URL", 300 }, { "放映日", 150 }, { "ステータス", 110 } }; this.listView1.FullRowSelect = true; this.listView1.GridLines = true; this.listView1.Sorting = SortOrder.Ascending; this.listView1.View = View.Details; this.listView2.FullRowSelect = true; this.listView2.GridLines = true; this.listView2.Sorting = SortOrder.Ascending; this.listView2.View = View.Details; this.listView3.FullRowSelect = true; this.listView3.GridLines = true; this.listView3.Sorting = SortOrder.Ascending; this.listView3.View = View.Details; this.listView4.FullRowSelect = true; this.listView4.GridLines = true; this.listView4.Sorting = SortOrder.Ascending; this.listView4.View = View.Details; this.listView5.FullRowSelect = true; this.listView5.GridLines = true; this.listView5.Sorting = SortOrder.Ascending; this.listView5.View = View.Details; this.listView6.FullRowSelect = true; this.listView6.GridLines = true; this.listView6.Sorting = SortOrder.Ascending; this.listView6.View = View.Details; this.listView7.FullRowSelect = true; this.listView7.GridLines = true; this.listView7.Sorting = SortOrder.Ascending; this.listView7.View = View.Details; // ヘッダ追加 foreach (var kvp in data) { this.listView1.Columns.Add(ColumnHeaderEx.GetColumnHeader(kvp.Key, kvp.Value)); this.listView2.Columns.Add(ColumnHeaderEx.GetColumnHeader(kvp.Key, kvp.Value)); this.listView3.Columns.Add(ColumnHeaderEx.GetColumnHeader(kvp.Key, kvp.Value)); this.listView4.Columns.Add(ColumnHeaderEx.GetColumnHeader(kvp.Key, kvp.Value)); this.listView5.Columns.Add(ColumnHeaderEx.GetColumnHeader(kvp.Key, kvp.Value)); this.listView6.Columns.Add(ColumnHeaderEx.GetColumnHeader(kvp.Key, kvp.Value)); this.listView7.Columns.Add(ColumnHeaderEx.GetColumnHeader(kvp.Key, kvp.Value)); } }
/// <summary> /// 取得リストビューの初期設定を行います。 /// </summary> private void _InitializeResultView() { try { var data = new Dictionary <string, int>() { { "ID", 200 }, { "サービス名", 150 }, { "ファイル名", 300 }, { "進捗状況", 130 }, { "ステータス", 130 } }; this.ResultView.FullRowSelect = true; this.ResultView.GridLines = true; this.ResultView.Sorting = SortOrder.Ascending; this.ResultView.View = View.Details; // ヘッダ追加 foreach (var kvp in data) { this.ResultView.Columns.Add(ColumnHeaderEx.GetColumnHeader(kvp.Key, kvp.Value)); } foreach (var user in this._Twitter.User) { var parentItem = this.ResultView.Items.Add(user.Id); parentItem.SubItems.Add(user.ServiceName); foreach (var file in user.FileName) { parentItem.SubItems.Add(file); } parentItem.SubItems.Add(user.Progress); parentItem.SubItems.Add(user.Status); } } catch (Exception ex) { throw new AyaException(ex.Message); } finally { } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void PlayListsButton_Click(object sender, EventArgs e) { this.Playlist.Visible = true; if (!this.IsGetPlaylists) { this.IsGetPlaylists = true; var data = new Dictionary <string, int>() { { "TrackName", 600 }, { "Artist", 200 }, { "URL", 300 }, { "Genre", 70 }, { "Duration", 100 } }; this.IsGetPlaylists = true; await this.SoundCloud.GetPlayListAsync(); foreach (var i in Enumerable.Range(this.Playlist.TabCount + 1, this.SoundCloud.Playlists.Count - this.Playlist.TabCount)) { var tab = new TabPage { Name = $"tabPage{i}", Text = $"tabPage{i}" }; this.Playlist.TabPages.Add(tab); } foreach (var list in this.SoundCloud.Playlists.Select((value, idx) => new { value, idx })) { if (list.idx < this.SoundCloud.Playlists.Count) { var listView = new ListView { Size = new Size(1270, 550), FullRowSelect = true, GridLines = true, Sorting = SortOrder.None, View = View.Details }; // ヘッダ追加 foreach (var kvp in data) { listView.Columns.Add(ColumnHeaderEx.GetColumnHeader(kvp.Key, kvp.Value)); } var tab = (TabPage)this.Playlist.Controls[$"tabPage{list.idx + 1}"]; tab.Text = list.value.Title; foreach (var track in list.value.Tracks) { var mainItem = listView.Items.Add(track.Title); mainItem.SubItems.Add(track.User.UserName); mainItem.SubItems.Add($"{track.StreamUrl}?client_id={this.SoundCloud.ClientId}"); mainItem.SubItems.Add(track.Genre); mainItem.SubItems.Add(Common.GetCurrentTrackPositionToStr(track.Duration)); } listView.DoubleClick += (s, ev) => { if (listView.SelectedItems.Count > 0) { this.SoundCloud.TabIdx = Playlist.SelectedIndex; this.SoundCloud.ListTrackIdx = listView.SelectedItems[0].Index; this.SoundCloud.ArtworkUrl = list.value.Tracks[this.SoundCloud.ListTrackIdx].ArtworkUrl; var item = listView.SelectedItems[0]; this.SoundCloud.PostData = new Dictionary <string, string> { { item.Text, item.SubItems[1].Text } }; this._UpdateTrackInfoTest(this.SoundCloud.TabIdx, this.SoundCloud.ListTrackIdx); } }; tab.Controls.Add(listView); } } } //this.artPanel.Visible = false; }