예제 #1
0
        public static ItemEditor CreateInstance(VolumeItemType itemType)
        {
            switch (itemType)
            {
            case VolumeItemType.FileVolumeItem:
                return(new FileItemEditor());

            case VolumeItemType.DirectoryVolumeItem:
                return(new DirectoryItemEditor());

            case VolumeItemType.AudioTrackVolumeItem:
                return(new AudioTrackItemEditor());

            default:
                throw new NotImplementedException(string.Format("ItemEditor widget for VolumeItemType {0} is not implemented", itemType.ToString()));
            }
        }
예제 #2
0
        internal static VolumeItem CreateInstance(VolumeItemType type, VolumeDatabase database)
        {
            VolumeItem item = null;

            switch (type)
            {
            case VolumeItemType.DirectoryVolumeItem:
                item = new DirectoryVolumeItem(database);
                break;

            case VolumeItemType.FileVolumeItem:
                item = new FileVolumeItem(database);
                break;

            case VolumeItemType.AudioCdRootVolumeItem:
                item = new AudioCdRootVolumeItem(database);
                break;

            case VolumeItemType.AudioTrackVolumeItem:
                item = new AudioTrackVolumeItem(database);
                break;

            default:
                throw new NotImplementedException(string.Format("Instantiation of type {0} is not implemented", type.ToString()));
            }
            return(item);
        }
예제 #3
0
파일: VolumeItem.cs 프로젝트: pulb/basenji
 internal static VolumeItem CreateInstance(VolumeItemType type, VolumeDatabase database)
 {
     VolumeItem item = null;
     switch (type) {
         case VolumeItemType.DirectoryVolumeItem:
             item = new DirectoryVolumeItem(database);
             break;
         case VolumeItemType.FileVolumeItem:
             item = new FileVolumeItem(database);
             break;
         case VolumeItemType.AudioCdRootVolumeItem:
             item = new AudioCdRootVolumeItem(database);
             break;
         case VolumeItemType.AudioTrackVolumeItem:
             item = new AudioTrackVolumeItem(database);
             break;
         default:
             throw new NotImplementedException(string.Format("Instantiation of type {0} is not implemented", type.ToString()));
     }
     return item;
 }