1

All, firstly I am aware of this very useful question and related answers C# DLL config file. However, I need some advice on the best way to proceed in my specific case.

I have a large application that uses embedded SQL. To make the burden of writing SQL easier I have developed an SQL Editor facility with a built in snippet library and other such niceties, alleviating users of the burden of launching Management Studio each time they want to test a query and providing a library of common commands. This utility is a good tool I may want to embed in other apps so I have made it a DLL. Now what are my options for storing the setting for this application?

  1. Creating the settings using a .config file in the main application and pass a properties object to the DLL; which is saved by the main app on DLL closure. In this case (probably my best option) is there a pattern I can use to handle changes to my editors settings?.

  2. Create a .config for the DLL and store the settings in the same place regardless of the calling app. [note, I have seen the problems with doing this in the linked question - I am only likely to ever have the DLL called from a single app].

  3. Any other magical ways?

Thanks for your time.

Community
  • 1
  • 1
MoonKnight
  • 23,214
  • 40
  • 145
  • 277
  • 2
    Personally, I would guess that it doesn't matter what kind of app or DLL you have. Simply save the settings somewhere in an XML file in e.g. "%APPDATA%\YourApp\configuration.xml". – Uwe Keim Sep 27 '12 at 17:25
  • "alleviating users of the burden of launching Management Studio" ??? Sounds like you're writing a new SSMS. I'd be interested to hear more about this. – Nick Vaccaro Sep 27 '12 at 19:49
  • Well, it is a trimmed down version of SSMS. It will facilitate direct testing and ability to add authoured SQL directly into the maiin app after testing. It has a SQL parser to test syntax, a full find replace facility and an SQL snippet library (like that in LINQPad). I have used the book "Dissecting a C# Application" to build a slim editor based upon [ICSharpCode](http://www.codeproject.com/Articles/30936/Using-ICSharpCode-TextEditor). I have rewritten the majority of this to make it look like VS2012. It looks great but is not finished... – MoonKnight Sep 28 '12 at 08:38

0 Answers0