// Public methods public void Initialize(Gallery gallery, string directory, DownloadFilenameGenerator filenameGenerator) { if (this.Gallery == null) { this.Gallery = gallery; } else { throw new InvalidOperationException("이미 초기화된 객체입니다."); } this.directoryPath = directory; this.filenameGenerator = filenameGenerator; foreach (char i in Path.GetInvalidPathChars()) { directoryPath = directoryPath.Replace(i, '_'); } }
public Downloader(DownloadDirectoryGenerator directoryGenerator, DownloadFilenameGenerator filenameGenerator) : base() { this.directoryGenerator = directoryGenerator; this.filenameGenerator = filenameGenerator; }