private Variable Toggle(IClient client, bool?state) { Items.LogVar variable = client.GetLogVar(_id); bool newState = state ?? !variable.State; variable.State = newState; return(Variable.Create(variable).WithState(newState)); }
internal static Variable Create(Items.LogVar variable) => new Variable( id: variable.Index, name: variable.Name, state: variable.State);