Another question to the 'masters'
Have I to dispose the IConfigurationSection object got with OpenCurrentProfile() ?
Here's how I wrote the method, is it the good way ?
private void helpButton_Click(object sender, EventArgs e)
{
try
{
using (IConfigurationSection profile = AcApp.UserConfigurationManager.OpenCurrentProfile())
{
string acadProp =(string)profile.OpenSubsection("General").ReadProperty("ACAD", string.Empty);
string[] pathes = acadProp.Split(new char[] { ';' });
string fullName = "";
for (int i = 0; fullName == "" && i != pathes.Length; i++)
{
string path = pathes[i];
if (path != "")
{
string[] files = Directory.GetFiles(path, "cadnormh.chm");
if (files.Length > 0)
fullName = files[0];
}
}
if (fullName != "")
Help.ShowHelp(this, fullName);
else
ed.WriteMessage("Le fichier \"CADnormH.chm\" est introuvable.\n");
}
}
catch (System.Exception ex)
{
ed.WriteMessage(ex.Message);
}
}