private void initializeObj() { _adjacentPads = new AdjacentPad[_topicListCount]; for (int i = 0; i < _topicListCount; i++) { _adjacentPads[i] = new AdjacentPad((i + 1).ToString(), AdjacentPadTopic.Unknown, AdjacentPadTopic.Unknown); } }
public void Load(string section, SettingsXml xml) { bool endloop = false; int index = 0; int totalPadCount = 0; // Initial pad list count in-case first time recipe modify by manual if (_adjacentPads.Length == 0) { _adjacentPads = new AdjacentPad[999]; for (int i = 0; i < 999; i++) { _adjacentPads[i] = new AdjacentPad((i + 1).ToString(), AdjacentPadTopic.Unknown, AdjacentPadTopic.Unknown); } do { totalPadCount++; _adjacentPads[index].Load(section, xml); if ((string.IsNullOrEmpty(_adjacentPads[index].ColTopic)) && (string.IsNullOrEmpty(_adjacentPads[index].RowTopic))) { totalPadCount--; _topicListCount = totalPadCount; endloop = true; } index++; } while (!endloop); initializeObj(); } //Load normal for (int i = 0; i < _topicListCount; i++) { _adjacentPads[i].Load(section, xml); } }