Пример #1
0
        internal static Volume CreateInstance(VolumeType type, VolumeDatabase database)
        {
            Volume volume = null;

            switch (type)
            {
            case VolumeType.FileSystemVolume:
                volume = new FileSystemVolume(database);
                break;

            case VolumeType.AudioCdVolume:
                volume = new AudioCdVolume(database);
                break;

            default:
                throw new NotImplementedException(string.Format("Instanciation of type {0} is not implemented", type.ToString()));
            }
            return(volume);
        }
Пример #2
0
 internal static Volume CreateInstance(VolumeType type, VolumeDatabase database)
 {
     Volume volume = null;
     switch (type) {
         case VolumeType.FileSystemVolume:
             volume = new FileSystemVolume(database);
             break;
         case VolumeType.AudioCdVolume:
             volume = new AudioCdVolume(database);
             break;
         default:
             throw new NotImplementedException(string.Format("Instanciation of type {0} is not implemented", type.ToString()));
     }
     return volume;
 }