GetColormaps() throws on second call
See original GitHub issueScottPlot.Drawing.Colormap.GetColormaps()
throws on second call.
There is related with Reflection
exception.
var colormaps = ScottPlot.Drawing.Colormap.GetColormaps();
var colormaps1 = ScottPlot.Drawing.Colormap.GetColormaps();
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Simulate first call fails, second call succeeds
From the docs: Sometimes we need to stub with different return value/exception for the same method call. Typical use case could be mocking ......
Read more >ImageServiceInfo (ArcObjects Java API)
Convert the object to another object that is supported. ... public ISpatialReference getSpatialReference() throws java.io.IOException, AutomationException.
Read more >Lua/Functions
This is a comprehensive list of all functions that can be utilized by Lua scripting, excluding those that are part of userdata structures....
Read more >Cell Density Map - Image Analysis
Hi, I'm looking for a way to compute cell density map, based on already segmented cells (in 2D). My goal is to visually...
Read more >API
Convert stored pixel data to image data. For uint16 pack uint16 into two uint8 channels (r and a). Parameters. image Image A Cornerstone...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just want to fill combobox with available
Colormaps
names. Then user change selection i want to create newColormap
by provided name. It’s possible to achive with existingGetColormaps()
method, but i getLoadType
exception.Maybe it worth to make hard-coded list of available colormaps, and realise 2 additional api methods:
string[] GetAvailableColormapsNames()
;Colormap CreateColormap(string name)
;As far as I understand, reflection is used to simplify the addition Colormaps, but one way or another, all Colormaps are hard-coded in these methods: https://github.com/ScottPlot/ScottPlot/blob/d2055308885c747443c902053749882a4be0b174/src/ScottPlot/Drawing/Colormap.cs#L13-L43 Maybe we should give up the use of reflection?
I just now realized that this is most likely the case, I got this error in a fairly old project, the project file was created in the old version of the VS2015 or older and has the old format, most likely this is the case. In general, the problem is most likely on my side, sorry to bother you. But getting this 2 methods without reflection would still be great, and without creating 20+
Colormaps
objects just to pull names out of them.