Share

Nini

Tracker: Bugs

5 ShowDialog() gives problem for saving ini - ID: 1546094
Last Update: Comment added ( bmatzelle )

Hello,

I am using the last Nini version with VS2005 c# for
ini files.

When I do this :
openFileDialog_MyShowDialog.ShowDialog();

And then go into this function :
void openFileDialog_MyShowDialog_FileOk(object
sender, System.ComponentModel.CancelEventArgs e)

The function Save() (to save the ini file) does not
work anymore.

Note :
If I press "Cancel" from the ShowDialog window, the
Save() function still works. It fails only when I
press "Ok".

Note :
To avoid any cause from my code, I removed all code
into the "openFileDialog_MyShowDialog_FileOk"
function.

Do somebody already had any experience of that ?


Nobody/Anonymous ( nobody ) - 2006-08-24 16:56

5

Closed

Invalid

Brent R. Matzelle

INI

None

Public


Comments ( 3 )




Date: 2007-04-30 02:24
Sender: bmatzelleProject Admin


Cool. Thanks for clearing that up.


Date: 2007-04-27 13:32
Sender: kalaluatrail


I have in VB.Net 2005 :
If dlgOpen.ShowDialog() = Windows.Forms.DialogResult.OK
'some code, please note that source was defined earlier as :
'Dim source as new iniConfigSource("auSettings.ini")

sFileName = New FileInfo(dlgOpen.FileName).FullName
Me.txtFileName.Text = sFileName

'Update the user's default Directory & File Name
sStartDir = Path.GetDirectoryName(sFileName)
sStartFile = Path.GetFileName(sFileName)

source.Configs("ProductFamilyLoadDefaults").Set("Directory",
sStartDir)
source.Configs("ProductFamilyLoadDefaults").Set("FileName",
sStartFile)
source.Save()
else
'other code here
end if

I thought the source.save did not work because my original ini file
was
not updated. Instead, it wrote out an ini file to the directory I
had
selected (bummer). I'll add code to make the original directory the

current directory before issuing the save.





Date: 2007-04-18 02:00
Sender: bmatzelleProject Admin


Without first seeing the source code it's difficult to figure out what
your problem is.


Log in to comment.

Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2007-04-30 02:24 bmatzelle
resolution_id None 2007-04-30 02:24 bmatzelle
close_date - 2007-04-30 02:24 bmatzelle
assigned_to nobody 2007-04-18 02:00 bmatzelle