banshee r3164 - in trunk/musicbrainz-sharp/src/MusicBrainz: . MusicBrainz



Author: scottp
Date: Thu Feb  7 17:54:27 2008
New Revision: 3164
URL: http://svn.gnome.org/viewvc/banshee?rev=3164&view=rev

Log:
* src/MusicBrainz/MusicBrainz/Release.cs,
  src/MusicBrainz/MusicBrainz/MusicBrainzEntity.cs,
  src/MusicBrainz/MusicBrainz/Track.cs,
  src/MusicBrainz/MusicBrainz/MusicBrainzItem.cs,
  src/MusicBrainz/MusicBrainz/Query.cs,
  src/MusicBrainz/MusicBrainz/Artist.cs: Refactored LINQ-related
  attributes.

Modified:
   trunk/musicbrainz-sharp/src/MusicBrainz/ChangeLog
   trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Artist.cs
   trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/MusicBrainzEntity.cs
   trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/MusicBrainzItem.cs
   trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Query.cs
   trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Release.cs
   trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Track.cs

Modified: trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Artist.cs
==============================================================================
--- trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Artist.cs	(original)
+++ trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Artist.cs	Thu Feb  7 17:54:27 2008
@@ -142,20 +142,20 @@
 
         #region Properties
 
-        [QueryName("arid")]
+        [Queryable("arid")]
         public override string MBID
         {
             get { return base.MBID; }
         }
 
-        [QueryName("artist")]
+        [Queryable("artist")]
         public override string Name
         {
             get { return base.Name; }
         }
 
         ArtistType? type;
-        [QueryName("artype")]
+        [Queryable("artype")]
         public ArtistType Type
         {
             get { return GetPropertyOrDefault<ArtistType>(ref type, ArtistType.Unknown); }

Modified: trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/MusicBrainzEntity.cs
==============================================================================
--- trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/MusicBrainzEntity.cs	(original)
+++ trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/MusicBrainzEntity.cs	Thu Feb  7 17:54:27 2008
@@ -94,35 +94,35 @@
         }
 
         string sort_name;
-        [QueryableProperty]
+        [Queryable]
         public virtual string SortName
         {
             get { return GetPropertyOrNull<string>(ref sort_name); }
         }
 
         string disambiguation;
-        [QueryName("comment")]
+        [Queryable("comment")]
         public virtual string Disambiguation
         {
             get { return GetPropertyOrNull<string>(ref disambiguation); }
         }
 
         string begin_date;
-        [QueryName("begin")]
+        [Queryable("begin")]
         public virtual string BeginDate
         {
             get { return GetPropertyOrNull<string>(ref begin_date); }
         }
 
         string end_date;
-        [QueryName("end")]
+        [Queryable("end")]
         public virtual string EndDate
         {
             get { return GetPropertyOrNull<string>(ref end_date); }
         }
 
         List<string> aliases;
-        [QueryMember("Contains", "alias")]
+        [QueryableMember("Contains", "alias")]
         public virtual List<string> Aliases
         {
             get { return GetPropertyOrNew<List<string>>(ref aliases); }

Modified: trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/MusicBrainzItem.cs
==============================================================================
--- trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/MusicBrainzItem.cs	(original)
+++ trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/MusicBrainzItem.cs	Thu Feb  7 17:54:27 2008
@@ -140,7 +140,7 @@
         }
 
         Artist artist;
-        [QueryName("artist")]
+        [Queryable("artist")]
         public virtual Artist Artist
         {
             get { return GetPropertyOrNull<Artist>(ref artist); }

Modified: trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Query.cs
==============================================================================
--- trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Query.cs	(original)
+++ trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Query.cs	Thu Feb  7 17:54:27 2008
@@ -106,25 +106,28 @@
             return GetEnumerator();
         }
     }
-    
-    internal class QueryablePropertyAttribute : Attribute
-    {
-    }
 
-    internal sealed class QueryNameAttribute : QueryablePropertyAttribute
+    [AttributeUsage(AttributeTargets.Property)]
+    internal sealed class QueryableAttribute : Attribute
     {
         public readonly string Name;
-        public QueryNameAttribute(string name)
+        
+        public QueryableAttribute()
+        {
+        }
+        
+        public QueryableAttribute(string name)
         {
             Name = name;
         }
     }
 
-    internal sealed class QueryMemberAttribute : QueryablePropertyAttribute
+    [AttributeUsage(AttributeTargets.Property)]
+    internal sealed class QueryableMemberAttribute : Attribute
     {
         public readonly string Name;
         public readonly string Member;
-        public QueryMemberAttribute(string member, string name)
+        public QueryableMemberAttribute(string member, string name)
         {
             Member = member;
             Name = name;

Modified: trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Release.cs
==============================================================================
--- trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Release.cs	(original)
+++ trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Release.cs	Thu Feb  7 17:54:27 2008
@@ -261,27 +261,27 @@
 
         #region Properties
 
-        [QueryName("reid")]
+        [Queryable("reid")]
         public override string MBID
         {
             get { return base.MBID; }
         }
 
-        [QueryName("release")]
+        [Queryable("release")]
         public override string Title
         {
             get { return base.Title; }
         }
 
         ReleaseType? type;
-        [QueryableProperty]
+        [Queryable]
         public ReleaseType Type
         {
             get { return GetPropertyOrDefault<ReleaseType>(ref type, ReleaseType.None); }
         }
 
         ReleaseStatus? status;
-        [QueryableProperty]
+        [Queryable]
         public ReleaseStatus Status
         {
             get { return GetPropertyOrDefault<ReleaseStatus>(ref status, ReleaseStatus.None); }
@@ -295,21 +295,21 @@
         }
 
         string script;
-        [QueryableProperty]
+        [Queryable]
         public string Script
         {
             get { return GetPropertyOrNull<string>(ref script); }
         }
 
         string asin;
-        [QueryableProperty]
+        [Queryable]
         public string Asin
         {
             get { return GetPropertyOrNull<string>(ref asin); }
         }
 
         List<Disc> discs;
-        [QueryMember("Count", "discids")]
+        [QueryableMember("Count", "discids")]
         public List<Disc> Discs
         {
             get { return GetPropertyOrNew<List<Disc>>(ref discs); }
@@ -322,7 +322,7 @@
         }
 
         List<Track> tracks;
-        [QueryMember("Count", "tracks")]
+        [QueryableMember("Count", "tracks")]
         public List<Track> Tracks
         {
             get { return GetPropertyOrNew<List<Track>>(ref tracks); }

Modified: trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Track.cs
==============================================================================
--- trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Track.cs	(original)
+++ trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Track.cs	Thu Feb  7 17:54:27 2008
@@ -169,27 +169,27 @@
 
         #region Properties
 
-        [QueryName("trid")]
+        [Queryable("trid")]
         public override string MBID
         {
             get { return base.MBID; }
         }
 
-        [QueryName("track")]
+        [Queryable("track")]
         public override string Title
         {
             get { return base.Title; }
         }
 
         uint duration;
-        [QueryName("dur")]
+        [Queryable("dur")]
         public uint Duration
         {
             get { return duration; }
         }
 
         List<Release> releases;
-        [QueryMember("Contains", "release")]
+        [QueryableMember("Contains", "release")]
         public List<Release> Releases
         {
             get { return GetPropertyOrNew<List<Release>>(ref releases); }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]