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



Author: scottp
Date: Tue Mar 25 20:36:37 2008
New Revision: 3537
URL: http://svn.gnome.org/viewvc/banshee?rev=3537&view=rev

Log:
* src/MusicBrainz/MusicBrainz/MusicBrainzObject.cs,
  src/MusicBrainz/MusicBrainz/Release.cs,
  src/MusicBrainz/MusicBrainz/MusicBrainzEntity.cs,
  src/MusicBrainz/MusicBrainz/Track.cs,
  src/MusicBrainz/MusicBrainz/Artist.cs: Whitespace fixes which have
  somehow managed to escape my attention, and used the AsReadOnly
  convenience method.

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/MusicBrainzObject.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	Tue Mar 25 20:36:37 2008
@@ -126,7 +126,7 @@
                         List<Release> releases = new List<Release> ();
                         do releases.Add (new Release (reader.ReadSubtree ()));
                         while (reader.ReadToNextSibling ("release"));
-                        this.releases = new ReadOnlyCollection<Release> (releases);
+                        this.releases = releases.AsReadOnly ();
                     }
                     break;
                 default:

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	Tue Mar 25 20:36:37 2008
@@ -73,7 +73,7 @@
                         if (reader.NodeType == XmlNodeType.Text)
                             aliases.Add (reader.ReadContentAsString ());
                     } while (reader.ReadToNextSibling ("alias"));
-                    this.aliases = new ReadOnlyCollection<string> (aliases);
+                    this.aliases = aliases.AsReadOnly ();
                 }
                 break;
             default:

Modified: trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/MusicBrainzObject.cs
==============================================================================
--- trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/MusicBrainzObject.cs	(original)
+++ trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/MusicBrainzObject.cs	Tue Mar 25 20:36:37 2008
@@ -32,7 +32,7 @@
         }
 
         bool all_rels_loaded;
-		protected bool AllRelsLoaded {
+        protected bool AllRelsLoaded {
             get { return all_rels_loaded; }
             set { all_rels_loaded = value; }
         }
@@ -120,22 +120,22 @@
                     case "Artist":
                         List<Relation<Artist>> artist_rels = new List<Relation<Artist>> ();
                         CreateRelation (reader.ReadSubtree (), artist_rels);
-                        this.artist_rels = new ReadOnlyCollection<Relation<Artist>> (artist_rels);
+                        this.artist_rels = artist_rels.AsReadOnly ();
                         break;
                     case "Release":
                         List<Relation<Release>> release_rels = new List<Relation<Release>> ();
                         CreateRelation (reader.ReadSubtree (), release_rels);
-                        this.release_rels = new ReadOnlyCollection<Relation<Release>> (release_rels);
+                        this.release_rels = release_rels.AsReadOnly ();
                         break;
                     case "Track":
                         List<Relation<Track>> track_rels = new List<Relation<Track>> ();
                         CreateRelation (reader.ReadSubtree (), track_rels);
-                        this.track_rels = new ReadOnlyCollection<Relation<Track>> (track_rels);
+                        this.track_rels = track_rels.AsReadOnly ();
                         break;
                     case "Label":
                         List<Relation<Label>> label_rels = new List<Relation<Label>> ();
                         CreateRelation (reader.ReadSubtree (), label_rels);
-                        this.label_rels = new ReadOnlyCollection<Relation<Label>> (label_rels);
+                        this.label_rels = label_rels.AsReadOnly ();
                         break;
                     case "Url":
                         if (!reader.ReadToDescendant ("relation")) break;
@@ -156,7 +156,7 @@
                                 reader ["end"],
                                 attributes));
                         } while (reader.ReadToNextSibling ("relation"));
-                        this.url_rels = new ReadOnlyCollection<UrlRelation> (url_rels);
+                        this.url_rels = url_rels.AsReadOnly ();
                         break;
                     }
                 } else

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	Tue Mar 25 20:36:37 2008
@@ -194,8 +194,8 @@
                     script = reader ["script"];
                     break;
                 case "asin":
-					reader.Read ();
-					if (reader.NodeType == XmlNodeType.Text)
+                    reader.Read ();
+                    if (reader.NodeType == XmlNodeType.Text)
                         asin = reader.ReadContentAsString ();
                     break;
                 case "disc-list": {
@@ -203,7 +203,7 @@
                         List<Disc> discs = new List<Disc> ();
                         do discs.Add (new Disc (reader.ReadSubtree ()));
                         while (reader.ReadToNextSibling ("disc"));
-                        this.discs = new ReadOnlyCollection<Disc> (discs);
+                        this.discs = discs.AsReadOnly ();
                     }
                     break;
                 }
@@ -212,8 +212,8 @@
                     if (reader.ReadToDescendant ("event")) {
                         List<Event> events = new List<Event> ();
                         do events.Add (new Event (reader.ReadSubtree ()));
-						while (reader.ReadToNextSibling ("event"));
-                        this.events = new ReadOnlyCollection<Event> (events);
+                        while (reader.ReadToNextSibling ("event"));
+                        this.events = events.AsReadOnly ();
                     }
                     break;
                 case "track-list": {
@@ -224,17 +224,17 @@
                         List<Track> tracks = new List<Track> ();
                         do tracks.Add (new Track (reader.ReadSubtree (), AllDataLoaded));
                         while (reader.ReadToNextSibling ("track"));
-                        this.tracks = new ReadOnlyCollection<Track> (tracks);
+                        this.tracks = tracks.AsReadOnly ();
                     }
                     break;
                 }
                 default:
                     reader.Skip (); // FIXME this is a workaround for Mono bug 334752
-					result = false;
+                    result = false;
                     break;
                 }
             }
-			reader.Close ();
+            reader.Close ();
             return result;
         }
 

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	Tue Mar 25 20:36:37 2008
@@ -127,8 +127,8 @@
                 result = true;
                 switch (reader.Name) {
                 case "duration":
-					reader.Read ();
-					if (reader.NodeType == XmlNodeType.Text)
+                    reader.Read ();
+                    if (reader.NodeType == XmlNodeType.Text)
                         duration = uint.Parse (reader.ReadContentAsString ());
                     break;
                 case "release-list":
@@ -136,7 +136,7 @@
                         List<Release> releases = new List<Release> ();
                         do releases.Add (new Release (reader.ReadSubtree ()));
                         while (reader.ReadToNextSibling ("release"));
-                        this.releases = new ReadOnlyCollection<Release> (releases);
+                        this.releases = releases.AsReadOnly ();
                     }
                     break;
                 case "puid-list":
@@ -144,7 +144,7 @@
                         List<string> puids = new List<string> ();
                         do puids.Add (reader ["id"]);
                         while (reader.ReadToNextSibling ("puid"));
-                        this.puids = new ReadOnlyCollection<string> (puids);
+                        this.puids = puids.AsReadOnly ();
                     }
                     break;
                 default:



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