-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Кашин Александр #19
base: master
Are you sure you want to change the base?
Кашин Александр #19
Conversation
TagCloud/Client/ConsoleClient.cs
Outdated
private readonly App _app; | ||
private readonly ISettingsProvider _settingsProvider; | ||
|
||
public ConsoleClient(App app, ISettingsProvider settingsProvider) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Хотелось бы, чтобы клиенты были в отдельном запускаемом проекте (для каждого свой), а весь код облака тегов был доступен в виде ограниченного набора классов из библиотеки
TagCloud/TagPositioner/Circular/CircularCloudLayouterExtensions.cs
Outdated
Show resolved
Hide resolved
_wordsReader = wordsReader; | ||
_settingsProvider = settingsProvider; | ||
} | ||
public IEnumerable<string> Process() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Довай отрефакторим проект (расставим пробельные символы и переносы строк верно), у райдера есть специальная команда для этого, если ты в нем работаешь
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Прошелся решарпером
|
||
public class AppSettingsProvider : IAppSettingsProvider | ||
{ | ||
public AppSettings AppSettings { get; set; } = null!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Та же проблема - #19 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В целом в рамках приложения как будто логично сделать настройки статичными, либо явно передавать их параметром в код библиотеки (облака тегов), потому что сейчас их можно в любой момент из любого места пререопределить
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Решил на вход в библиотеку принимать настройки и сетить в провайдеры. Сами провайдеры сделал internal.
graphics.DrawString(tag.Word, font, brush, tag.Location); | ||
} | ||
|
||
bitmap.Save(appSettingsProvider.AppSettings.SavePath, System.Drawing.Imaging.ImageFormat.Png); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вот этот метод не выглядит гибким, на мой взгляд, svg сложно будет в текущий код добавить
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Выделил в отдельный класс для сохранения
No description provided.