Click here to Skip to main content
15,897,273 members
Home / Discussions / C#
   

C#

 
GeneralRe: how can i add a new node in treeview programatically ? and save changes? Pin
led mike23-Jan-08 4:40
led mike23-Jan-08 4:40 
GeneralRe: how can i add a new node in treeview programatically ? and save changes? Pin
ChrisKo23-Jan-08 11:36
ChrisKo23-Jan-08 11:36 
GeneralMultiple Config Files Pin
#realJSOP23-Jan-08 0:01
professional#realJSOP23-Jan-08 0:01 
GeneralRe: Multiple Config Files Pin
Ed.Poore23-Jan-08 1:59
Ed.Poore23-Jan-08 1:59 
GeneralRe: Multiple Config Files Pin
darkelv23-Jan-08 2:00
darkelv23-Jan-08 2:00 
GeneralRe: Multiple Config Files Pin
#realJSOP23-Jan-08 3:28
professional#realJSOP23-Jan-08 3:28 
GeneralRe: Multiple Config Files Pin
Pete O'Hanlon23-Jan-08 4:24
mvePete O'Hanlon23-Jan-08 4:24 
GeneralRe: Multiple Config Files Pin
#realJSOP23-Jan-08 5:04
professional#realJSOP23-Jan-08 5:04 
I did it this way (the code below was abstracted a bit to keep it from overwhelming CP):

public class MyLibClass
{
	private string m_configName = "MyLib.dll.config";
	private string keyName = "APP_CONFIG_FILE";

	public MyLibClass()
	{
		Reload();
	}

	public void Reload()
	{
		// build the path to the config file
		string configPath = System.IO.Path.Combine(Environment.CurrentDirectory, m_configName);

		// get the name of the hosting application's config file (so we can reset it later)
		string appConfigFile = AppDomain.CurrentDomain.GetData(keyName).ToString();

		// plug in the DLL's config file path/name
		AppDomain.CurrentDomain.SetData(keyName, configPath);

		// load some app settings using the ConfigurationManager class
		string xyz = ConfigurationManager.AppSettings["mySetting"];

		// reset the current config file to the hosting app's config file
		AppDomain.CurrentDomain.SetData(keyName, appConfigFile);
	}
}



"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


Questionhow to make call for play recorded .wav file in linux asterisk server using asterisk.net? Pin
patel_amit22-Jan-08 23:19
patel_amit22-Jan-08 23:19 
GeneralRe: how to make call for play recorded .wav file in linux asterisk server using asterisk.net? Pin
PIEBALDconsult23-Jan-08 3:03
mvePIEBALDconsult23-Jan-08 3:03 
Questionhow do i save the changes? Pin
samidhas22-Jan-08 23:18
samidhas22-Jan-08 23:18 
GeneralRe: how do i save the changes? Pin
Naveed72722-Jan-08 23:35
Naveed72722-Jan-08 23:35 
GeneralRe: how do i save the changes- plz send me sample code? Pin
samidhas22-Jan-08 23:43
samidhas22-Jan-08 23:43 
GeneralRe: how do i save the changes? Pin
ChrisKo23-Jan-08 8:19
ChrisKo23-Jan-08 8:19 
GeneralRe: how do i save the changes? Pin
ChrisKo23-Jan-08 11:29
ChrisKo23-Jan-08 11:29 
QuestionHow to set dateformat in DataGridView column Pin
Neo Andreson22-Jan-08 22:56
Neo Andreson22-Jan-08 22:56 
AnswerRe: How to set dateformat in DataGridView column Pin
Naveed72722-Jan-08 23:20
Naveed72722-Jan-08 23:20 
GeneralRe: How to set dateformat in DataGridView column Pin
Neo Andreson23-Jan-08 0:41
Neo Andreson23-Jan-08 0:41 
AnswerRe: How to set dateformat in DataGridView column Pin
darkelv23-Jan-08 0:48
darkelv23-Jan-08 0:48 
GeneralRe: How to set dateformat in DataGridView column Pin
Neo Andreson23-Jan-08 1:15
Neo Andreson23-Jan-08 1:15 
Questionput zoom and unzoom affects in picturebox Pin
Naveed72722-Jan-08 22:41
Naveed72722-Jan-08 22:41 
GeneralRe: put zoom and unzoom affects in picturebox Pin
Paul Conrad27-Jan-08 7:19
professionalPaul Conrad27-Jan-08 7:19 
GeneralRe: put zoom and unzoom affects in picturebox Pin
Naveed72727-Jan-08 18:15
Naveed72727-Jan-08 18:15 
GeneralRe: put zoom and unzoom affects in picturebox Pin
Paul Conrad28-Jan-08 13:54
professionalPaul Conrad28-Jan-08 13:54 
QuestionHow t get rid/hide True/false drop down List Box when check Box is used with it in Property Grid in C# .NET [modified] Pin
Varad_Rajan22-Jan-08 22:18
Varad_Rajan22-Jan-08 22:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.