protected void RemoveInstanceCore <TInstance>(string extName) { var cell = StateCells.FirstOrDefault(p => p.InstanceType == typeof(TInstance) && p.ExtName == extName); if (cell != null) { StateCells.Remove(cell); } }
protected void SetInstanceCore <TInstance>(TInstance instance, string extName) { var cell = StateCells.FirstOrDefault(p => p.InstanceType == typeof(TInstance) && p.ExtName == extName); if (cell != null) { cell.Instance = instance; } else { StateCells.Add(new InstanceCell(typeof(TInstance)) { Instance = instance, ExtName = extName }); } }