Closed Whismeril closed 3 years ago
Second problem comes because I don't have LightModeColorDictionary.csv and DarkModeColorDictionary.csv in My Documents and program doesn't load default values. I've found this files in directory Asset so I've moved them it in My Documents, (because Sub UpdateColorDictionariesFromFile doesn't update dictionaries if files in Asset and My Document are the same)
@Whismeril This current version requires 16.9 Preview 4 to support Visual Basic Source Generation. This was an unfortunate result of wanting to move to Source Generation too soon without specifying 16.9 Preview as a requirement. I have updated it to support Visual Studio 2019 Version 16.8.0 IF Assets Csv_LightModeColorDictionary.vb and Csv_DarkModeColorDictionary.vb are included in project.
Thanks
Compilation errors steel occurs
It seems be cause of this lines are commented
Runtime errors steel occurs too.
In form Load, as this time s_LightModeColorDictionary and s_DarkModeColorDictionary are empty
So CurrentThemeDictionary is empty too.
Sub UpdateColorDictionariesFromFile doesn't fill data in s_LightModeColorDictionary and s_DarkModeColorDictionary because there is not data to update (for the test I've deleted files in My Documents, let them in Asset Directory) It means that files in Asset Directory should be filled before by sub LoadColorDictionaryFromFile but are not.
this correction works for me, but name UpdateColorDictionariesFromFile is not good now
Public Sub UpdateColorDictionariesFromFile()
Dim executableDirectoryPath As String = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "Assets")
Dim assetColorFile As String = Path.Combine(executableDirectoryPath, _lightModeDictionaryFileName)
Dim userColorFile As String = Path.Combine(FileIO.SpecialDirectories.MyDocuments, _lightModeDictionaryFileName)
If s_LightModeColorDictionary.Count = 0 Then 'load file in Asset directory if needed
LoadColorDictionaryFromFile(assetColorFile, s_LightModeColorDictionary)
End If
If File.Exists(userColorFile) AndAlso assetColorFile.AreNotSame(userColorFile) Then
s_LightModeColorDictionary = MergeColorDictionary(userColorFile, File.GetLastAccessTime(assetColorFile), s_LightModeColorDictionary)
End If
assetColorFile = Path.Combine(executableDirectoryPath, _darkModeDictionaryFileName)
userColorFile = Path.Combine(FileIO.SpecialDirectories.MyDocuments, _darkModeDictionaryFileName)
If s_DarkModeColorDictionary.Count = 0 Then 'load file in Asset directory if needed
LoadColorDictionaryFromFile(assetColorFile, s_DarkModeColorDictionary)
End If
If File.Exists(userColorFile) AndAlso assetColorFile.AreNotSame(userColorFile) Then
s_DarkModeColorDictionary = MergeColorDictionary(userColorFile, File.GetLastWriteTime(assetColorFile), s_DarkModeColorDictionary)
End If
End Sub
@Whismeril I will post a fix tonight. I should have tested this more on 16.8
@Whismeri tested and posted fix in Branch Support16.8. I will leave that there until 16.9 ships. Sorry for the issue. You should delete the 2 saved dictionaries in MyDocuments. You don't need to load the dictionaries they are static data in Assets for 16.8. Until I have full Theming editing them is a bad idea.
Thanks for you reactivity. I used your converter yesterday to translate source I let on french open source platform. I’ve found few mistakes with = and is. I’ll make short example and open a specific issue.
@Whismeril Yes please open a separate issue. I will look into it, I know it is not possible for me to get everyone correct especially if you do one file or snippet at a time. Whole project or solution does a better but n perfect job.
Hello,
compilation returns me errors 's_LightModeColorDictionary' is not defined and 's_DarkModeColorDictionary' is not defined In the file ColorSelector.vb I've found this 2 commented lines ` 'Friend s_DarkModeColorDictionary As New Dictionary(Of String, ColorDescriptor)(StringComparer.OrdinalIgnoreCase)
I've tried uncomment them. Then compilation goes on, but at runtime, eventHandler MyApplication_UnhandledException occurs. The problem is in Fom1.Load, this line
DefaultColor = CurrentThemeDictionary(ThemeDefaultColor)
returns error default key doesn't exist in dictionary, value of ThemeDefaultColor is "default"I've tried download zip code and clone the repository, both give me these errors.
I've Visual Studio Community 2019 16.8.5. SDK .NET 5 and NetStandard 2 are installed.
Where is my mistake?
Thanks