question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem retrieving .net System.Drawing.Color from LiteDB

See original GitHub issue

Hi,

LiteDB seems to be having problems retrieving these values. Extract of my poco class:

Public Property ContentStretch As SetupWindow.ContentStretchMode = SetupWindow.ContentStretchMode.Stretch
    <Id(25, 10), Category("General"), DisplayName("Background Color"), Description("The window background colour. This can also include transparency.")>
    Public Property BackgroundColor As Color = Color.Lime
    <Id(30, 10), Category("General"), DisplayName("Window Type"), Description("Windowed of Fullscreen")>
    Public Property WindowType As SetupWindow.WindowTypes = SetupWindow.WindowTypes.Windowed
    <Id(35, 10), Category("General"), DisplayName("Topmost"), Description("Whether to place the window over all preceding windows")>
    Public Property Topmost As Boolean = False

If I explore the LiteDB - the color values all seem stored correctly:

litedb1

However, when I retrieve from LiteDB, all other values are retrieved correctly, apart from the color object (which seems to be default black):

litedb2

I’d be grateful if you could advise as this one has me scratching my head!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
maxkatz6commented, Nov 24, 2019
0reactions
JensSchadroncommented, Jan 28, 2020

Given that this issue has been answered, I’ll be closing the ticket. Feel free to reopen the ticket if you think that your question hasn’t been fully resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I set up a Custom Type in LiteDb?
I am trying to serialize and deserialize a System.Drawing.Color property in LiteDb. ... LiteDb does not deal with Color natively(see here).
Read more >
Object Mapping - LiteDB :: A .NET embedded NoSQL ...
The LiteDB mapper converts POCO classes documents. When you get a ILiteCollection<T> instance from LiteDatabase.GetCollection<T> , T will be your document ...
Read more >
[C#] Can't use type System.Drawing.Color - Discussion
When trying to use System.Drawing.Color from the CitizenFx.Core namespace the compiler complains that the referenced assembly is not defined ...
Read more >
[Solved]-LiteDB: Invalid BSON data type 'Null' on field '_id'-C#
I have a product class with a field columnId and I added another Id with type objectId to get rid of that Invalid...
Read more >
Dynamic Type Description Framework for PropertyGrid
A framework that allows you to customize your class for PropertyGrid at design-time and/or run-time. Using this framework your can control ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found