Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebControls / SessionParameter.cs / 2 / SessionParameter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.ComponentModel; using System.Data; using System.Security.Permissions; ////// Represents a Parameter that gets its value from the application's session state. /// [ DefaultProperty("SessionField"), ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] public class SessionParameter : Parameter { ////// Creates an instance of the SessionParameter class. /// public SessionParameter() { } ////// Creates an instance of the SessionParameter class with the specified parameter name, and session field. /// public SessionParameter(string name, string sessionField) : base(name) { SessionField = sessionField; } ////// Creates an instance of the SessionParameter class with the specified parameter name, database type, and /// session field. /// public SessionParameter(string name, DbType dbType, string sessionField) : base(name, dbType) { SessionField = sessionField; } ////// Creates an instance of the SessionParameter class with the specified parameter name, type, and session field. /// public SessionParameter(string name, TypeCode type, string sessionField) : base(name, type) { SessionField = sessionField; } ////// Used to clone a parameter. /// protected SessionParameter(SessionParameter original) : base(original) { SessionField = original.SessionField; } ////// The name of the session variable to get the value from. /// [ DefaultValue(""), WebCategory("Parameter"), WebSysDescription(SR.SessionParameter_SessionField), ] public string SessionField { get { object o = ViewState["SessionField"]; if (o == null) return String.Empty; return (string)o; } set { if (SessionField != value) { ViewState["SessionField"] = value; OnParameterChanged(); } } } ////// Creates a new SessionParameter that is a copy of this SessionParameter. /// protected override Parameter Clone() { return new SessionParameter(this); } ////// Returns the updated value of the parameter. /// protected override object Evaluate(HttpContext context, Control control) { if (context == null || context.Session == null) { return null; } return context.Session[SessionField]; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.ComponentModel; using System.Data; using System.Security.Permissions; ////// Represents a Parameter that gets its value from the application's session state. /// [ DefaultProperty("SessionField"), ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] public class SessionParameter : Parameter { ////// Creates an instance of the SessionParameter class. /// public SessionParameter() { } ////// Creates an instance of the SessionParameter class with the specified parameter name, and session field. /// public SessionParameter(string name, string sessionField) : base(name) { SessionField = sessionField; } ////// Creates an instance of the SessionParameter class with the specified parameter name, database type, and /// session field. /// public SessionParameter(string name, DbType dbType, string sessionField) : base(name, dbType) { SessionField = sessionField; } ////// Creates an instance of the SessionParameter class with the specified parameter name, type, and session field. /// public SessionParameter(string name, TypeCode type, string sessionField) : base(name, type) { SessionField = sessionField; } ////// Used to clone a parameter. /// protected SessionParameter(SessionParameter original) : base(original) { SessionField = original.SessionField; } ////// The name of the session variable to get the value from. /// [ DefaultValue(""), WebCategory("Parameter"), WebSysDescription(SR.SessionParameter_SessionField), ] public string SessionField { get { object o = ViewState["SessionField"]; if (o == null) return String.Empty; return (string)o; } set { if (SessionField != value) { ViewState["SessionField"] = value; OnParameterChanged(); } } } ////// Creates a new SessionParameter that is a copy of this SessionParameter. /// protected override Parameter Clone() { return new SessionParameter(this); } ////// Returns the updated value of the parameter. /// protected override object Evaluate(HttpContext context, Control control) { if (context == null || context.Session == null) { return null; } return context.Session[SessionField]; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Accessors.cs
- TreeNodeStyleCollection.cs
- BookmarkScope.cs
- ObjectStateEntry.cs
- Thumb.cs
- AnnotationResource.cs
- LZCodec.cs
- SQLDateTime.cs
- XmlILConstructAnalyzer.cs
- DockPanel.cs
- ObjectToIdCache.cs
- ImageFormatConverter.cs
- OperandQuery.cs
- FontConverter.cs
- ConfigurationManager.cs
- RequiredAttributeAttribute.cs
- TypeUsage.cs
- DynamicUpdateCommand.cs
- WindowsContainer.cs
- IgnoreFlushAndCloseStream.cs
- XmlNodeWriter.cs
- WebChannelFactory.cs
- AndCondition.cs
- SafeArrayTypeMismatchException.cs
- TextComposition.cs
- CodeAccessSecurityEngine.cs
- ProbeMatchesCD1.cs
- XmlElement.cs
- ChangePasswordDesigner.cs
- ActiveXSite.cs
- ControlSerializer.cs
- CngAlgorithmGroup.cs
- sqlpipe.cs
- CodeRemoveEventStatement.cs
- HttpWebRequestElement.cs
- BeginEvent.cs
- DocumentApplicationDocumentViewer.cs
- DataColumnChangeEvent.cs
- PipeStream.cs
- XmlSchemaDatatype.cs
- Ref.cs
- InsufficientMemoryException.cs
- ExitEventArgs.cs
- DesignerActionUIService.cs
- PolyLineSegment.cs
- DriveNotFoundException.cs
- XmlSchemaSequence.cs
- CompilationRelaxations.cs
- DeferredElementTreeState.cs
- ScriptControlDescriptor.cs
- PagerSettings.cs
- FormatterConverter.cs
- SecurityTokenResolver.cs
- BitmapEffect.cs
- LoggedException.cs
- Bits.cs
- ClientFormsAuthenticationMembershipProvider.cs
- EntitySetDataBindingList.cs
- XsdBuilder.cs
- Crc32.cs
- TypeDefinition.cs
- BufferAllocator.cs
- PasswordTextNavigator.cs
- FocusChangedEventArgs.cs
- XmlNavigatorFilter.cs
- CollectionCodeDomSerializer.cs
- tooltip.cs
- CoordinationService.cs
- ConnectionStringsExpressionEditor.cs
- RuntimeCompatibilityAttribute.cs
- ProxyHelper.cs
- FontDialog.cs
- ApplicationDirectory.cs
- SafeBitVector32.cs
- RawAppCommandInputReport.cs
- Camera.cs
- GeneralTransform3DTo2DTo3D.cs
- DomainConstraint.cs
- SqlInternalConnection.cs
- OracleFactory.cs
- StreamResourceInfo.cs
- ElementProxy.cs
- WindowsGrip.cs
- Propagator.Evaluator.cs
- FileLoadException.cs
- Currency.cs
- SerializationSectionGroup.cs
- MatrixStack.cs
- SecureStringHasher.cs
- GeneralTransform3DGroup.cs
- PersonalizationEntry.cs
- RuleSettings.cs
- KeyGestureConverter.cs
- ZoneMembershipCondition.cs
- DataAdapter.cs
- SystemFonts.cs
- ClientSettingsProvider.cs
- ECDsa.cs
- BoolExpression.cs
- GPPOINTF.cs