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
- InvalidPrinterException.cs
- CertificateManager.cs
- Variable.cs
- RegexCaptureCollection.cs
- Camera.cs
- Metadata.cs
- DocumentOrderComparer.cs
- ComplexType.cs
- PtsHost.cs
- DataComponentNameHandler.cs
- AuthenticateEventArgs.cs
- SQLByteStorage.cs
- CodeCompileUnit.cs
- ControllableStoryboardAction.cs
- ByteAnimationUsingKeyFrames.cs
- DataTableExtensions.cs
- XmlTextReader.cs
- UnsafeNativeMethods.cs
- MustUnderstandSoapException.cs
- ToolStripEditorManager.cs
- MetafileHeaderWmf.cs
- RefType.cs
- UIElement.cs
- CookieProtection.cs
- XmlDictionaryReaderQuotasElement.cs
- UserControlCodeDomTreeGenerator.cs
- JoinElimination.cs
- EmptyCollection.cs
- ClientScriptManagerWrapper.cs
- ModelUIElement3D.cs
- WorkflowLayouts.cs
- Color.cs
- DataMisalignedException.cs
- MouseGestureValueSerializer.cs
- InputReport.cs
- _StreamFramer.cs
- SiteOfOriginContainer.cs
- SqlBuffer.cs
- HttpRequest.cs
- OutputCache.cs
- ButtonBase.cs
- IndicShape.cs
- VerticalAlignConverter.cs
- HttpHeaderCollection.cs
- HtmlInputReset.cs
- ComponentConverter.cs
- Keyboard.cs
- BaseTemplateBuildProvider.cs
- documentation.cs
- CollectionViewGroup.cs
- Parser.cs
- MimeTypeAttribute.cs
- TextServicesCompartmentEventSink.cs
- XmlCodeExporter.cs
- SyndicationSerializer.cs
- CodeBlockBuilder.cs
- PrinterUnitConvert.cs
- ContainerControl.cs
- Transform.cs
- FormatterConverter.cs
- CatchDesigner.xaml.cs
- EdmScalarPropertyAttribute.cs
- DefaultPropertiesToSend.cs
- CollectionView.cs
- OleServicesContext.cs
- StringCollectionEditor.cs
- CellPartitioner.cs
- TdsParserSafeHandles.cs
- Solver.cs
- RequestNavigateEventArgs.cs
- RuntimeConfig.cs
- ActiveDocumentEvent.cs
- ExeConfigurationFileMap.cs
- LinqTreeNodeEvaluator.cs
- StatusBarDrawItemEvent.cs
- StylusEventArgs.cs
- VerbConverter.cs
- OracleCommandBuilder.cs
- SelectionPattern.cs
- Scripts.cs
- WebBrowserNavigatingEventHandler.cs
- StrokeNodeOperations.cs
- AnnotationMap.cs
- DaylightTime.cs
- TextProperties.cs
- ListDictionary.cs
- BindingList.cs
- AncestorChangedEventArgs.cs
- DataServiceQueryException.cs
- ValidatingCollection.cs
- ToolBar.cs
- EventLogEntry.cs
- Array.cs
- Pointer.cs
- ItemMap.cs
- Rect3D.cs
- TaskFormBase.cs
- AngleUtil.cs
- safelink.cs
- ServiceX509SecurityTokenProvider.cs