- Timestamp:
- 09/17/08 01:02:16 (4 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/csharp/iTunesCOMWrap/trunk/iTunesCOMWrap/Application.cs
r19308 r19406 12 12 namespace Clovery.iTunesHelper.COMWrap 13 13 { 14 public class ITunesApp : IITFactory 14 /// <summary> 15 /// iTunes Application Main Class 16 /// </summary> 17 public class ITunesApp : IITunesApp 15 18 { 16 19 private readonly IITunesWrappedObjectFactory _objectFactory; 17 20 protected internal object _internal; 18 p ublic IIndexedCollection<IPlaylist, bool> CanSetShuffle = new CanSetShufflePlaylistCollection();19 p ublic IIndexedCollection<IPlaylist, bool> CanSetSongRepeat = new CanSetSongRepeatPlaylistCollection();21 private readonly IIndexedCollection<IPlaylist, bool> _canSetShuffle = new PlaylistCanSetShuffleCollection(); 22 private readonly IIndexedCollection<IPlaylist, bool> _canSetSongRepeat = new PlaylistCanSetSongRepeatCollection(); 20 23 21 24 internal ITunesApp(iTunes.iTunesApp _internal, bool useCache) … … 38 41 } 39 42 43 /// <summary> 44 /// construct iTunesApp. 45 /// </summary> 46 /// <param name="useCache">cache iTunes Object if true, otherwise not.</param> 40 47 public ITunesApp(bool useCache) 41 48 : this(new iTunes.iTunesAppClass(), useCache) … … 43 50 } 44 51 52 /// <summary> 53 /// construct iTunesApp with default options. 54 /// </summary> 55 /// <remarks>Cache is disabled.</remarks> 45 56 public ITunesApp() : this(false) 46 57 { … … 273 284 { 274 285 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; } 275 296 } 276 297 … … 363 384 } 364 385 365 static private object _convertToITObjects(IITInternalObject track)366 {367 return track.__internalObject;368 }369 370 386 public event EventHandler<DatabaseChangedEventArgs> DatabaseChangedEvent; 371 387 public event EventHandler<TrackEventArgs> PlayerPlayEvent; … … 447 463 public IConvertOperationStatusWithEvents ConvertTrack(ITrack iTrackToConvert) 448 464 { 449 object real = _convertToITObjects(iTrackToConvert);465 object real = Utils.ConvertObjectToITObject(iTrackToConvert); 450 466 return this.factory.CreateConvertOperationStatus(this._asIiTunes.ConvertTrack2(ref real)); 451 467 } 452 468 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); 458 472 return this.factory.CreateConvertOperationStatus(this._asIiTunes.ConvertTracks2(ref real)); 459 473 } … … 557 571 namespace Internal 558 572 { 559 internal class CanSetShufflePlaylistCollection : IIndexedCollection<IPlaylist, bool>573 internal class PlaylistCanSetShuffleCollection : IIndexedCollection<IPlaylist, bool> 560 574 { 561 575 public bool this[IPlaylist Playlist] … … 565 579 } 566 580 567 internal class CanSetSongRepeatPlaylistCollection : IIndexedCollection<IPlaylist, bool>581 internal class PlaylistCanSetSongRepeatCollection : IIndexedCollection<IPlaylist, bool> 568 582 { 569 583 public bool this[IPlaylist Playlist]
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)