Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / WebControls / AutoGeneratedFieldProperties.cs / 1305376 / AutoGeneratedFieldProperties.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.ComponentModel; using System.Reflection; using System.Web.Util; ////// public sealed class AutoGeneratedFieldProperties : IStateManager { private bool _isTracking; private StateBag _statebag; public AutoGeneratedFieldProperties() { _statebag = new StateBag(); } public string DataField { get { object o = ViewState["DataField"]; if (o != null) { return (string)o; } return String.Empty; } set { ViewState["DataField"] = value; } } public bool IsReadOnly { get { object o = ViewState["IsReadOnly"]; if (o != null) { return (bool)o; } return false; } set { ViewState["IsReadOnly"] = value; } } public string Name { get { object o = ViewState["Name"]; if (o != null) { return (string)o; } return String.Empty; } set { ViewState["Name"] = value; } } public Type Type { get { object o = ViewState["Type"]; if (o != null) { return (Type)o; } return null; } set { ViewState["Type"] = value; } } ////// Stores the properties for an AutoGeneratedField. /// ////// private StateBag ViewState { get { return _statebag; } } #region IStateManager implementation ///Gets the statebag for the AutoGeneratedFieldProperties. This property is read-only. ///bool IStateManager.IsTrackingViewState { get { return _isTracking; } } /// void IStateManager.LoadViewState(object state) { if (state != null) { ((IStateManager)ViewState).LoadViewState(state); } } /// object IStateManager.SaveViewState() { object state = ((IStateManager)ViewState).SaveViewState(); return state; } /// void IStateManager.TrackViewState() { _isTracking = true; ViewState.TrackViewState(); } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.ComponentModel; using System.Reflection; using System.Web.Util; ////// public sealed class AutoGeneratedFieldProperties : IStateManager { private bool _isTracking; private StateBag _statebag; public AutoGeneratedFieldProperties() { _statebag = new StateBag(); } public string DataField { get { object o = ViewState["DataField"]; if (o != null) { return (string)o; } return String.Empty; } set { ViewState["DataField"] = value; } } public bool IsReadOnly { get { object o = ViewState["IsReadOnly"]; if (o != null) { return (bool)o; } return false; } set { ViewState["IsReadOnly"] = value; } } public string Name { get { object o = ViewState["Name"]; if (o != null) { return (string)o; } return String.Empty; } set { ViewState["Name"] = value; } } public Type Type { get { object o = ViewState["Type"]; if (o != null) { return (Type)o; } return null; } set { ViewState["Type"] = value; } } ////// Stores the properties for an AutoGeneratedField. /// ////// private StateBag ViewState { get { return _statebag; } } #region IStateManager implementation ///Gets the statebag for the AutoGeneratedFieldProperties. This property is read-only. ///bool IStateManager.IsTrackingViewState { get { return _isTracking; } } /// void IStateManager.LoadViewState(object state) { if (state != null) { ((IStateManager)ViewState).LoadViewState(state); } } /// object IStateManager.SaveViewState() { object state = ((IStateManager)ViewState).SaveViewState(); return state; } /// void IStateManager.TrackViewState() { _isTracking = true; ViewState.TrackViewState(); } #endregion } } // 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
- TypedOperationInfo.cs
- RuntimeConfig.cs
- UIPermission.cs
- TreeNodeBinding.cs
- TextParagraphCache.cs
- EventDescriptorCollection.cs
- XmlSchemaSimpleTypeList.cs
- ListControl.cs
- FilteredSchemaElementLookUpTable.cs
- DataServiceRequestOfT.cs
- UnknownWrapper.cs
- DataRowChangeEvent.cs
- XmlSchemaInferenceException.cs
- ProtocolsConfiguration.cs
- ListBindableAttribute.cs
- Int64Storage.cs
- CodeTypeReferenceCollection.cs
- GuidConverter.cs
- DefaultPrintController.cs
- KeyPressEvent.cs
- Label.cs
- SequenceDesigner.xaml.cs
- EventlogProvider.cs
- ByteStack.cs
- PropertyDescriptorGridEntry.cs
- COMException.cs
- PointAnimationUsingKeyFrames.cs
- IisTraceListener.cs
- ServiceModelActivity.cs
- GeneralTransformGroup.cs
- AssociativeAggregationOperator.cs
- TreeBuilderXamlTranslator.cs
- PerformanceCounterCategory.cs
- dataprotectionpermissionattribute.cs
- SettingsProviderCollection.cs
- WebPartDeleteVerb.cs
- PeerApplication.cs
- Rotation3DAnimation.cs
- SupportsEventValidationAttribute.cs
- InheritedPropertyChangedEventArgs.cs
- LogicalExpressionEditor.cs
- ResolvedKeyFrameEntry.cs
- IsolatedStorageFilePermission.cs
- ExceptionHandlersDesigner.cs
- WithParamAction.cs
- ProviderUtil.cs
- XmlSchemaParticle.cs
- AsymmetricCryptoHandle.cs
- XmlQualifiedName.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- Animatable.cs
- QilTypeChecker.cs
- SoapHeader.cs
- ThreadExceptionDialog.cs
- DataStorage.cs
- HttpProfileBase.cs
- ColorInterpolationModeValidation.cs
- SpeechAudioFormatInfo.cs
- StrokeCollectionDefaultValueFactory.cs
- Evidence.cs
- UndoManager.cs
- SimplePropertyEntry.cs
- DesignerForm.cs
- DataBoundLiteralControl.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- DelegatingChannelListener.cs
- DefaultTextStoreTextComposition.cs
- PathFigureCollection.cs
- ManipulationDevice.cs
- DataGridViewCellStyleChangedEventArgs.cs
- SqlBooleanizer.cs
- GorillaCodec.cs
- StrongNameKeyPair.cs
- SBCSCodePageEncoding.cs
- TextTreeObjectNode.cs
- ProcessModelInfo.cs
- InputLangChangeEvent.cs
- SerializationEventsCache.cs
- XmlFormatExtensionPointAttribute.cs
- Cell.cs
- CodeAttributeDeclarationCollection.cs
- FixedSchema.cs
- TypeElementCollection.cs
- ActiveXHost.cs
- ColorDialog.cs
- EventMap.cs
- RuleElement.cs
- ForceCopyBuildProvider.cs
- HyperlinkAutomationPeer.cs
- SchemaCollectionPreprocessor.cs
- LocationUpdates.cs
- FixedTextPointer.cs
- SimpleApplicationHost.cs
- ElementAction.cs
- AnchoredBlock.cs
- Viewport3DVisual.cs
- DataGridBeginningEditEventArgs.cs
- AudioException.cs
- PolicyStatement.cs
- MenuStrip.cs