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())); } }
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); }
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; }