private void OnMakePatch( object sender, EventArgs e ) { if ( lstCenRep.SelectedItems.Count < 1 ) return; string fn = _cenRepDir+@"\" +lstCenRep.SelectedItems[0].SubItems[0].Text+".txt"; TCenRepParser cenRep = new TCenRepParser( fn ); ofdOpenCenrep.DefaultExt = "txt"; ofdOpenCenrep.FileName = lstCenRep.SelectedItems[0].SubItems[0].Text + ".txt"; ofdOpenCenrep.InitialDirectory=@"C:\"; if ( ofdOpenCenrep.ShowDialog() != DialogResult.OK ) return; XElement xPatch = cenRep.CreatePatch( ofdOpenCenrep.SafeFileName ); plugin.Add( xPatch ); plugin.Save(); }