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
- HtmlProps.cs
- ConnectionManagementElementCollection.cs
- MetadataCache.cs
- CompilerHelpers.cs
- TypeUtil.cs
- ProfileManager.cs
- PersonalizationAdministration.cs
- GZipStream.cs
- DataGridViewTextBoxEditingControl.cs
- ScrollPattern.cs
- ProcessStartInfo.cs
- oledbmetadatacolumnnames.cs
- ItemsPanelTemplate.cs
- TextDecorations.cs
- SoapFault.cs
- InstancePersistenceCommand.cs
- SQLInt16.cs
- IndexedSelectQueryOperator.cs
- PatternMatcher.cs
- CompiledXpathExpr.cs
- CharacterBufferReference.cs
- XmlUtil.cs
- DataGridCaption.cs
- ComNativeDescriptor.cs
- StreamHelper.cs
- SplitterEvent.cs
- RoutedEventConverter.cs
- SectionRecord.cs
- Evidence.cs
- RangeContentEnumerator.cs
- SchemaManager.cs
- MsmqIntegrationOutputChannel.cs
- BulletedList.cs
- RemotingException.cs
- SqlFunctionAttribute.cs
- SmtpDigestAuthenticationModule.cs
- ToolBar.cs
- ListBindableAttribute.cs
- MaskInputRejectedEventArgs.cs
- ReturnEventArgs.cs
- DmlSqlGenerator.cs
- DateTimeValueSerializerContext.cs
- Double.cs
- SingleConverter.cs
- SoapSchemaMember.cs
- ManagedCodeMarkers.cs
- ReflectPropertyDescriptor.cs
- PasswordBox.cs
- _CookieModule.cs
- AdRotator.cs
- LocationChangedEventArgs.cs
- OracleInfoMessageEventArgs.cs
- DataGridViewButtonColumn.cs
- TextHintingModeValidation.cs
- HScrollProperties.cs
- PagesSection.cs
- ExpressionEditorAttribute.cs
- ShaderRenderModeValidation.cs
- DataGridViewCellConverter.cs
- BooleanExpr.cs
- SqlInternalConnection.cs
- AnnotationComponentChooser.cs
- OpenTypeMethods.cs
- IntellisenseTextBox.cs
- FunctionImportElement.cs
- ComplexBindingPropertiesAttribute.cs
- RenderOptions.cs
- TabItemAutomationPeer.cs
- PropertyChangingEventArgs.cs
- SqlCacheDependencySection.cs
- ChangePassword.cs
- DataTableMappingCollection.cs
- DBDataPermissionAttribute.cs
- WebDisplayNameAttribute.cs
- GridItemPattern.cs
- DataServiceHostWrapper.cs
- HttpClientCertificate.cs
- PageEventArgs.cs
- BindingEntityInfo.cs
- ToolStripItemGlyph.cs
- MultipleFilterMatchesException.cs
- InnerItemCollectionView.cs
- InputBinding.cs
- InkCanvasFeedbackAdorner.cs
- DbTransaction.cs
- Size.cs
- OptionUsage.cs
- Menu.cs
- PackagePart.cs
- SettingsProperty.cs
- RegexCaptureCollection.cs
- ClaimTypes.cs
- MatrixAnimationUsingPath.cs
- CodeGenerator.cs
- OdbcParameterCollection.cs
- WebPartTransformerAttribute.cs
- _AutoWebProxyScriptHelper.cs
- LocalFileSettingsProvider.cs
- EdgeModeValidation.cs
- DiagnosticTrace.cs