public void Copy(GeneralSetting setting) { _leftGPIO = setting._leftGPIO; _righGPIO = setting._righGPIO; _modbusCOM = setting._modbusCOM; _mainInput = setting._mainInput; _mainOutput = setting._mainOutput; _leftInput = setting._leftInput; _leftOutput = setting._leftOutput; _righInput = setting._righInput; _righOutput = setting._righOutput; _logLevel = setting._logLevel; _theme = setting._theme; _isWindowMax = setting._isWindowMax; _isAutoStart = setting._isAutoStart; _users.Clear(); foreach (var user in setting._users) { _users.Add(user); } }
public object Clone() { var rVal = new GeneralSetting(); rVal._leftGPIO = _leftGPIO; rVal._righGPIO = _righGPIO; rVal._modbusCOM = _modbusCOM; rVal._mainInput = _mainInput; rVal._mainOutput = _mainOutput; rVal._leftInput = _leftInput; rVal._leftOutput = _leftOutput; rVal._righInput = _righInput; rVal._righOutput = _righOutput; rVal._logLevel = _logLevel; rVal._theme = _theme; rVal._isWindowMax = _isWindowMax; rVal._isAutoStart = _isAutoStart; foreach (var user in _users) { rVal._users.Add(user); } return(rVal); }