TesseractTrainer.App_Code.Glyph.Save C# (CSharp) Метод

Save() публичный Метод

public Save ( bool IncludeChildren ) : void
IncludeChildren bool
Результат void
        public void Save(bool IncludeChildren)
        {
            if (this.ID == "")
            {
                this.ID = db.GetNewID("glyphs");
                db.ExecuteCommand("insert into glyphs (glyph_id, glyph_font_id, glyph_unicode, glyph_frequency, glyph_x_offset, glyph_y_offset) values (" + this.ID + ", " + this.FontID + ", '" + db.FixString(this.Unicode) + "', " + this.Frequency + ", " + this.XOffset + ", " + this.YOffset + ")");
            }
            else
            {
                db.ExecuteCommand("update glyphs set glyph_font_id = " + this.FontID + ", " +
                    "glyph_unicode = '" + db.FixString(this.Unicode) + "', " +
                    "glyph_frequency = " + this.Frequency + ", " +
                    "glyph_x_offset = " + this.XOffset + ", " +
                    "glyph_y_offset = " + this.YOffset + " " +
                    "where glyph_id = " + this.ID);

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

Usage Example

Пример #1
0
 public string AddEmptyGlyph(string Unicode)
 {
     Glyph G = new Glyph();
     G.FontID = this.ID;
     G.Unicode = Unicode;
     G.Save(false);
     return G.ID;
 }
All Usage Examples Of TesseractTrainer.App_Code.Glyph::Save