public static MusicDatabase Load(string fileName) { MusicDatabase dataBase = null; try { var xs = new XmlSerializer(typeof(MusicDatabase), new Type[] { typeof(Music), typeof(Album) }); var stream = new FileStream(fileName, FileMode.Open); dataBase = (MusicDatabase)xs.Deserialize(stream); stream.Close(); } catch (Exception) { return(new MusicDatabase()); } return(dataBase); }
public SearchEngine(MusicDatabase database, ReceiveResponse callback) { _localIndexer = new LocalIndexer(database); Callback = callback; Database = database; }
public Peer(string name, MusicDatabase database, ReceiveResponse responseCallback) { Name = name; PeerContainer = new PeerContainer(); SearchEngine = new SearchEngine(database, responseCallback); }