Franken_.App_Code.Font.Delete C# (CSharp) Méthode

Delete() public méthode

public Delete ( ) : void
Résultat void
        public void Delete()
        {
            if (this.ID != "")
            {
                if (this.Glyphs != null)
                {
                    for (int x = 0; x < this.Glyphs.Count; x++)
                    {
                        this.Glyphs[x].Delete();
                    }
                }

                db.ExecuteCommand("delete from fonts where font_id = " + this.ID);
            }
        }

Usage Example

Exemple #1
0
        private void deleteFont_Click(object sender, EventArgs e)
        {
            DialogResult myResult = MessageBox.Show("Are you sure you want to delete " + myFont.Name + " and all of its data?  This process may take several minutes to complete.", "Delete Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (myResult == DialogResult.Yes)
            {
                this.Enabled = false;
                glyphBox.Controls.Clear();
                myFont.Delete();
                string FontDir = db.DataDirectory + "\\GlyphExtraction\\Output\\" + myFont.ID;
                if (System.IO.Directory.Exists(FontDir))
                {
                    System.IO.Directory.Delete(FontDir, true);
                }

                this.Close();
            }
        }