Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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);
}
}
}
}
}
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ReliabilityContractAttribute.cs
- SoapMessage.cs
- ReaderContextStackData.cs
- PropertyRecord.cs
- CodeValidator.cs
- _NestedSingleAsyncResult.cs
- TableColumn.cs
- SessionParameter.cs
- SqlClientWrapperSmiStreamChars.cs
- CoreSwitches.cs
- translator.cs
- WorkflowDesigner.cs
- ConstraintEnumerator.cs
- StateManager.cs
- XmlSchemaFacet.cs
- GPRECTF.cs
- TypeSystem.cs
- AutoGeneratedField.cs
- ProgressBarHighlightConverter.cs
- PackageRelationship.cs
- SQLBoolean.cs
- FamilyMapCollection.cs
- SerializationAttributes.cs
- SmtpFailedRecipientException.cs
- ComponentChangedEvent.cs
- SQLInt16.cs
- HttpRawResponse.cs
- ApplicationServicesHostFactory.cs
- SafeTimerHandle.cs
- LayoutTable.cs
- IdentityManager.cs
- CodeDOMUtility.cs
- SessionStateSection.cs
- RightsManagementErrorHandler.cs
- BaseValidatorDesigner.cs
- Gdiplus.cs
- ListBindingHelper.cs
- MetadataUtil.cs
- ProcessHostMapPath.cs
- DispatcherOperation.cs
- ModelPropertyImpl.cs
- ServiceDescriptionContext.cs
- Range.cs
- XmlSchemaCollection.cs
- ListParaClient.cs
- ParameterReplacerVisitor.cs
- MatchAttribute.cs
- Vector3DConverter.cs
- XPathNodePointer.cs
- Splitter.cs
- ShortcutKeysEditor.cs
- SystemTcpStatistics.cs
- WebServiceFault.cs
- GenerateScriptTypeAttribute.cs
- PropertyDescriptorComparer.cs
- TypedElement.cs
- BinaryParser.cs
- Axis.cs
- BypassElement.cs
- WebEvents.cs
- Int32Rect.cs
- LogEntryDeserializer.cs
- ImageKeyConverter.cs
- ChannelCacheDefaults.cs
- IsolationInterop.cs
- LinqDataSourceSelectEventArgs.cs
- ActivityInstanceMap.cs
- KeyProperty.cs
- EntityDesignerBuildProvider.cs
- DataRowComparer.cs
- DockingAttribute.cs
- SecureEnvironment.cs
- Select.cs
- TextEffect.cs
- XPathItem.cs
- DataServiceClientException.cs
- FrameDimension.cs
- MimeParameterWriter.cs
- ChangePassword.cs
- SerializableAttribute.cs
- Geometry.cs
- OleServicesContext.cs
- UiaCoreApi.cs
- RawStylusInputCustomDataList.cs
- ErrorRuntimeConfig.cs
- ClockGroup.cs
- Attribute.cs
- FileStream.cs
- SmtpMail.cs
- EventDescriptor.cs
- DataGridViewButtonCell.cs
- Point4DValueSerializer.cs
- TargetParameterCountException.cs
- HuffmanTree.cs
- ImageKeyConverter.cs
- WebMessageFormatHelper.cs
- DesignerCategoryAttribute.cs
- FormViewPagerRow.cs
- IndependentAnimationStorage.cs
- FixedBufferAttribute.cs