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
- MessageTransmitTraceRecord.cs
- ItemChangedEventArgs.cs
- BitVec.cs
- DataGridBoolColumn.cs
- Helper.cs
- ProcessHostMapPath.cs
- WebPartManager.cs
- MessageBuffer.cs
- Helper.cs
- ParameterReplacerVisitor.cs
- ServiceModelSectionGroup.cs
- StaticFileHandler.cs
- SecurityPermission.cs
- PersonalizablePropertyEntry.cs
- WindowsHyperlink.cs
- XmlCompatibilityReader.cs
- DynamicQueryableWrapper.cs
- DecimalConstantAttribute.cs
- ComplexLine.cs
- Invariant.cs
- Model3D.cs
- ManipulationInertiaStartingEventArgs.cs
- TreeNodeSelectionProcessor.cs
- XhtmlCssHandler.cs
- FunctionQuery.cs
- ServiceTimeoutsBehavior.cs
- GAC.cs
- WebPartConnectionsDisconnectVerb.cs
- ZipIOBlockManager.cs
- MdImport.cs
- BrowserCapabilitiesCompiler.cs
- SettingsBindableAttribute.cs
- SpanIndex.cs
- DataServices.cs
- PageContent.cs
- SectionInput.cs
- DesignerForm.cs
- CompilerInfo.cs
- PostBackTrigger.cs
- Popup.cs
- MappingException.cs
- ReachFixedPageSerializerAsync.cs
- AttributeCollection.cs
- RijndaelManagedTransform.cs
- CancellationState.cs
- EncodingInfo.cs
- TreeNodeEventArgs.cs
- HitTestResult.cs
- SystemDropShadowChrome.cs
- FamilyTypeface.cs
- LiteralSubsegment.cs
- MappingModelBuildProvider.cs
- PackWebRequest.cs
- ClientSettingsProvider.cs
- TypeToStringValueConverter.cs
- WaitHandleCannotBeOpenedException.cs
- ToolboxBitmapAttribute.cs
- CheckBoxFlatAdapter.cs
- FileChangesMonitor.cs
- ImmutableObjectAttribute.cs
- ClusterSafeNativeMethods.cs
- HashCodeCombiner.cs
- TextTreeTextNode.cs
- TextOutput.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- SocketCache.cs
- PropertyMetadata.cs
- BrushConverter.cs
- SoapInteropTypes.cs
- XmlIlVisitor.cs
- SynchronizationValidator.cs
- XmlSchemaSequence.cs
- RuleInfoComparer.cs
- TextBox.cs
- ToolZone.cs
- DesignerRegionCollection.cs
- PrinterResolution.cs
- MemoryFailPoint.cs
- DelegateArgumentValue.cs
- ButtonStandardAdapter.cs
- ByteFacetDescriptionElement.cs
- DataRowComparer.cs
- ImageButton.cs
- MobileDeviceCapabilitiesSectionHandler.cs
- ToolStripGripRenderEventArgs.cs
- OutputCacheModule.cs
- SmtpNtlmAuthenticationModule.cs
- OleDbMetaDataFactory.cs
- BasicExpandProvider.cs
- EntityDescriptor.cs
- SingleObjectCollection.cs
- DataListCommandEventArgs.cs
- TerminateWorkflow.cs
- ComAwareEventInfo.cs
- DbModificationClause.cs
- MetadataItem.cs
- PrintingPermissionAttribute.cs
- ReadWriteSpinLock.cs
- RegionIterator.cs
- SimplePropertyEntry.cs