-
Notifications
You must be signed in to change notification settings - Fork 14
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
Change MIX files to be loaded from a single list #150
Conversation
94dae4c
to
455874a
Compare
455874a
to
58c17b8
Compare
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.
This looks somehow heavy to parse for my eyes...
I'd prefer something like
0=landmd.mix,1
1=languagemd.mix,1
2=$EXPANDMD
; ...
Where the optional number after the name would denote whether it's required
Maybe even the current style would be good enough if the "required" status could be specified with a boolean or a number though
langmd.mix=1
language.mix=1
$EXPANDMD=0
|
||
var mixesSection = iniFile.GetSection("MIXFiles"); | ||
foreach (var kvp in mixesSection.Keys) | ||
{ | ||
var parts = kvp.Value.Split(',', StringSplitOptions.TrimEntries); | ||
string mixName = parts[0]; | ||
|
||
if (IsSpecialMixName(mixName)) | ||
{ | ||
HandleSpecialMixName(mixName); | ||
continue; | ||
} | ||
|
||
bool isRequired = false; | ||
|
||
if (parts.Length > 1) | ||
isRequired = Conversions.BooleanFromString(parts[1], isRequired); | ||
|
||
if (isRequired) | ||
LoadRequiredMixFile(mixName); | ||
else | ||
LoadOptionalMixFile(mixName); | ||
} |
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.
Make this part into its own function, such as LoadMixFiles
, to keep the general ReadConfig
function flow clean. I liked how it was originally just a few DoForEveryValueInSection
calls.
It could even be LoadMixFile(string entry)
so it could be called with iniFile.DoForEveryValueInSection
.
Changes mix files to be loaded from one list with the value controlling if they are required or optional. Meant to help merge the 2 TS branches.
Config for YR: