Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / Compilation / MasterPageCodeDomTreeGenerator.cs / 1 / MasterPageCodeDomTreeGenerator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Compilation { using System; using System.CodeDom; using System.Globalization; using System.Web.UI; internal class MasterPageCodeDomTreeGenerator : TemplateControlCodeDomTreeGenerator { private const string _masterPropertyName = "Master"; protected MasterPageParser _masterPageParser; MasterPageParser Parser { get { return _masterPageParser; } } internal MasterPageCodeDomTreeGenerator(MasterPageParser parser) : base(parser) { _masterPageParser = parser; } protected override void BuildDefaultConstructor() { base.BuildDefaultConstructor(); foreach(string placeHolderID in Parser.PlaceHolderList) { BuildAddContentPlaceHolderNames(_ctor, placeHolderID); } } private void BuildAddContentPlaceHolderNames(CodeMemberMethod method, string placeHolderID) { CodePropertyReferenceExpression propertyExpr = new CodePropertyReferenceExpression(new CodeThisReferenceExpression(), "ContentPlaceHolders"); CodeExpressionStatement stmt = new CodeExpressionStatement(); stmt.Expression = new CodeMethodInvokeExpression(propertyExpr, "Add", new CodePrimitiveExpression(placeHolderID.ToLower(CultureInfo.InvariantCulture))); method.Statements.Add(stmt); } protected override void BuildMiscClassMembers() { base.BuildMiscClassMembers(); if (Parser.MasterPageType != null) BuildStronglyTypedProperty(_masterPropertyName, Parser.MasterPageType); } } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PointHitTestResult.cs
- LinqDataSourceHelper.cs
- TypeSystem.cs
- TraceAsyncResult.cs
- DateTimePicker.cs
- MissingFieldException.cs
- ArrayWithOffset.cs
- M3DUtil.cs
- DetailsViewRowCollection.cs
- Facet.cs
- ValidationPropertyAttribute.cs
- AstTree.cs
- AuthenticationService.cs
- DateTimeFormatInfo.cs
- XamlPoint3DCollectionSerializer.cs
- PolyQuadraticBezierSegment.cs
- PropagatorResult.cs
- TemplateBindingExtensionConverter.cs
- ProxyAttribute.cs
- WebBrowserEvent.cs
- NodeFunctions.cs
- SpellerStatusTable.cs
- Error.cs
- HtmlTextArea.cs
- DesignerForm.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- AttachInfo.cs
- EndEvent.cs
- PartialList.cs
- DeclarativeCatalogPart.cs
- FontStyles.cs
- ObjectDisposedException.cs
- AuthenticationModeHelper.cs
- ConvertEvent.cs
- ThreadSafeList.cs
- ParameterToken.cs
- Int16Storage.cs
- ThousandthOfEmRealPoints.cs
- StructuredTypeEmitter.cs
- HierarchicalDataSourceControl.cs
- ParseHttpDate.cs
- SafeProcessHandle.cs
- NumericUpDown.cs
- TokenizerHelper.cs
- MultiPropertyDescriptorGridEntry.cs
- XMLSchema.cs
- ConnectionProviderAttribute.cs
- ContentPresenter.cs
- ActionItem.cs
- CheckPair.cs
- ButtonAutomationPeer.cs
- RedirectionProxy.cs
- HyperLinkDataBindingHandler.cs
- HtmlElementEventArgs.cs
- Model3DGroup.cs
- CompilationSection.cs
- IndentedTextWriter.cs
- StreamSecurityUpgradeAcceptorAsyncResult.cs
- PageThemeBuildProvider.cs
- UnsafeNativeMethods.cs
- LiteralLink.cs
- DataStreamFromComStream.cs
- ResXResourceReader.cs
- DataGridViewCellLinkedList.cs
- Filter.cs
- SoapObjectWriter.cs
- ToolStripCustomTypeDescriptor.cs
- MenuEventArgs.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- MessagePropertyVariants.cs
- PerfService.cs
- Compilation.cs
- ListViewInsertedEventArgs.cs
- DataTemplate.cs
- PersistenceProviderBehavior.cs
- EventSourceCreationData.cs
- DESCryptoServiceProvider.cs
- AnimationClock.cs
- Hex.cs
- ServiceChannelFactory.cs
- Binding.cs
- RequestResizeEvent.cs
- HtmlLinkAdapter.cs
- RijndaelManaged.cs
- LambdaCompiler.ControlFlow.cs
- DescendantQuery.cs
- StatusBarPanel.cs
- SqlMethodAttribute.cs
- ExecutionContext.cs
- ResourceCategoryAttribute.cs
- CFStream.cs
- ValueTypeFixupInfo.cs
- ToolStripItemDataObject.cs
- ViewValidator.cs
- WebPartDisplayMode.cs
- Point4DValueSerializer.cs
- AdRotatorDesigner.cs
- ToolStripSeparatorRenderEventArgs.cs
- CodeArrayCreateExpression.cs
- GroupQuery.cs