using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BatCharging.Model { /// /// 远程开始充电结果 /// public class ResultRemoteStartCharging { private object lockObj = new object(); //线程同步锁 private bool _haveres; /// /// 云平台有回复 /// public bool F_HaveRes { get { return _haveres; // 返回一般不需要锁,.net可以保证操作的原子性 } set { lock (lockObj) { _haveres = value; } } } private RemoteStartCharging _start_charging; /// // 远程开始充电 /// public RemoteStartCharging F_RemoteStartCharging { get { return _start_charging; } set { lock (lockObj) { _start_charging = value; } } } private RemoteStartChargingRes _start_charging_res; /// // 远程开始充电 /// public RemoteStartChargingRes F_RemoteStartChargingRes { get { return _start_charging_res; } set { lock (lockObj) { _start_charging_res = value; } } } private StartChargingFinishedRes _start_charging_finished_res; /// // 远程充电完成 /// public StartChargingFinishedRes F_StartChargingFinishedRes { get { return _start_charging_finished_res; } set { lock (lockObj) { _start_charging_finished_res = value; } } } } }