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
- PerformanceCounterLib.cs
- LowerCaseStringConverter.cs
- GenericNameHandler.cs
- WorkflowFileItem.cs
- WCFBuildProvider.cs
- DialogWindow.cs
- UnaryNode.cs
- DataGridViewComboBoxEditingControl.cs
- FrameworkPropertyMetadata.cs
- InputGestureCollection.cs
- CompressionTransform.cs
- Route.cs
- ConditionValidator.cs
- WithParamAction.cs
- CheckoutException.cs
- GeneralTransformGroup.cs
- VisualTreeHelper.cs
- PersonalizableAttribute.cs
- StrokeFIndices.cs
- BrowserTree.cs
- contentDescriptor.cs
- XmlNamespaceDeclarationsAttribute.cs
- DesigntimeLicenseContext.cs
- EditorBrowsableAttribute.cs
- DataObject.cs
- ScriptingRoleServiceSection.cs
- ChannelManager.cs
- BasicExpressionVisitor.cs
- _CacheStreams.cs
- NativeMethods.cs
- MethodResolver.cs
- Visual3DCollection.cs
- OutputCacheProfileCollection.cs
- MessageQueueInstaller.cs
- MetaModel.cs
- AbstractSvcMapFileLoader.cs
- ListViewAutomationPeer.cs
- HMACSHA1.cs
- ToolStripDesignerUtils.cs
- StrongNameMembershipCondition.cs
- DelegateSerializationHolder.cs
- EncoderNLS.cs
- IpcClientChannel.cs
- KoreanLunisolarCalendar.cs
- ToolTipService.cs
- ThrowHelper.cs
- XsdDateTime.cs
- CodeGenerator.cs
- DataGridViewRowCollection.cs
- FormViewInsertEventArgs.cs
- TreeViewItemAutomationPeer.cs
- AuthenticationModulesSection.cs
- TCPClient.cs
- SpeakCompletedEventArgs.cs
- AutomationAttributeInfo.cs
- DodSequenceMerge.cs
- PackageRelationship.cs
- ProxyWebPartManager.cs
- FixedTextSelectionProcessor.cs
- RepeatInfo.cs
- SqlCacheDependencySection.cs
- DataSet.cs
- TailPinnedEventArgs.cs
- DataColumn.cs
- HtmlProps.cs
- XPathExpr.cs
- MouseEventArgs.cs
- Hashtable.cs
- SR.Designer.cs
- FixedSOMSemanticBox.cs
- WmlMobileTextWriter.cs
- Rect3DConverter.cs
- InlineUIContainer.cs
- ResourcePermissionBaseEntry.cs
- StateMachineWorkflowInstance.cs
- FlowPanelDesigner.cs
- ProgressPage.cs
- PeerCollaborationPermission.cs
- BindingList.cs
- CallTemplateAction.cs
- CollectionsUtil.cs
- SiteOfOriginPart.cs
- HtmlInputFile.cs
- OdbcReferenceCollection.cs
- XmlJsonWriter.cs
- EnglishPluralizationService.cs
- SettingsAttributeDictionary.cs
- XhtmlBasicLinkAdapter.cs
- DataGridRowAutomationPeer.cs
- XmlDocumentViewSchema.cs
- RsaSecurityTokenAuthenticator.cs
- TypeDependencyAttribute.cs
- InputManager.cs
- X509SecurityToken.cs
- DrawingContextDrawingContextWalker.cs
- RenameRuleObjectDialog.cs
- Double.cs
- WindowsGraphicsWrapper.cs
- SelectorAutomationPeer.cs
- MaterializeFromAtom.cs