public static IDirectoryObject InstansiateMediaLibraryObject(MediaItem item, string baseKey, BasicContainer parent, string title)
        {
            IDirectoryObject obj;
            // Choose the appropiate MediaLibrary* object for the media item
            if (item.Aspects.ContainsKey(DirectoryAspect.ASPECT_ID))
            {
                obj = new MediaLibraryContainer(baseKey, item);
            }
            else if (item.Aspects.ContainsKey(AudioAspect.ASPECT_ID))
            {
                obj = new MediaLibraryMusicTrack(baseKey, item);
            }
            else if (item.Aspects.ContainsKey(ImageAspect.ASPECT_ID))
            {
                obj = new MediaLibraryImageItem(baseKey, item);
            }
            else if (item.Aspects.ContainsKey(VideoAspect.ASPECT_ID))
            {
                obj = new MediaLibraryVideoItem(baseKey, item);
            }
            else
            {
                obj = null;
            }

            // Assign the parent
            if (parent != null && obj != null)
            {
                parent.Add((TreeNode<object>)obj);
            }

            // Initialise the object
            if (obj is MediaLibraryContainer)
            {
                ((MediaLibraryContainer)obj).Initialise();                
            }
            else if (obj is MediaLibraryItem)
            {
                ((MediaLibraryItem)obj).Initialise();
            }
            if (obj != null)
            {
                ServiceRegistration.Get<ILogger>().Info("Created object of type {0} for MediaItem {1}", obj.GetType().Name, item.MediaItemId);
                if (title != null)
                {
                    obj.Title = title;
                }
            }      
      
            return obj;
        }
        public static IDirectoryObject InstansiateMediaLibraryObject(MediaItem item, string baseKey, BasicContainer parent, string title)
        {
            IDirectoryObject obj;
            // Choose the appropiate MediaLibrary* object for the media item
            if (item.Aspects.ContainsKey(DirectoryAspect.ASPECT_ID))
            {
                obj = new MediaLibraryContainer(baseKey, item);
            }
            else if (item.Aspects.ContainsKey(AudioAspect.ASPECT_ID))
            {
                obj = new MediaLibraryMusicTrack(baseKey, item);
            }
            else if (item.Aspects.ContainsKey(ImageAspect.ASPECT_ID))
            {
                obj = new MediaLibraryImageItem(baseKey, item);
            }
            else if (item.Aspects.ContainsKey(VideoAspect.ASPECT_ID))
            {
                obj = new MediaLibraryVideoItem(baseKey, item);
            }
            else
            {
                obj = null;
            }

            // Assign the parent
            if (parent != null && obj != null)
            {
                parent.Add((TreeNode<object>)obj);
            }

            // Initialise the object
            if (obj is MediaLibraryContainer)
            {
                ((MediaLibraryContainer)obj).Initialise();
            }
            else if (obj is MediaLibraryItem)
            {
                ((MediaLibraryItem)obj).Initialise();
            }
            if (obj != null)
            {
                ServiceRegistration.Get<ILogger>().Info("Created object of type {0} for MediaItem {1}", obj.GetType().Name, item.MediaItemId);
                if (title != null)
                {
                    obj.Title = title;
                }
            }

            return obj;
        }