public static void write(BaseMetadata metadata, CancellableOperationProgressBase progress = null) { if (metadata is ImageMetadata) { ImageFileMetadataWriter imageMetadataWriter = new ImageFileMetadataWriter(); imageMetadataWriter.writeMetadata(metadata, progress); } else if (metadata is VideoMetadata) { VideoFileMetadataWriter videoMetadataWriter = new VideoFileMetadataWriter(); videoMetadataWriter.writeMetadata(metadata, progress); } else if (metadata is AudioMetadata) { AudioFileMetadataWriter audioMetadataWriter = new AudioFileMetadataWriter(); audioMetadataWriter.writeMetadata(metadata, progress); } else { MetadataFileWriter metadataFileWriter = new MetadataFileWriter(); metadataFileWriter.writeMetadata(metadata, progress); } }