/// <summary> /// Function: Create form elements /// Author : Jerry Xu /// Date : 2008-11-17 /// </summary> private void CreateFormElements() { ImportFileItemControl fileItem; if (_files != null && _files.Count > 0) { foreach (MessageFileItem item in _files) { fileItem = new ImportFileItemControl(item); fileItem.Dock = DockStyle.Top; fileItem.FileCheck += new EventHandler <ImportCheckEventArgs>(fileItem_FileCheck); fileItem.ImportRename += new EventHandler <ImportRenameEventArgs>(fileItem_LibraryImportRename); //Config container height containerFiles.Height = containerFiles.Height + fileItem.Height; containerFiles.Controls.Add(fileItem); } } ImportMessageItemControl messageItem; if (!_message.IsValid) { messageItem = new ImportMessageItemControl(_message); messageItem.Dock = DockStyle.Top; messageItem.MessageCheck += new EventHandler <ImportCheckEventArgs>(messageItem_MessageCheck); messageItem.ImportRename += new EventHandler <ImportRenameEventArgs>(fileItem_LibraryImportRename); //Config container height containerMessage.Height = containerMessage.Height + messageItem.Height; containerMessage.Controls.Add(messageItem); } //Expand group files and message groupFiles.Expanded = true; groupMessage.Expanded = true; }
private void CreateFormElements() { ImportFileItemControl fileItem; if (_files != null && _files.Count > 0) { foreach (MessageFileItem item in _files) { fileItem = new ImportFileItemControl(item); fileItem.Dock = DockStyle.Top; fileItem.FileCheck += new EventHandler <ImportCheckEventArgs>(fileItem_FileCheck); fileItem.ImportRename += new EventHandler <ImportRenameEventArgs>(ImportRename); containerFiles.Height = containerFiles.Height + fileItem.Height; containerFiles.Controls.Add(fileItem); } } ImportMessageItemControl messageItem; if (_messages != null && _messages.Count > 0) { foreach (MessageItem item in _messages) { messageItem = new ImportMessageItemControl(item); messageItem.Dock = DockStyle.Top; messageItem.MessageCheck += new EventHandler <ImportCheckEventArgs>(messageItem_MessageCheck); messageItem.ImportRename += new EventHandler <ImportRenameEventArgs>(ImportRename); containerMessage.Height = containerMessage.Height + messageItem.Height; containerMessage.Controls.Add(messageItem); } } ImportTimeSliceGroupItemControl timeSliceGroupItem; if (_timeSliceGroups != null && _timeSliceGroups.Count > 0) { foreach (TimeSliceGroupItem item in _timeSliceGroups) { timeSliceGroupItem = new ImportTimeSliceGroupItemControl(item); timeSliceGroupItem.Dock = DockStyle.Top; timeSliceGroupItem.TimeSliceGroupCheck += new EventHandler <ImportCheckEventArgs>(groupItem_TimeSliceGroupCheck); timeSliceGroupItem.ImportRename += new EventHandler <ImportRenameEventArgs>(ImportRename); containerTimeSliceGroup.Height = containerTimeSliceGroup.Height + timeSliceGroupItem.Height; containerTimeSliceGroup.Controls.Add(timeSliceGroupItem); } } ImportPlaylistItemControl playlistItem; if (_playlists != null && _playlists.Count > 0) { foreach (PlaylistItem item in _playlists) { playlistItem = new ImportPlaylistItemControl(item); playlistItem.Dock = DockStyle.Top; playlistItem.PlaylistCheck += new EventHandler <ImportCheckEventArgs>(playlistItem_PlaylistCheck); playlistItem.ImportRename += new EventHandler <ImportRenameEventArgs>(ImportRename); containerPlaylist.Height = containerPlaylist.Height + playlistItem.Height; containerPlaylist.Controls.Add(playlistItem); } } if (!_playlistItem.IsValid) { playlistItem = new ImportPlaylistItemControl(_playlistItem); playlistItem.Dock = DockStyle.Top; playlistItem.PlaylistCheck += new EventHandler <ImportCheckEventArgs>(playlistItem_PlaylistCheck); playlistItem.ImportRename += new EventHandler <ImportRenameEventArgs>(ImportRename); containerPlaylist.Height = containerPlaylist.Height + playlistItem.Height; containerPlaylist.Controls.Add(playlistItem); } //Expand group files and messages and timeSliceGroup and playlist groupFiles.Expanded = true; groupMessage.Expanded = true; groupTimeSliceGroup.Expanded = true; groupPlaylist.Expanded = true; }