16
MusicBee API / Re: MusicBee API
« on: July 04, 2011, 11:17:39 AM »
By the way... in my eternal quest for elegant code (it's a curse, really), I've encapsulated the raw MusicBee API in a nicer, more .NET'ish set of classes with Properties and Events -- fancy stuff. Basically, the idea is that I hate (with a vengeance) longwinded switch-case constructs and rather wanted something like...
then...
Would something like this make life easier for you, R U Bn?
Code
api.TrackChanged += (MusicBeeEventArgs args) => { Console.WriteLine(args.RelatedFile.AlbumArtist); };
Code
public void ReceiveNotification(string sourceFileUrl, NotificationType type) {
switch(type) {
case NotificationType.TrackChanged:
Console.WriteLine(mbApiInterface.Library_GetFileTag(relatedFile, MetaDataType.AlbumArtist);
break;
}
}
Would something like this make life easier for you, R U Bn?