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
- AsmxEndpointPickerExtension.cs
- PointIndependentAnimationStorage.cs
- DbCommandDefinition.cs
- SizeChangedInfo.cs
- XmlDataDocument.cs
- FillRuleValidation.cs
- ContentPropertyAttribute.cs
- RankException.cs
- dtdvalidator.cs
- UniqueIdentifierService.cs
- UserMapPath.cs
- RawStylusInputCustomData.cs
- HttpHandlerActionCollection.cs
- SessionStateModule.cs
- SystemIcmpV6Statistics.cs
- RC2.cs
- SafeMarshalContext.cs
- OnOperation.cs
- Label.cs
- ToolStripPanel.cs
- SqlDataSourceConfigureSortForm.cs
- TransformGroup.cs
- NonParentingControl.cs
- Models.cs
- InputManager.cs
- ListItemsPage.cs
- KeyTime.cs
- WebConfigurationHostFileChange.cs
- CodeNamespaceImport.cs
- Pool.cs
- MetadataItemEmitter.cs
- HelpInfo.cs
- SecurityTokenProviderContainer.cs
- BulletChrome.cs
- WebInvokeAttribute.cs
- ObjectToIdCache.cs
- TreeNodeCollectionEditor.cs
- AtomServiceDocumentSerializer.cs
- SamlAuthenticationStatement.cs
- NameTable.cs
- ViewStateModeByIdAttribute.cs
- WebServiceParameterData.cs
- SqlDataSourceCache.cs
- TraceUtility.cs
- CommunicationException.cs
- ClaimTypes.cs
- Rules.cs
- ChtmlCalendarAdapter.cs
- TypeGeneratedEventArgs.cs
- UnsafeNativeMethods.cs
- Validator.cs
- IdentityNotMappedException.cs
- IntegerValidator.cs
- SafeHandle.cs
- AssemblyAttributesGoHere.cs
- RecordManager.cs
- BitSet.cs
- ListMarkerLine.cs
- DelegatingConfigHost.cs
- DataGridViewRowsRemovedEventArgs.cs
- BuildDependencySet.cs
- TreeViewImageIndexConverter.cs
- LabelLiteral.cs
- AliasedSlot.cs
- DataObjectFieldAttribute.cs
- PictureBox.cs
- WCFServiceClientProxyGenerator.cs
- AutoScrollExpandMessageFilter.cs
- HttpRawResponse.cs
- ColorConverter.cs
- HandleCollector.cs
- CalendarDateChangedEventArgs.cs
- TdsParserSessionPool.cs
- SendActivityDesigner.cs
- Menu.cs
- DependencySource.cs
- BitStack.cs
- ContentFileHelper.cs
- Splitter.cs
- TemplateBindingExtension.cs
- WebServiceResponseDesigner.cs
- QueryInterceptorAttribute.cs
- LogWriteRestartAreaState.cs
- FileDialog.cs
- InProcStateClientManager.cs
- HyperLinkStyle.cs
- SizeAnimation.cs
- BitVec.cs
- ComplexPropertyEntry.cs
- RequestCacheManager.cs
- SoapAttributes.cs
- MemberInfoSerializationHolder.cs
- LeaseManager.cs
- WorkflowOperationAsyncResult.cs
- LineInfo.cs
- ExitEventArgs.cs
- SqlRowUpdatedEvent.cs
- NameValuePermission.cs
- MultiView.cs
- Utils.cs