private void MainForm_Load(object sender, EventArgs e) { try { _artistList = ArtistList.RetrieveArtistList(); } catch (Exception ex) { MessageBox.Show(ex.Message, "File retrieve error"); } UpdateDisplay(); GalleryNameChanged += UpdateTitle; GalleryNameChanged(_artistList.GalleryName); }
public static ArtistList RetrieveArtistList() { ArtistList artistList; try { System.IO.FileStream fileStream = new System.IO.FileStream(_fileName, System.IO.FileMode.Open); BinaryFormatter formatter = new BinaryFormatter(); artistList = (ArtistList)formatter.Deserialize(fileStream); fileStream.Close(); } catch (Exception ex) { artistList = new ArtistList(); throw new Exception("File Retrieve Error: " + ex.Message); } finally { } return(artistList); }
public Artist(ArtistList artistList) { _workList = new WorkList(); _artistList = artistList; }