PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Jul 15, 2024 10:05 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue May 29, 2012 9:54 pm 
Offline

Joined: Tue May 29, 2012 8:19 pm
Posts: 2
Hi all,

First off, I want to thank the creators of PDFSharp for making such a great tool :)

So my question is: Has anyone ever been able to store a color value setting (ie: Colors.SlateBlue) as a custom type in an app.config file ?

I tried asking in C# specific forums, but to no avail. So I thought I'd ask here. Kindly just tell me if this is not supported.

Thank you!


Top
 Profile  
Reply with quote  
PostPosted: Wed May 30, 2012 8:34 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3101
Location: Cologne, Germany
Hi, Francis,

I never tried it.

If you store the string "Slateblue" in the config file, use "public static Color Parse(string color)" (Color class) to retrieve the color.
If you store an uint32 (e.g. "0xFF6A5ACD" for Slateblue), use "public Color(uint argb)" to retrieve the color.

Parse will also handle the string "0xFF6A5ACD".

This is just a "haven't tried but should work" advice.
Where do you see a problem storing colors in config files?

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
PostPosted: Wed May 30, 2012 1:38 pm 
Offline

Joined: Tue May 29, 2012 8:19 pm
Posts: 2
Thomas Hoevel wrote:
Hi, Francis,

I never tried it.

If you store the string "Slateblue" in the config file, use "public static Color Parse(string color)" (Color class) to retrieve the color.
If you store an uint32 (e.g. "0xFF6A5ACD" for Slateblue), use "public Color(uint argb)" to retrieve the color.

Parse will also handle the string "0xFF6A5ACD".

This is just a "haven't tried but should work" advice.
Where do you see a problem storing colors in config files?


Holy crap, that really solves it all. Then I only need to store the color settings as string and use the Color.Parse() function. You guys really thought about everything :)

Thanks.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 28 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group