protected void PersistenceSaved(object sender, PersistenceEventArgs e) { if (e.PersistenceData == null) { return; } // 保持されないコントロール ID をすべてリストします List<string> ignoredControls = new List<string>() { this.control1.ID, this.control2.ID, this.control3.ID }; PersistenceData data = e.PersistenceData; ControlData controlToRemove = null; foreach (string ignoredControlID in ignoredControls) { controlToRemove = data.Controls.Find( delegate(ControlData controlToFind) { return controlToFind.ControlId == ignoredControlID; }); if (controlToRemove != null) { data.Controls.Remove(controlToRemove); controlToRemove = null; } } this.StoredData = data.ToJson(); }