Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ //// 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
- DesigntimeLicenseContextSerializer.cs
- PeerName.cs
- PointF.cs
- TimeSpanStorage.cs
- SapiRecoContext.cs
- HtmlInputControl.cs
- MediaPlayerState.cs
- EncryptedKeyIdentifierClause.cs
- XmlNamedNodeMap.cs
- CompiledELinqQueryState.cs
- ResourceDescriptionAttribute.cs
- FtpRequestCacheValidator.cs
- Helper.cs
- QilVisitor.cs
- AssociationTypeEmitter.cs
- WindowsScrollBarBits.cs
- HTMLTextWriter.cs
- InteropAutomationProvider.cs
- UrlMappingsSection.cs
- SharedPersonalizationStateInfo.cs
- ProxyHwnd.cs
- PageCache.cs
- ToolStripMenuItemDesigner.cs
- TextEditorParagraphs.cs
- DataSourceConverter.cs
- HtmlInputSubmit.cs
- HtmlInputFile.cs
- BitStack.cs
- PeerNameResolver.cs
- XamlTreeBuilder.cs
- CanExecuteRoutedEventArgs.cs
- SocketPermission.cs
- SqlGenericUtil.cs
- XmlTypeMapping.cs
- HttpProcessUtility.cs
- XmlArrayItemAttributes.cs
- ListViewGroup.cs
- SeekStoryboard.cs
- TemplateControlParser.cs
- CapabilitiesRule.cs
- RC2CryptoServiceProvider.cs
- WebEvents.cs
- TabControl.cs
- SerializationException.cs
- TypeBuilderInstantiation.cs
- XPathAncestorIterator.cs
- HttpClientCertificate.cs
- ChtmlTextWriter.cs
- TextParaLineResult.cs
- PolicyStatement.cs
- Int32Rect.cs
- SmtpNegotiateAuthenticationModule.cs
- XmlSchemaDocumentation.cs
- HierarchicalDataSourceControl.cs
- HttpConfigurationSystem.cs
- RegularExpressionValidator.cs
- ExpressionWriter.cs
- CurrentTimeZone.cs
- ProtocolsSection.cs
- SafeSystemMetrics.cs
- XsltOutput.cs
- NativeMethods.cs
- ConfigurationSchemaErrors.cs
- FactoryGenerator.cs
- StylusShape.cs
- SID.cs
- ReturnValue.cs
- altserialization.cs
- ButtonColumn.cs
- ImageBrush.cs
- ConstraintStruct.cs
- XsdCachingReader.cs
- ChannelTracker.cs
- NativeMethods.cs
- AutomationIdentifierGuids.cs
- SingleAnimationBase.cs
- GC.cs
- SHA512.cs
- WindowsEditBox.cs
- LayoutManager.cs
- FigureHelper.cs
- KeyValuePair.cs
- ThumbAutomationPeer.cs
- CodeVariableDeclarationStatement.cs
- ActivationService.cs
- ParseElement.cs
- DocumentViewer.cs
- SynchronousChannelMergeEnumerator.cs
- SolidColorBrush.cs
- ToolboxComponentsCreatedEventArgs.cs
- InstanceLockQueryResult.cs
- Buffer.cs
- RuntimeHandles.cs
- ShapingEngine.cs
- DictationGrammar.cs
- ExceptionUtil.cs
- UrlPath.cs
- PolicyImporterElement.cs
- SmiContext.cs
- Assert.cs