示例#1
0
        private void delRemovedButton_Click(object sender, EventArgs e)
        {
            if (myFont != null && SelectedGlyph > -1)
            {
                imagePanel.Controls.Clear();

                if (allPagesBox.Checked)
                {
                    if (db.GetRows("select * from images where img_glyph_id = " + myFont.Glyphs[SelectedGlyph].ID + " and img_status = 'REM'"))
                    {
                        DataTable ImgsToDelete = db.Bucket.Copy();
                        db.ExecuteCommand("delete from images where img_glyph_id = " + myFont.Glyphs[SelectedGlyph].ID + " and img_status = 'REM'");

                        foreach (DataRow DR in ImgsToDelete.Rows)
                        {
                            try
                            {
                                System.IO.File.Delete(db.DataDirectory + DR["img_path"].ToString());
                            }
                            catch (Exception E)
                            { }
                        }
                    }
                }
                else
                {
                    foreach (GlyphImage GI in myFont.Glyphs[SelectedGlyph].Images)
                    {
                        if (GI.Status == "REM")
                        {
                            GI.Delete(true);
                        }
                    }
                }

                myFont.Glyphs[SelectedGlyph].RefreshImages();
                RefreshCharList();
            }
        }