@@ -27,10 +27,18 @@ public partial class frmTagger : Form
2727 private List < UITagGroup > tagGroups = new List < UITagGroup > ( ) ;
2828 private UITagGroup selectedGroup ;
2929
30+ private Properties . Settings Settings ;
31+
3032 public frmTagger ( )
3133 {
3234 InitializeComponent ( ) ;
3335
36+
37+ Settings = new Properties . Settings ( ) ;
38+ txtPath . Text = Settings . LastPath ;
39+ standardShortcuts . Checked = Settings . StandardShortcuts ;
40+ imageSize = Settings . ImageSize ;
41+
3442 lst . TileSize = new Size ( imageSize , imageSize ) ;
3543
3644 ChangeTagLayout ( standardShortcuts . Checked ) ;
@@ -79,12 +87,15 @@ private void addGroup(UITagGroup group)
7987 private void frmTagger_Load ( object sender , EventArgs e )
8088 {
8189 ActiveControl = txtPath ;
90+ if ( txtPath . Text != "" )
91+ buttonLoad_Click ( sender , e ) ;
8292 }
8393
8494 private void frmTagger_FormClosing ( object sender , FormClosingEventArgs e )
8595 {
8696 threadPool . Run = false ;
8797 buttonSave_Click ( sender , e ) ;
98+ Settings . Save ( ) ;
8899 }
89100
90101
@@ -96,6 +107,8 @@ private void buttonLoad_Click(object sender, EventArgs e)
96107 if ( path . Length == 0 || ! Directory . Exists ( path ) )
97108 return ;
98109
110+ Settings . LastPath = path ;
111+
99112 lst . SuspendLayout ( ) ;
100113 images . Clear ( ) ;
101114 lst . Clear ( ) ;
@@ -151,13 +164,18 @@ private void buttonLoad_Click(object sender, EventArgs e)
151164 thumb . Dispose ( ) ;
152165 img . Dispose ( ) ;
153166
154- Invoke ( new Action ( ( ) =>
167+ try
155168 {
156- if ( info . ListView != null )
157- info . ListView . RedrawItems ( info . Index , info . Index , false ) ;
158- else
159- lst . Invalidate ( ) ;
160- } ) ) ;
169+ Invoke ( new Action ( ( ) =>
170+ {
171+ if ( info . ListView != null )
172+ info . ListView . RedrawItems ( info . Index , info . Index , false ) ;
173+ else
174+ lst . Invalidate ( ) ;
175+ } ) ) ;
176+ }
177+ catch ( Exception ex ) when ( ex is ObjectDisposedException || ex is InvalidAsynchronousStateException )
178+ { }
161179 } ) ;
162180 }
163181
@@ -330,6 +348,7 @@ private void lst_MouseDoubleClick(object sender, MouseEventArgs e)
330348
331349 private void standardShortcuts_CheckedChanged ( object sender , EventArgs e )
332350 {
351+ Settings . StandardShortcuts = standardShortcuts . Checked ;
333352 ChangeTagLayout ( standardShortcuts . Checked ) ;
334353 }
335354
0 commit comments