public SettingsBool Append(Guid id_item, SettingsBool value)
        {
            value.ID_Item = id_item;

            using (var db = this._db.Open())
            {
                return(db.Query <SettingsBool>(SQL_CREATE, value).First());
            }
        }
示例#2
0
    private SettingsBool[] SettingsBoolArray;                                                //SettingsBool Array to store the data in
    private void InitaliseBoolSettings()                                                     //Init the bool settings (set default values)
    {
        bool[] DefSetting = new bool[JelleWho.BoolSettingsLength];                           //Gets all default settings out of the int (every bit of the INT is now returned as BOOL[#])
        int    X          = 1;                                                               //Set the first bit to read to be bit 1

        for (int i = 0; i < DefSetting.Length; i++)                                          //For each entry in the array
        {
            if ((PlayerPrefs.GetInt("BoolSettings", JelleWho.BoolSettingsDefault) & X) == X) //Read the bit
            {
                DefSetting[i] = true;                                                        //Set this one as true
            }
            else
            {
                DefSetting[i] = false;                                                                            //Set this one as false
            }
            X *= 2;                                                                                               //Select the next bit
        }
        int TotalSettingsBool = JelleWho.BoolSettingsLength;                                                      //The total amount of entries, change accordingly in the "PublicCode"

        SettingsBoolArray    = new SettingsBool[TotalSettingsBool];                                               //Create a new array with the proper length
        SettingsBoolArray[0] = new SettingsBool("EdgeScroll", DefSetting[0], "Turn mouse on edge scroll on/off"); //Add some data
        SettingsBoolArray[1] = new SettingsBool("Option", DefSetting[1], "Description");
    }