Franken_.App_Code.Font.Save C# (CSharp) Method

Save() public method

public Save ( bool IncludeChildren ) : void
IncludeChildren bool
return void
        public void Save(bool IncludeChildren)
        {
            if (this.ID == "")
            {
                this.ID = db.GetNewID("fonts");
                db.ExecuteCommand("insert into fonts (font_id, font_lang_id, font_name, font_italic, font_bold, font_fixed, font_serif, font_fraktur, font_line_height) values (" + this.ID + ", " + this.LangID + ", '" + db.FixString(this.Name) + "', " + this.Italic + ", " + this.Bold + ", " + this.Fixed + ", " + this.Serif + ", " + this.Fraktur + ", " + this.LineHeight + ")");
            }
            else
            {
                db.ExecuteCommand("update fonts set font_name = '" + db.FixString(this.Name) + "', " +
                    "font_lang_id = " + this.LangID + ", " +
                    "font_italic = " + this.Italic + ", " +
                    "font_bold = " + this.Bold + ", " +
                    "font_fixed = " + this.Fixed + ", " +
                    "font_serif = " + this.Serif + ", " +
                    "font_fraktur = " + this.Fraktur + ", " +
                    "font_line_height = " + this.LineHeight + " " +
                    "where font_id = " + this.ID);

                if (this.Glyphs != null && IncludeChildren)
                {
                    for (int x = 0; x < this.Glyphs.Count; x++)
                    {
                        this.Glyphs[x].Save(IncludeChildren);
                    }
                }
            }
        }

Usage Example

Exemplo n.º 1
0
        private void saveButton_Click(object sender, EventArgs e)
        {
            myFont.Name       = fontNameBox.Text;
            myFont.LineHeight = System.Convert.ToInt32(fontLineHeightBox.Value);
            myFont.Bold       = System.Convert.ToInt32(fontBoldBox.Checked);
            myFont.Fixed      = System.Convert.ToInt32(fontFixedBox.Checked);
            myFont.Fraktur    = System.Convert.ToInt32(fontFrakturBox.Checked);
            myFont.Italic     = System.Convert.ToInt32(fontItalicBox.Checked);
            myFont.Serif      = System.Convert.ToInt32(fontSerifBox.Checked);

            myFont.Save(false);

            if (SelectedGlyph > -1)
            {
                myFont.Glyphs[SelectedGlyph].Save(false);
            }

            this.Close();
        }
All Usage Examples Of Franken_.App_Code.Font::Save