///-------------------------------------------------------------------------------- /// <summary>This method disposes of resources in the model.</summary> ///-------------------------------------------------------------------------------- protected override void OnDispose() { if (ReverseInstance != null) { ReverseInstance.Dispose(); ReverseInstance = null; } if (ForwardInstance != null) { ForwardInstance.Dispose(); ForwardInstance = null; } Entity = null; Solution = null; if (_stateList != null) { foreach (State item in StateList) { item.Dispose(); } StateList.Clear(); StateList = null; } #region protected #endregion protected base.OnDispose(); }
public void AddToList(string item) { int i; StateList.Clear(); for (i = 0; i < StateNames.Count; i++) { if (StateNames[i].country == item) { StateList.Add(new States { country = StateNames[i].state, state = StateNames[i].state }); } } }