/// <devdoc> /// Prepares this ControlBuilder and all of it's subbuilders for /// use in no-compile pages (minimizing the memory usage). /// This makes the use of all parse-time properties invalid. /// </devdoc> internal virtual void PrepareNoCompilePageSupport() { // Clear out all the flags and cached data from parse time flags[parseComplete] = true; _parseTimeData = null; // Remove any property entry lists that aren't being used if ((_eventEntries != null) && (_eventEntries.Count == 0)) { _eventEntries = null; } if ((_simplePropertyEntries != null) && (_simplePropertyEntries.Count == 0)) { _simplePropertyEntries = null; } if (_complexPropertyEntries != null) { if (_complexPropertyEntries.Count == 0) { _complexPropertyEntries = null; } else { foreach (BuilderPropertyEntry entry in _complexPropertyEntries) { if (entry.Builder != null) entry.Builder.PrepareNoCompilePageSupport(); } } } if (_templatePropertyEntries != null) { if (_templatePropertyEntries.Count == 0) { _templatePropertyEntries = null; } else { foreach (BuilderPropertyEntry entry in _templatePropertyEntries) { if (entry.Builder != null) entry.Builder.PrepareNoCompilePageSupport(); } } } if ((_boundPropertyEntries != null) && (_boundPropertyEntries.Count == 0)) { _boundPropertyEntries = null; } if (_subBuilders != null) { if (_subBuilders.Count > 0) { foreach (Object builderObj in _subBuilders) { ControlBuilder builder = builderObj as ControlBuilder; if (builder != null) builder.PrepareNoCompilePageSupport(); } } else { _subBuilders = null; } } // Sort the entry here to make sure we don't run into a race condition if we try to // do it later on demand (VSWhidbey 551431) EnsureEntriesSorted(); }
internal virtual void PrepareNoCompilePageSupport() { this.flags[1] = true; this._parseTimeData = null; if ((this._eventEntries != null) && (this._eventEntries.Count == 0)) { this._eventEntries = null; } if ((this._simplePropertyEntries != null) && (this._simplePropertyEntries.Count == 0)) { this._simplePropertyEntries = null; } if (this._complexPropertyEntries != null) { if (this._complexPropertyEntries.Count == 0) { this._complexPropertyEntries = null; } else { foreach (BuilderPropertyEntry entry in this._complexPropertyEntries) { if (entry.Builder != null) { entry.Builder.PrepareNoCompilePageSupport(); } } } } if (this._templatePropertyEntries != null) { if (this._templatePropertyEntries.Count == 0) { this._templatePropertyEntries = null; } else { foreach (BuilderPropertyEntry entry2 in this._templatePropertyEntries) { if (entry2.Builder != null) { entry2.Builder.PrepareNoCompilePageSupport(); } } } } if ((this._boundPropertyEntries != null) && (this._boundPropertyEntries.Count == 0)) { this._boundPropertyEntries = null; } if (this._subBuilders != null) { if (this._subBuilders.Count > 0) { foreach (object obj2 in this._subBuilders) { ControlBuilder builder = obj2 as ControlBuilder; if (builder != null) { builder.PrepareNoCompilePageSupport(); } } } else { this._subBuilders = null; } } this.EnsureEntriesSorted(); }