Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / Compilation / UserControlCodeDomTreeGenerator.cs / 1 / 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);
_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);
_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
- AuthorizationRule.cs
- TextWriterEngine.cs
- Keywords.cs
- Base64Decoder.cs
- NativeMethods.cs
- TagNameToTypeMapper.cs
- Properties.cs
- ObjectDataSourceDisposingEventArgs.cs
- ReachDocumentReferenceSerializerAsync.cs
- ToolStripItemImageRenderEventArgs.cs
- NameValueSectionHandler.cs
- TripleDES.cs
- WarningException.cs
- XmlNodeChangedEventArgs.cs
- XmlEnumAttribute.cs
- UIElement3D.cs
- BrowserDefinition.cs
- JoinElimination.cs
- GridViewDeleteEventArgs.cs
- MediaElement.cs
- ErrorWebPart.cs
- Filter.cs
- BindUriHelper.cs
- SEHException.cs
- RadioButtonPopupAdapter.cs
- SymbolType.cs
- ListViewTableRow.cs
- ValueConversionAttribute.cs
- NativeMethods.cs
- InvalidDataException.cs
- ParsedAttributeCollection.cs
- BatchServiceHost.cs
- WorkflowViewStateService.cs
- HttpResponseWrapper.cs
- PropertyToken.cs
- XmlSchemaParticle.cs
- ByteStream.cs
- ITreeGenerator.cs
- Configuration.cs
- DataGridState.cs
- DefaultDialogButtons.cs
- AnyAllSearchOperator.cs
- ConnectionManagementElementCollection.cs
- DataColumnPropertyDescriptor.cs
- ColumnWidthChangingEvent.cs
- TemplateKeyConverter.cs
- UriTemplateCompoundPathSegment.cs
- SmiMetaData.cs
- SendMailErrorEventArgs.cs
- ReadOnlyDictionary.cs
- MarkupCompiler.cs
- RTLAwareMessageBox.cs
- SecurityElement.cs
- NameValueConfigurationCollection.cs
- DispatcherHooks.cs
- StackSpiller.Bindings.cs
- OleDbWrapper.cs
- VScrollProperties.cs
- PopupControlService.cs
- SiteMapNodeItem.cs
- IdentitySection.cs
- ZipIOLocalFileDataDescriptor.cs
- WebSysDisplayNameAttribute.cs
- XamlTemplateSerializer.cs
- MarkupExtensionParser.cs
- StringStorage.cs
- MatrixAnimationBase.cs
- AliasExpr.cs
- ExpandCollapseProviderWrapper.cs
- ListViewHitTestInfo.cs
- QueryAsyncResult.cs
- ApplicationGesture.cs
- RectangleF.cs
- RandomDelayQueuedSendsAsyncResult.cs
- Vertex.cs
- OrthographicCamera.cs
- NodeFunctions.cs
- IdnElement.cs
- HashStream.cs
- StyleModeStack.cs
- StringInfo.cs
- ExpressionBindingCollection.cs
- TitleStyle.cs
- OutputCacheSettings.cs
- SQLDoubleStorage.cs
- AsyncPostBackErrorEventArgs.cs
- DescendantBaseQuery.cs
- ExceptionUtil.cs
- XamlTemplateSerializer.cs
- ConnectionStringsExpressionBuilder.cs
- XmlSchemaAttributeGroupRef.cs
- dsa.cs
- PolygonHotSpot.cs
- EventSinkHelperWriter.cs
- UnsafeNativeMethods.cs
- ScriptingJsonSerializationSection.cs
- VirtualizingStackPanel.cs
- NavigationProperty.cs
- MetadataException.cs
- InputQueueChannelAcceptor.cs