Show
Ignore:
Timestamp:
09/17/08 01:02:16 (4 months ago)
Author:
topia
Message:

fix Signature of ITunesApp.ConvertTracks?.
* Add more XML documentation comments.
* split ITunesApp interface as IITunesApp.
* This is ABI breakage, bump major version.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Application.cs

    r19308 r19406  
    1212namespace Clovery.iTunesHelper.COMWrap 
    1313{ 
    14     public class ITunesApp : IITFactory 
     14    /// <summary> 
     15    /// iTunes Application Main Class 
     16    /// </summary> 
     17    public class ITunesApp : IITunesApp 
    1518    { 
    1619        private readonly IITunesWrappedObjectFactory _objectFactory; 
    1720        protected internal object _internal; 
    18         public IIndexedCollection<IPlaylist, bool> CanSetShuffle = new CanSetShufflePlaylistCollection(); 
    19         public IIndexedCollection<IPlaylist, bool> CanSetSongRepeat = new CanSetSongRepeatPlaylistCollection(); 
     21        private readonly IIndexedCollection<IPlaylist, bool> _canSetShuffle = new PlaylistCanSetShuffleCollection(); 
     22        private readonly IIndexedCollection<IPlaylist, bool> _canSetSongRepeat = new PlaylistCanSetSongRepeatCollection(); 
    2023 
    2124        internal ITunesApp(iTunes.iTunesApp _internal, bool useCache) 
     
    3841        } 
    3942 
     43        /// <summary> 
     44        /// construct iTunesApp. 
     45        /// </summary> 
     46        /// <param name="useCache">cache iTunes Object if true, otherwise not.</param> 
    4047        public ITunesApp(bool useCache) 
    4148            : this(new iTunes.iTunesAppClass(), useCache) 
     
    4350        } 
    4451 
     52        /// <summary> 
     53        /// construct iTunesApp with default options. 
     54        /// </summary> 
     55        /// <remarks>Cache is disabled.</remarks> 
    4556        public ITunesApp() : this(false) 
    4657        { 
     
    273284        { 
    274285            get { return this._objectFactory; } 
     286        } 
     287 
     288        public IIndexedCollection<IPlaylist, bool> CanSetShuffle 
     289        { 
     290            get { return this._canSetShuffle; } 
     291        } 
     292 
     293        public IIndexedCollection<IPlaylist, bool> CanSetSongRepeat 
     294        { 
     295            get { return this._canSetSongRepeat; } 
    275296        } 
    276297 
     
    363384        } 
    364385 
    365         static private object _convertToITObjects(IITInternalObject track) 
    366         { 
    367             return track.__internalObject; 
    368         } 
    369  
    370386        public event EventHandler<DatabaseChangedEventArgs> DatabaseChangedEvent; 
    371387        public event EventHandler<TrackEventArgs> PlayerPlayEvent; 
     
    447463        public IConvertOperationStatusWithEvents ConvertTrack(ITrack iTrackToConvert) 
    448464        { 
    449             object real = _convertToITObjects(iTrackToConvert); 
     465            object real = Utils.ConvertObjectToITObject(iTrackToConvert); 
    450466            return this.factory.CreateConvertOperationStatus(this._asIiTunes.ConvertTrack2(ref real)); 
    451467        } 
    452468 
    453         public IConvertOperationStatusWithEvents ConvertTracks(ITrack[] iTracksToConvert) 
    454         { 
    455             object real = 
    456                 iTracksToConvert.ToList().ConvertAll( 
    457                     new Converter<ITrack, object>(_convertToITObjects)).ToArray(); 
     469        public IConvertOperationStatusWithEvents ConvertTracks(ITrackCollection iTracksToConvert) 
     470        { 
     471            object real = Utils.ConvertObjectToITObject(iTracksToConvert); 
    458472            return this.factory.CreateConvertOperationStatus(this._asIiTunes.ConvertTracks2(ref real)); 
    459473        } 
     
    557571    namespace Internal 
    558572    { 
    559         internal class CanSetShufflePlaylistCollection : IIndexedCollection<IPlaylist, bool> 
     573        internal class PlaylistCanSetShuffleCollection : IIndexedCollection<IPlaylist, bool> 
    560574        { 
    561575            public bool this[IPlaylist Playlist] 
     
    565579        } 
    566580 
    567         internal class CanSetSongRepeatPlaylistCollection : IIndexedCollection<IPlaylist, bool> 
     581        internal class PlaylistCanSetSongRepeatCollection : IIndexedCollection<IPlaylist, bool> 
    568582        { 
    569583            public bool this[IPlaylist Playlist]