예제 #1
0
        public void SaveOptions()
        {
            DataTable tbl = XML_Processing.GetTable(path);
            DataRow   r   = tbl.Rows[0];

            r["CELLSIZE"]   = this._CellSize;
            r["PIECESIZE"]  = this._PieceSize;
            r["BOARDSTYLE"] = (int)this._BoardStyle;
            r["PIECESTYLE"] = (int)this._PieceStyle;
            r["PLAYSOUND"]  = this._PlaySound;

            tbl.WriteXml(path);
        }
예제 #2
0
 public void LoadOptions()
 {
     if (File.Exists(path) == false)
     {
         XML_Processing.CreateNewOptions(path);
         SaveOptions();
     }
     else
     {
         DataTable tbl = XML_Processing.GetTable(path);
         DataRow   r   = tbl.Rows[0];
         this._CellSize   = Convert.ToInt32(r["CELLSIZE"]);
         this._PieceSize  = Convert.ToInt32(r["PIECESIZE"]);
         this._BoardStyle = (eChessBoardStyle)Convert.ToInt32(r["BOARDSTYLE"]);
         this._PieceStyle = (eChessPieceStyle)Convert.ToInt32(r["PIECESTYLE"]);
         this._PlaySound  = Convert.ToBoolean(r["PLAYSOUND"]);
     }
 }