banshee r3234 - in trunk/musicbrainz-sharp: . docs/en/MusicBrainz src/MusicBrainz src/MusicBrainz/MusicBrainz



Author: scottp
Date: Wed Feb 13 19:22:11 2008
New Revision: 3234
URL: http://svn.gnome.org/viewvc/banshee?rev=3234&view=rev

Log:
* src/MusicBrainz/MusicBrainz/Release.cs: Changed return type of
  QueryFromDevice from Release to Query<Release> (since Query<T> can
  now be implicitly converted to T).
* src/MusicBrainz/MusicBrainz/Query.cs: Improvement to implicit
  conversion to prevent bad performance after the conversion has been
  made when attempting to enumerate.
* docs/en/MusicBrainz/Release.xml, docs/en/MusicBrainz/Query`1.xml,
  docs/en/MusicBrainz/Artist.xml: Updated docs.

Modified:
   trunk/musicbrainz-sharp/ChangeLog
   trunk/musicbrainz-sharp/docs/en/MusicBrainz/Artist.xml
   trunk/musicbrainz-sharp/docs/en/MusicBrainz/Query`1.xml
   trunk/musicbrainz-sharp/docs/en/MusicBrainz/Release.xml
   trunk/musicbrainz-sharp/src/MusicBrainz/ChangeLog
   trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Query.cs
   trunk/musicbrainz-sharp/src/MusicBrainz/MusicBrainz/Release.cs

Modified: trunk/musicbrainz-sharp/docs/en/MusicBrainz/Artist.xml
==============================================================================
--- trunk/musicbrainz-sharp/docs/en/MusicBrainz/Artist.xml	(original)
+++ trunk/musicbrainz-sharp/docs/en/MusicBrainz/Artist.xml	Wed Feb 13 19:22:11 2008
@@ -20,8 +20,13 @@
     <Member MemberName="ArtistReleaseType">
       <MemberSignature Language="C#" Value="public MusicBrainz.ArtistReleaseType ArtistReleaseType { set; get; };" />
       <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>MusicBrainz.ArtistReleaseType</ReturnType></ReturnValue>
-      <Docs><summary>The ArtistReleaseType will determin the Releases that are in <see cref="M:MusicBrainz.Artist.Releases" />.</summary><value>To be added.</value><remarks>
+      <ReturnValue>
+        <ReturnType>MusicBrainz.ArtistReleaseType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>The ArtistReleaseType will determin the Releases that are in <see cref="M:MusicBrainz.Artist.Releases" />.</summary>
+        <value>To be added.</value>
+        <remarks>
           <para>
             <see cref="M:MusicBrainz.Artist.DefaultArtistReleaseType" /> will be used if no ArtistReleaseType is specified.</para>
           <para>
@@ -41,34 +46,57 @@
 foreach(Release r in a.Releases)
     {...}
   </code></example></para>
-        </remarks></Docs>
+        </remarks>
+      </Docs>
     </Member>
     <Member MemberName="DefaultArtistReleaseType">
       <MemberSignature Language="C#" Value="public static MusicBrainz.ArtistReleaseType DefaultArtistReleaseType;" />
       <MemberType>Field</MemberType>
-      <ReturnValue><ReturnType>MusicBrainz.ArtistReleaseType</ReturnType></ReturnValue>
-      <Docs><summary>The default <see cref="M:MusicBrainz.Artist.ArtistReleaseType" /> that will be adopted by all newly instantiated Artists.</summary><remarks>The default value of DefaultArtistReleaseType is:
+      <ReturnValue>
+        <ReturnType>MusicBrainz.ArtistReleaseType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>The default <see cref="M:MusicBrainz.Artist.ArtistReleaseType" /> that will be adopted by all newly instantiated Artists.</summary>
+        <remarks>The default value of DefaultArtistReleaseType is:
 <example><code lang="C#">new ArtistReleaseType(ReleaseStatus.Official, false)
   </code></example>
-This means Official Releases which are authored by the Artist alone.</remarks></Docs>
+This means Official Releases which are authored by the Artist alone.</remarks>
+      </Docs>
     </Member>
     <Member MemberName="Get">
       <MemberSignature Language="C#" Value="public static MusicBrainz.Artist Get (string mbid);" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>MusicBrainz.Artist</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="mbid" Type="System.String" /></Parameters>
-      <Docs><param name="mbid">The MusicBrainz ID; a universal identifier.</param><summary>Retrieve an Artist by universal identifier.</summary><returns>The Artist with the specified MBID.</returns><remarks>
+      <ReturnValue>
+        <ReturnType>MusicBrainz.Artist</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="mbid" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="mbid">The MusicBrainz ID; a universal identifier.</param>
+        <summary>Retrieve an Artist by universal identifier.</summary>
+        <returns>The Artist with the specified MBID.</returns>
+        <remarks>
           <block subset="none" type="note">
 See http://wiki.musicbrainz.org/ArtistID
 </block>
-        </remarks></Docs>
+        </remarks>
+      </Docs>
     </Member>
     <Member MemberName="op_Implicit">
       <MemberSignature Language="C#" Value="public static string op_Implicit (MusicBrainz.Artist a);" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>System.String</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="a" Type="MusicBrainz.Artist" /></Parameters>
-      <Docs><param name="a">To be added.</param><summary>This operator is provided for the benefit of LINQ syntax. See remarks for details.</summary><returns>a.ToString()</returns><remarks>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="a" Type="MusicBrainz.Artist" />
+      </Parameters>
+      <Docs>
+        <param name="a">To be added.</param>
+        <summary>This operator is provided for the benefit of LINQ syntax. See remarks for details.</summary>
+        <returns>a.ToString()</returns>
+        <remarks>
           <para>The purpose of providing this operator is to allow for the following LINQ syntax:
 <example><code lang="C#">
 var q = from a in MB.Artists
@@ -95,47 +123,84 @@
           <para>
 These two queries are substantively different. See http://wiki.musicbrainz.org/TextSearchSyntax for more information.
 </para>
-        </remarks></Docs>
+        </remarks>
+      </Docs>
     </Member>
     <Member MemberName="Query">
       <MemberSignature Language="C#" Value="public static MusicBrainz.Query&lt;MusicBrainz.Artist&gt; Query (string name);" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>MusicBrainz.Query&lt;MusicBrainz.Artist&gt;</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="name" Type="System.String" /></Parameters>
-      <Docs><param name="name">The name of an artist.</param><summary>Query for Artists by name.</summary><returns>An enumerable Query of results.</returns><remarks>To be added.</remarks></Docs>
+      <ReturnValue>
+        <ReturnType>MusicBrainz.Query&lt;MusicBrainz.Artist&gt;</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="name" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="name">The name of an artist.</param>
+        <summary>Query for Artists by name.</summary>
+        <returns>An enumerable Query of results.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
     </Member>
     <Member MemberName="QueryLucene">
       <MemberSignature Language="C#" Value="public static MusicBrainz.Query&lt;MusicBrainz.Artist&gt; QueryLucene (string lucene_query);" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>MusicBrainz.Query&lt;MusicBrainz.Artist&gt;</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="lucene_query" Type="System.String" /></Parameters>
-      <Docs><param name="lucene_query">A lucene text query.</param><summary>Query for Artists by lucene text query.</summary><returns>An enumerable Query of results.</returns><remarks>
+      <ReturnValue>
+        <ReturnType>MusicBrainz.Query&lt;MusicBrainz.Artist&gt;</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="lucene_query" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="lucene_query">A lucene text query.</param>
+        <summary>Query for Artists by lucene text query.</summary>
+        <returns>An enumerable Query of results.</returns>
+        <remarks>
           <block subset="none" type="note">
 See http://wiki.musicbrainz.org/TextSearchSyntax
 </block>
-        </remarks></Docs>
+        </remarks>
+      </Docs>
     </Member>
     <Member MemberName="Releases">
       <MemberSignature Language="C#" Value="public System.Collections.Generic.List&lt;MusicBrainz.Release&gt; Releases { get; };" />
       <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>System.Collections.Generic.List&lt;MusicBrainz.Release&gt;</ReturnType></ReturnValue>
-      <Docs><summary>A list of the Artist's Releases. The Releases in the list will be determined by the Artist's <see cref="M:MusicBrainz.Artist.ArtistReleaseType" />.</summary><value>A List of <see cref="T:MusicBrainz.Release" />s. If there are no releases, an empty List.</value><remarks>This property will never be null.</remarks></Docs>
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.List&lt;MusicBrainz.Release&gt;</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>A list of the Artist's Releases. The Releases in the list will be determined by the Artist's <see cref="M:MusicBrainz.Artist.ArtistReleaseType" />.</summary>
+        <value>A List of <see cref="T:MusicBrainz.Release" />s. If there are no releases, an empty List.</value>
+        <remarks>This property will never be null.</remarks>
+      </Docs>
     </Member>
     <Member MemberName="Type">
       <MemberSignature Language="C#" Value="public MusicBrainz.ArtistType Type { get; };" />
       <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>MusicBrainz.ArtistType</ReturnType></ReturnValue>
-      <Docs><summary>The Type of the Artist.</summary><value>To be added.</value><remarks>
+      <ReturnValue>
+        <ReturnType>MusicBrainz.ArtistType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>The Type of the Artist.</summary>
+        <value>To be added.</value>
+        <remarks>
           <block subset="none" type="note">
 See http://wiki.musicbrainz.org/ArtistType
 </block>
-        </remarks></Docs>
+        </remarks>
+      </Docs>
     </Member>
     <Member MemberName="UrlExtension">
       <MemberSignature Language="C#" Value="protected override string UrlExtension { get; };" />
       <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>System.String</ReturnType></ReturnValue>
-      <Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
     </Member>
   </Members>
-</Type>
+</Type>
\ No newline at end of file

Modified: trunk/musicbrainz-sharp/docs/en/MusicBrainz/Query`1.xml
==============================================================================
--- trunk/musicbrainz-sharp/docs/en/MusicBrainz/Query`1.xml	(original)
+++ trunk/musicbrainz-sharp/docs/en/MusicBrainz/Query`1.xml	Wed Feb 13 19:22:11 2008
@@ -75,22 +75,42 @@
     <Member MemberName="Count">
       <MemberSignature Language="C#" Value="public int Count { get; };" />
       <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>System.Int32</ReturnType></ReturnValue>
-      <Docs><summary>The number of results.</summary><value>The total number of results to the query.</value><remarks>To be added.</remarks></Docs>
+      <ReturnValue>
+        <ReturnType>System.Int32</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>The number of results.</summary>
+        <value>The total number of results to the query.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
     </Member>
     <Member MemberName="GetEnumerator">
       <MemberSignature Language="C#" Value="public System.Collections.Generic.IEnumerator&lt;T&gt; GetEnumerator ();" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>System.Collections.Generic.IEnumerator&lt;T&gt;</ReturnType></ReturnValue>
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.IEnumerator&lt;T&gt;</ReturnType>
+      </ReturnValue>
       <Parameters />
-      <Docs><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs>
+      <Docs>
+        <summary>To be added.</summary>
+        <returns>To be added.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
     </Member>
     <Member MemberName="Item">
       <MemberSignature Language="C#" Value="public T this[int i] { get; };" />
       <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>T</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="i" Type="System.Int32" /></Parameters>
-      <Docs><param name="i">A value less than Count and greater than or equal to 0.</param><summary>Access a given result from the query with a zero-based indexer.</summary><value>The result from the query which corrisponds to the zero-based index.</value><remarks>
+      <ReturnValue>
+        <ReturnType>T</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="i" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <param name="i">A value less than Count and greater than or equal to 0.</param>
+        <summary>Access a given result from the query with a zero-based indexer.</summary>
+        <value>The result from the query which corrisponds to the zero-based index.</value>
+        <remarks>
           <para>Throws a <see cref="T:System.IndexOutOfRangeException" /> if i is equal to or greater than Count, or less than zero.</para>
           <para>
 In this example, we retrieve the first result of a Query using the indexer:
@@ -108,71 +128,117 @@
     Console.WriteLine("{0} by {1}", q[i].Title, q[i].Artist.Name); 
 }
   </code></example></para>
-        </remarks></Docs>
+        </remarks>
+      </Docs>
     </Member>
     <Member MemberName="ToArray">
       <MemberSignature Language="C#" Value="public T[] ToArray ();" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>T[]</ReturnType></ReturnValue>
+      <ReturnValue>
+        <ReturnType>T[]</ReturnType>
+      </ReturnValue>
       <Parameters />
-      <Docs><summary>Convert a Query to an array of results.</summary><returns>An array of all the results.</returns><remarks>
+      <Docs>
+        <summary>Convert a Query to an array of results.</summary>
+        <returns>An array of all the results.</returns>
+        <remarks>
           <para>
 The MusicBrainz XMLWebService only returns results 100 at a time, so iterating over each 100 results incures another XML transaction, i.e. a significant delay in execution. Since the ToArray() method must iterate over all results, it is highly advisible to use another method whenever possible (such as the foreach statement, or a for loop and the indexer).
 </para>
-        </remarks></Docs>
+        </remarks>
+      </Docs>
     </Member>
     <Member MemberName="ToList">
       <MemberSignature Language="C#" Value="public System.Collections.Generic.List&lt;T&gt; ToList ();" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>System.Collections.Generic.List&lt;T&gt;</ReturnType></ReturnValue>
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.List&lt;T&gt;</ReturnType>
+      </ReturnValue>
       <Parameters />
-      <Docs><summary>Returns a List of all results.</summary><returns>A List of all the Query results.</returns><remarks>
+      <Docs>
+        <summary>Returns a List of all results.</summary>
+        <returns>A List of all the Query results.</returns>
+        <remarks>
           <para>
 The MusicBrainz XMLWebService only returns results 100 at a time, so iterating over each 100 results incures another XML transaction, i.e. a significant delay in execution. Since the ToList() method must iterate over all results, it is advisible to use another method whenever possible (such as the foreach statement, or a for loop and the indexer). If you are only interested in results with a relavance score higher than, say, 50, you should use the overload ToList(int) which takes a score threshold.
 </para>
-        </remarks></Docs>
+        </remarks>
+      </Docs>
     </Member>
     <Member MemberName="Best">
       <MemberSignature Language="C#" Value="public System.Collections.Generic.IEnumerable&lt;T&gt; Best ();" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>System.Collections.Generic.IEnumerable&lt;T&gt;</ReturnType></ReturnValue>
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.IEnumerable&lt;T&gt;</ReturnType>
+      </ReturnValue>
       <Parameters />
-      <Docs><summary>Returns only results with a <see cref="M:MusicBrainz.MusicBrainzObject.Score" /> of 100 (the highest).</summary><returns>Results with a 100 relevancy score.</returns><remarks>This method is logically identical to calling Query.Best(100);</remarks></Docs>
+      <Docs>
+        <summary>Returns only results with a <see cref="M:MusicBrainz.MusicBrainzObject.Score" /> of 100 (the highest).</summary>
+        <returns>Results with a 100 relevancy score.</returns>
+        <remarks>This method is logically identical to calling Query.Best(100);</remarks>
+      </Docs>
     </Member>
     <Member MemberName="Best">
       <MemberSignature Language="C#" Value="public System.Collections.Generic.IEnumerable&lt;T&gt; Best (int score_threshold);" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>System.Collections.Generic.IEnumerable&lt;T&gt;</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="score_threshold" Type="System.Int32" /></Parameters>
-      <Docs><param name="score_threshold">The relevancy threshold. Any result with a <see cref="M:MusicBrainz.MusicBrainzObject.Score" /> lower than this number will not be returned.</param><summary>Returns only results with a <see cref="M:MusicBrainz.MusicBrainzObject.Score" /> at or above the specified relevancy threshold.</summary><returns>Results at or above the specified relevancy.</returns><remarks>If you only want results of a given quality, this is the perfered method for retrieving them. This example iterates over all artists with a score of 50 or better when querying for "Dylan":
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.IEnumerable&lt;T&gt;</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="score_threshold" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <param name="score_threshold">The relevancy threshold. Any result with a <see cref="M:MusicBrainz.MusicBrainzObject.Score" /> lower than this number will not be returned.</param>
+        <summary>Returns only results with a <see cref="M:MusicBrainz.MusicBrainzObject.Score" /> at or above the specified relevancy threshold.</summary>
+        <returns>Results at or above the specified relevancy.</returns>
+        <remarks>If you only want results of a given quality, this is the perfered method for retrieving them. This example iterates over all artists with a score of 50 or better when querying for "Dylan":
 <example><code lang="C#">
 foreach(Artist a in Artist.Query("Dylan").Best(50))
     Console.WriteLine(a.Name);
-  </code></example></remarks></Docs>
+  </code></example></remarks>
+      </Docs>
     </Member>
     <Member MemberName="op_Implicit">
       <MemberSignature Language="C#" Value="public static T op_Implicit (MusicBrainz.Query&lt;T&gt; query);" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>T</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="query" Type="MusicBrainz.Query&lt;T&gt;" /></Parameters>
-      <Docs><param name="query">To be added.</param><summary>The first result.</summary><returns>The first result of the Query or null if there are no results.
+      <ReturnValue>
+        <ReturnType>T</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="query" Type="MusicBrainz.Query&lt;T&gt;" />
+      </Parameters>
+      <Docs>
+        <param name="query">To be added.</param>
+        <summary>The first result.</summary>
+        <returns>The first result of the Query or null if there are no results.
 <block subset="none" type="note"><para>
 This result may not nessisarily have a <see cref="M:MusicBrainz.MusicBrainzObject.Score" /> of 100. While this will be the most relevant result, it's relevancy to the query may still be weak.
-  </para></block></returns><remarks>This operator makes it easy to get the first result form a query:
+  </para></block></returns>
+        <remarks>This operator makes it easy to get the first result form a query:
 <example><code lang="C#">
 Artist a = Artist.Query("The Scissor Sisters");
-  </code></example></remarks></Docs>
+  </code></example></remarks>
+      </Docs>
     </Member>
     <Member MemberName="ToList">
       <MemberSignature Language="C#" Value="public System.Collections.Generic.List&lt;T&gt; ToList (int score_threshold);" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>System.Collections.Generic.List&lt;T&gt;</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="score_threshold" Type="System.Int32" /></Parameters>
-      <Docs><param name="score_threshold">The relevancy threshold. Any result with a <see cref="M:MusicBrainz.MusicBrainzObject.Score" /> below this number will not be included in the List.</param><summary>Returns a List of results above the specified relevance threshold.</summary><returns>A List of results at or above the specified relevancy threshold.</returns><remarks>
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.List&lt;T&gt;</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="score_threshold" Type="System.Int32" />
+      </Parameters>
+      <Docs>
+        <param name="score_threshold">The relevancy threshold. Any result with a <see cref="M:MusicBrainz.MusicBrainzObject.Score" /> below this number will not be included in the List.</param>
+        <summary>Returns a List of results above the specified relevance threshold.</summary>
+        <returns>A List of results at or above the specified relevancy threshold.</returns>
+        <remarks>
           <para>
 The MusicBrainz XMLWebService only returns results 100 at a time, so iterating over each 100 results incures another XML transaction, i.e. a significant delay in execution. The lower the threshold you specify, the more results will be included. Be aware that too low a threshold can cause multiple XML transaction (one transaction per 100 results) and can slow down your program.
 </para>
-        </remarks></Docs>
+        </remarks>
+      </Docs>
     </Member>
   </Members>
-</Type>
+</Type>
\ No newline at end of file

Modified: trunk/musicbrainz-sharp/docs/en/MusicBrainz/Release.xml
==============================================================================
--- trunk/musicbrainz-sharp/docs/en/MusicBrainz/Release.xml	(original)
+++ trunk/musicbrainz-sharp/docs/en/MusicBrainz/Release.xml	Wed Feb 13 19:22:11 2008
@@ -17,70 +17,96 @@
     </remarks>
   </Docs>
   <Members>
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-    
-  <Member MemberName="Asin">
+    <Member MemberName="Asin">
       <MemberSignature Language="C#" Value="public string Asin { get; };" />
       <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>System.String</ReturnType></ReturnValue>
-      <Docs><summary>The Amazon Standard Identification Number for the Release.</summary><value>A string of the ASIN.</value><remarks>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>The Amazon Standard Identification Number for the Release.</summary>
+        <value>A string of the ASIN.</value>
+        <remarks>
           <block subset="none" type="note">
 See http://wiki.musicbrainz.org/ASIN
 </block>
-        </remarks></Docs>
-    </Member><Member MemberName="Discs">
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Discs">
       <MemberSignature Language="C#" Value="public System.Collections.Generic.List&lt;MusicBrainz.Disc&gt; Discs { get; };" />
       <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>System.Collections.Generic.List&lt;MusicBrainz.Disc&gt;</ReturnType></ReturnValue>
-      <Docs><summary>A list of Discs on which the Release appears.</summary><value>A list of <see cref="T:MusicBrainz.Disc" />s. If there are no Discs, an empy list.</value><remarks>This property will never be null.</remarks></Docs>
-    </Member><Member MemberName="Events">
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.List&lt;MusicBrainz.Disc&gt;</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>A list of Discs on which the Release appears.</summary>
+        <value>A list of <see cref="T:MusicBrainz.Disc" />s. If there are no Discs, an empy list.</value>
+        <remarks>This property will never be null.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Events">
       <MemberSignature Language="C#" Value="public System.Collections.Generic.List&lt;MusicBrainz.Event&gt; Events { get; };" />
       <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>System.Collections.Generic.List&lt;MusicBrainz.Event&gt;</ReturnType></ReturnValue>
-      <Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs>
-    </Member><Member MemberName="Get">
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.List&lt;MusicBrainz.Event&gt;</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Get">
       <MemberSignature Language="C#" Value="public static MusicBrainz.Release Get (string mbid);" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>MusicBrainz.Release</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="mbid" Type="System.String" /></Parameters>
-      <Docs><param name="mbid">To be added.</param><summary>Retrieve a Release by universal identifier.</summary><returns>The Release with the specified MBID.</returns><remarks>
+      <ReturnValue>
+        <ReturnType>MusicBrainz.Release</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="mbid" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="mbid">To be added.</param>
+        <summary>Retrieve a Release by universal identifier.</summary>
+        <returns>The Release with the specified MBID.</returns>
+        <remarks>
           <block subset="none" type="note">
 See http://wiki.musicbrainz.org/ReleaseID
 </block>
-        </remarks></Docs>
-    </Member><Member MemberName="Language">
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Language">
       <MemberSignature Language="C#" Value="public string Language { get; };" />
       <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>System.String</ReturnType></ReturnValue>
-      <Docs><summary>The language of the Release title and track titles.</summary><value>An ISO 639 language code. null if MusicBrainz does not have language data for a given Release.</value><remarks>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>The language of the Release title and track titles.</summary>
+        <value>An ISO 639 language code. null if MusicBrainz does not have language data for a given Release.</value>
+        <remarks>
           <block subset="none" type="note">
 See http://wiki.musicbrainz.org/ReleaseLanguage and http://en.wikipedia.org/wiki/ISO_639
 </block>
-        </remarks></Docs>
-    </Member><Member MemberName="op_Implicit">
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="op_Implicit">
       <MemberSignature Language="C#" Value="public static string op_Implicit (MusicBrainz.Release r);" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>System.String</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="r" Type="MusicBrainz.Release" /></Parameters>
-      <Docs><param name="r">To be added.</param><summary>This operator is provided for the benefit of LINQ syntax. See remarks for details.</summary><returns>r.ToString()</returns><remarks>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="r" Type="MusicBrainz.Release" />
+      </Parameters>
+      <Docs>
+        <param name="r">To be added.</param>
+        <summary>This operator is provided for the benefit of LINQ syntax. See remarks for details.</summary>
+        <returns>r.ToString()</returns>
+        <remarks>
           <para>The purpose of providing this operator is to allow for the following LINQ syntax:
 <example><code lang="C#">
 var q = from r in MB.Releases
@@ -107,77 +133,180 @@
           <para>
 These two queries ARE NOT substantively different, but the syntax is provided to remain consistant with <see cref="M:MusicBrainz.Artist.Conversion" />. See http://wiki.musicbrainz.org/TextSearchSyntax for more information.
 </para>
-        </remarks></Docs>
-    </Member><Member MemberName="Query">
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Query">
       <MemberSignature Language="C#" Value="public static MusicBrainz.Query&lt;MusicBrainz.Release&gt; Query (MusicBrainz.ReleaseQueryParameters parameters);" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>MusicBrainz.Query&lt;MusicBrainz.Release&gt;</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="parameters" Type="MusicBrainz.ReleaseQueryParameters" /></Parameters>
-      <Docs><param name="parameters">The parameters of the query.</param><summary>Query for Releases parametrically.</summary><returns>An enumerable Query of results.</returns><remarks>To be added.</remarks></Docs>
-    </Member><Member MemberName="Query">
+      <ReturnValue>
+        <ReturnType>MusicBrainz.Query&lt;MusicBrainz.Release&gt;</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="parameters" Type="MusicBrainz.ReleaseQueryParameters" />
+      </Parameters>
+      <Docs>
+        <param name="parameters">The parameters of the query.</param>
+        <summary>Query for Releases parametrically.</summary>
+        <returns>An enumerable Query of results.</returns>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Query">
       <MemberSignature Language="C#" Value="public static MusicBrainz.Query&lt;MusicBrainz.Release&gt; Query (string title);" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>MusicBrainz.Query&lt;MusicBrainz.Release&gt;</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="title" Type="System.String" /></Parameters>
-      <Docs><param name="title">The title of a release.</param><summary>Query for Releases by title.</summary><returns>An enumerable Query of results.</returns><remarks>This overload is shorthand for:
+      <ReturnValue>
+        <ReturnType>MusicBrainz.Query&lt;MusicBrainz.Release&gt;</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="title" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="title">The title of a release.</param>
+        <summary>Query for Releases by title.</summary>
+        <returns>An enumerable Query of results.</returns>
+        <remarks>This overload is shorthand for:
 <example><code lang="C#">
 ReleaseQueryParameters p = new ReleaseQueryParameters();
 p.Title = "some title";
 Release.Query(p);
-  </code></example></remarks></Docs>
-    </Member><Member MemberName="Query">
+  </code></example></remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Query">
       <MemberSignature Language="C#" Value="public static MusicBrainz.Query&lt;MusicBrainz.Release&gt; Query (string title, string artist);" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>MusicBrainz.Query&lt;MusicBrainz.Release&gt;</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="title" Type="System.String" /><Parameter Name="artist" Type="System.String" /></Parameters>
-      <Docs><param name="title">The title of a release.</param><param name="artist">The name of a release's artist.</param><summary>Query for Releases by their title and artist.</summary><returns>An enumerable Query of results.</returns><remarks>This overload is shorthand for:
+      <ReturnValue>
+        <ReturnType>MusicBrainz.Query&lt;MusicBrainz.Release&gt;</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="title" Type="System.String" />
+        <Parameter Name="artist" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="title">The title of a release.</param>
+        <param name="artist">The name of a release's artist.</param>
+        <summary>Query for Releases by their title and artist.</summary>
+        <returns>An enumerable Query of results.</returns>
+        <remarks>This overload is shorthand for:
 <example><code lang="C#">
 ReleaseQueryParameters p = new ReleaseQueryParameters();
 p.Title = "some title";
 p.Artist = "some artist";
 Release.Query(p);
-  </code></example></remarks></Docs>
-    </Member><Member MemberName="QueryLucene">
+  </code></example></remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="QueryLucene">
       <MemberSignature Language="C#" Value="public static MusicBrainz.Query&lt;MusicBrainz.Release&gt; QueryLucene (string lucene_query);" />
       <MemberType>Method</MemberType>
-      <ReturnValue><ReturnType>MusicBrainz.Query&lt;MusicBrainz.Release&gt;</ReturnType></ReturnValue>
-      <Parameters><Parameter Name="lucene_query" Type="System.String" /></Parameters>
-      <Docs><param name="lucene_query">A lucene text query.</param><summary>Query for Releases by lucene text query.</summary><returns>An enumerable Query of results.</returns><remarks>
+      <ReturnValue>
+        <ReturnType>MusicBrainz.Query&lt;MusicBrainz.Release&gt;</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="lucene_query" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="lucene_query">A lucene text query.</param>
+        <summary>Query for Releases by lucene text query.</summary>
+        <returns>An enumerable Query of results.</returns>
+        <remarks>
           <block subset="none" type="note">
 See http://wiki.musicbrainz.org/TextSearchSyntax
 </block>
-        </remarks></Docs>
-    </Member><Member MemberName="Script">
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Script">
       <MemberSignature Language="C#" Value="public string Script { get; };" />
       <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>System.String</ReturnType></ReturnValue>
-      <Docs><summary>The script of the Release title and track titles.</summary><value>An ISO 15924 script code. null if MusicBrainz does not have script data for a given Release.</value><remarks>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>The script of the Release title and track titles.</summary>
+        <value>An ISO 15924 script code. null if MusicBrainz does not have script data for a given Release.</value>
+        <remarks>
           <block subset="none" type="note">
 See http://wiki.musicbrainz.org/ReleaseLanguage and http://www.unicode.org/iso15924/iso15924-codes.html
 </block>
-        </remarks></Docs>
-    </Member><Member MemberName="Status">
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Status">
       <MemberSignature Language="C#" Value="public MusicBrainz.ReleaseStatus Status { get; };" />
       <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>MusicBrainz.ReleaseStatus</ReturnType></ReturnValue>
-      <Docs><summary>The Status of the Release.</summary><value>To be added.</value><remarks>
+      <ReturnValue>
+        <ReturnType>MusicBrainz.ReleaseStatus</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>The Status of the Release.</summary>
+        <value>To be added.</value>
+        <remarks>
           <block subset="none" type="note">
 See http://wiki.musicbrainz.org/ReleaseStatus
 </block>
-        </remarks></Docs>
-    </Member><Member MemberName="Tracks">
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Tracks">
       <MemberSignature Language="C#" Value="public System.Collections.Generic.List&lt;MusicBrainz.Track&gt; Tracks { get; };" />
       <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>System.Collections.Generic.List&lt;MusicBrainz.Track&gt;</ReturnType></ReturnValue>
-      <Docs><summary>The list of the Tracks that are included in the Release.</summary><value>A list of <see cref="T:MusicBrainz.Track" />s. If there are no Tracks, an empty list.</value><remarks>This property will never be null.</remarks></Docs>
-    </Member><Member MemberName="Type">
+      <ReturnValue>
+        <ReturnType>System.Collections.Generic.List&lt;MusicBrainz.Track&gt;</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>The list of the Tracks that are included in the Release.</summary>
+        <value>A list of <see cref="T:MusicBrainz.Track" />s. If there are no Tracks, an empty list.</value>
+        <remarks>This property will never be null.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="Type">
       <MemberSignature Language="C#" Value="public MusicBrainz.ReleaseType Type { get; };" />
       <MemberType>Property</MemberType>
-      <ReturnValue><ReturnType>MusicBrainz.ReleaseType</ReturnType></ReturnValue>
-      <Docs><summary>The Type of the Release.</summary><value>To be added.</value><remarks>
+      <ReturnValue>
+        <ReturnType>MusicBrainz.ReleaseType</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>The Type of the Release.</summary>
+        <value>To be added.</value>
+        <remarks>
           <block subset="none" type="note">
 See http://wiki.musicbrainz.org/ReleaseType
 </block>
-        </remarks></Docs>
-    </Member><Member MemberName="UrlExtension"><MemberSignature Language="C#" Value="protected override string UrlExtension { get; };" /><MemberType>Property</MemberType><ReturnValue><ReturnType>System.String</ReturnType></ReturnValue><Docs><summary>To be added.</summary><value>To be added.</value><remarks>To be added.</remarks></Docs></Member><Member MemberName="QueryFromDevice"><MemberSignature Language="C#" Value="public static MusicBrainz.Release QueryFromDevice (string device);" /><MemberType>Method</MemberType><ReturnValue><ReturnType>MusicBrainz.Release</ReturnType></ReturnValue><Parameters><Parameter Name="device" Type="System.String" /></Parameters><Docs><param name="device">To be added.</param><summary>To be added.</summary><returns>To be added.</returns><remarks>To be added.</remarks></Docs></Member></Members>
-</Type>
+        </remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="UrlExtension">
+      <MemberSignature Language="C#" Value="protected override string UrlExtension { get; };" />
+      <MemberType>Property</MemberType>
+      <ReturnValue>
+        <ReturnType>System.String</ReturnType>
+      </ReturnValue>
+      <Docs>
+        <summary>To be added.</summary>
+        <value>To be added.</value>
+        <remarks>To be added.</remarks>
+      </Docs>
+    </Member>
+    <Member MemberName="QueryFromDevice">
+      <MemberSignature Language="C#" Value="public static MusicBrainz.Query&lt;MusicBrainz.Release&gt; QueryFromDevice (string device);" />
+      <MemberType>Method</MemberType>
+      <ReturnValue>
+        <ReturnType>MusicBrainz.Query&lt;MusicBrainz.Release&gt;</ReturnType>
+      </ReturnValue>
+      <Parameters>
+        <Parameter Name="device" Type="System.String" />
+      </Parameters>
+      <Docs>
+        <param name="device">The path to a device, e.g. "/dev/cdrom/" or "E:\"</param>
+        <summary>Query for Releases which match the disc in the specified device.</summary>
+        <returns>An enumerable Query of results.</returns>
+        <remarks>It is almost always the case that only one Release matches a given disc. It is more often the case still that one Release suffices as the result of querying by device. The Query&lt;Release&gt; type can be implicitly converted to a Release, allowing for the very simple syntax of:
+<example><code lang="C#">
+Release r = Release.QueryFromDevice("/dev/cdrom/");
+  </code></example></remarks>
+      </Docs>
+    </Member>
+  </Members>
+</Type>
\ No newline at end of file

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	Wed Feb 13 19:22:11 2008
@@ -127,8 +127,11 @@
         
         public static implicit operator T(Query<T> query)
         {
+            byte limit = query.limit;
             query.limit = 1;
-            return query.Count > 0 ? query[0] : null;
+            T result = query.Count > 0 ? query[0] : null;
+            query.limit = limit;
+            return result;
         }
     }
 

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	Wed Feb 13 19:22:11 2008
@@ -378,7 +378,7 @@
             return new Query<Release>(EXTENSION, QueryLimit, parameters.ToString());
         }
 
-        public static Release QueryFromDevice(string device)
+        public static Query<Release> QueryFromDevice(string device)
         {
             if(device == null)
                 throw new ArgumentNullException("device");



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