Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Compilation / UserControlCodeDomTreeGenerator.cs / 1305376 / UserControlCodeDomTreeGenerator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Compilation { using System; using System.CodeDom; using System.Web.UI; internal class UserControlCodeDomTreeGenerator : TemplateControlCodeDomTreeGenerator { protected UserControlParser _ucParser; UserControlParser Parser { get { return _ucParser; } } internal UserControlCodeDomTreeGenerator(UserControlParser ucParser) : base(ucParser) { _ucParser = ucParser; } /* * Add metadata attributes to the class */ protected override void GenerateClassAttributes() { base.GenerateClassAttributes(); // If the user control has an OutputCache directive, generate // an attribute with the information about it. if (_sourceDataClass != null && Parser.OutputCacheParameters != null) { OutputCacheParameters cacheSettings = Parser.OutputCacheParameters; if (cacheSettings.Duration > 0) { CodeAttributeDeclaration attribDecl = new CodeAttributeDeclaration( "System.Web.UI.PartialCachingAttribute"); CodeAttributeArgument attribArg = new CodeAttributeArgument( new CodePrimitiveExpression(cacheSettings.Duration)); attribDecl.Arguments.Add(attribArg); attribArg = new CodeAttributeArgument(new CodePrimitiveExpression(cacheSettings.VaryByParam)); attribDecl.Arguments.Add(attribArg); attribArg = new CodeAttributeArgument(new CodePrimitiveExpression(cacheSettings.VaryByControl)); attribDecl.Arguments.Add(attribArg); attribArg = new CodeAttributeArgument(new CodePrimitiveExpression(cacheSettings.VaryByCustom)); attribDecl.Arguments.Add(attribArg); attribArg = new CodeAttributeArgument(new CodePrimitiveExpression(cacheSettings.SqlDependency)); attribDecl.Arguments.Add(attribArg); attribArg = new CodeAttributeArgument(new CodePrimitiveExpression(Parser.FSharedPartialCaching)); attribDecl.Arguments.Add(attribArg); // Use the providerName argument only when targeting 4.0 and above. if (MultiTargetingUtil.IsTargetFramework40OrAbove) { attribArg = new CodeAttributeArgument("ProviderName", new CodePrimitiveExpression(Parser.Provider)); attribDecl.Arguments.Add(attribArg); } _sourceDataClass.CustomAttributes.Add(attribDecl); } } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DoubleKeyFrameCollection.cs
- DesignerObjectListAdapter.cs
- ObservableCollection.cs
- BitmapEffectRenderDataResource.cs
- CollectionsUtil.cs
- OleDbParameterCollection.cs
- MouseActionConverter.cs
- WindowInteractionStateTracker.cs
- ToolStripItemRenderEventArgs.cs
- ListViewItemSelectionChangedEvent.cs
- ParameterBinding.cs
- EpmSyndicationContentSerializer.cs
- FontStretchConverter.cs
- WinFormsSecurity.cs
- WebPartExportVerb.cs
- SuppressMessageAttribute.cs
- NameValuePermission.cs
- TranslateTransform.cs
- LogManagementAsyncResult.cs
- RetrieveVirtualItemEventArgs.cs
- _HeaderInfoTable.cs
- SQLMoney.cs
- ProviderCollection.cs
- EventLogEntry.cs
- WindowsStreamSecurityBindingElement.cs
- SiteMapNodeCollection.cs
- webproxy.cs
- RegexMatch.cs
- GenericTextProperties.cs
- ResourceProviderFactory.cs
- SystemIPv4InterfaceProperties.cs
- RelOps.cs
- ImageAnimator.cs
- DataKey.cs
- Point.cs
- WorkflowApplicationCompletedEventArgs.cs
- ReaderWriterLockWrapper.cs
- EmbossBitmapEffect.cs
- ImageMap.cs
- EventData.cs
- Dictionary.cs
- RealizationDrawingContextWalker.cs
- WarningException.cs
- CollectionViewGroup.cs
- Image.cs
- XmlAnyElementAttribute.cs
- HttpClientProtocol.cs
- SchemaComplexType.cs
- TcpServerChannel.cs
- TargetInvocationException.cs
- DataGridCheckBoxColumn.cs
- NativeMethods.cs
- AuthenticationModuleElement.cs
- IntSecurity.cs
- CallId.cs
- CharStorage.cs
- WSHttpSecurity.cs
- EdmError.cs
- ClientRoleProvider.cs
- CssClassPropertyAttribute.cs
- COM2ExtendedBrowsingHandler.cs
- WebPartDisplayModeEventArgs.cs
- StringTraceRecord.cs
- SafeNativeMethods.cs
- DataGridViewCellValueEventArgs.cs
- XmlSerializerNamespaces.cs
- HtmlTableRowCollection.cs
- MetafileHeaderWmf.cs
- ExpressionVisitor.cs
- TypeGenericEnumerableViewSchema.cs
- SHA1CryptoServiceProvider.cs
- PrePrepareMethodAttribute.cs
- InkCanvas.cs
- Helpers.cs
- ObjectDataSourceView.cs
- SafeSecurityHelper.cs
- NamedPipeChannelFactory.cs
- ListControl.cs
- MessageBox.cs
- EntityDataSourceUtil.cs
- DrawingImage.cs
- InvalidOleVariantTypeException.cs
- StylusPointProperties.cs
- TrackingDataItem.cs
- MembershipPasswordException.cs
- WebPartCancelEventArgs.cs
- KnownTypesProvider.cs
- DefaultAsyncDataDispatcher.cs
- ProjectedWrapper.cs
- HandlerFactoryWrapper.cs
- Light.cs
- XmlAttributeHolder.cs
- RegisteredExpandoAttribute.cs
- MessageBox.cs
- ButtonDesigner.cs
- FileInfo.cs
- BooleanProjectedSlot.cs
- ReflectionServiceProvider.cs
- BaseParser.cs
- MatrixKeyFrameCollection.cs