internal TrackDescriptor CreateChild()
 {
     TrackDescriptor res = new TrackDescriptor(this);
     RawTrackDescriptors.Add(res);
     return res;
 }
        internal TrackDescriptor AddExportedTrack(MusicCollection.Implementation.Track track, string path)
        {
            if (track == null)
                return null;

            if ((RawTrackDescriptors != null) && (from t in RawTrackDescriptors select t.Path).Contains(track.Path))
                return null;

            if (RawTrackDescriptors == null)
                RawTrackDescriptors = new List<TrackDescriptor>();

            TrackDescriptor td = new TrackDescriptor(this, track, path);

            RawTrackDescriptors.Add(td);
            return td;
        }
        public bool SaveToWindowsPhone(TrackDescriptor tr, ITargetDevice targ)
        {
            SendItemProgressDelegate progress = SendItemProgress;
            string Path = tr.Path;

            try
            {
                if (!File.Exists(Path))
                {
                    _IIC.OnFactorisableError<FileBrokenCannotBeExported>(Path);
                    return false;
                }

                WindowsDictionaryDecorator wdd = new WindowsDictionaryDecorator();
                new DataExchanger<TrackDescriptor>(tr).Describe(DataExportImportType.WindowsPhone, wdd);

                Uri file = new Uri(Path, UriKind.Absolute);

                Dictionary OutputDictionary = new Dictionary();
                targ.SendMusicFile(file, file, wdd.Dictionary, progress, OutputDictionary);

                return true;
            }
            catch (Exception e)
            {
                Trace.WriteLine(string.Format("Unexpected error during export to Windows phone {0}", e));
                _IIC.OnFactorisableError<UnableToExportFileToWindowsPhone>(Path);
                return false;
            }
        }
 public ExportToWindowsPhone(TrackDescriptor tr)
     : base(null)
 {
     MusicTrack = tr;
 }
        internal TrackDescriptor Clone(AlbumDescriptor newfather)
        {
            TrackDescriptor res = new TrackDescriptor
            {
                _Father = newfather,
                Artist = Artist,
                Name = Name,
                Path = Path,
                TrackNumber = TrackNumber,
                Duration = Duration,
                MD5 = MD5,
                Rating = Rating,
                DateAdded = DateAdded,
                LastPLayed = LastPLayed,
                PlayCount = PlayCount,
                DiscNumber = DiscNumber
            };

            return res;
        }