Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebControls / ProfileParameter.cs / 2 / ProfileParameter.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 user's profile data. /// [ DefaultProperty("PropertyName"), ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] public class ProfileParameter : Parameter { ////// Creates an instance of the ProfileParameter class. /// public ProfileParameter() { } ////// Creates an instance of the ProfileParameter class with the specified parameter name and profile property. /// public ProfileParameter(string name, string propertyName) : base(name) { PropertyName = propertyName; } ////// Creates an instance of the ProfileParameter class with the specified parameter name, type, and profile property. /// public ProfileParameter(string name, TypeCode type, string propertyName) : base(name, type) { PropertyName = propertyName; } ////// Creates an instance of the ProfileParameter class with the specified parameter name, database type, and /// profile property. /// public ProfileParameter(string name, DbType dbType, string propertyName) : base(name, dbType) { PropertyName = propertyName; } ////// Used to clone a parameter. /// protected ProfileParameter(ProfileParameter original) : base(original) { PropertyName = original.PropertyName; } ////// The name of the Profile property to get the value from. /// [ DefaultValue(""), WebCategory("Parameter"), WebSysDescription(SR.ProfileParameter_PropertyName), ] public string PropertyName { get { object o = ViewState["PropertyName"]; if (o == null) return String.Empty; return (string)o; } set { if (PropertyName != value) { ViewState["PropertyName"] = value; OnParameterChanged(); } } } ////// Creates a new ProfileParameter that is a copy of this ProfileParameter. /// protected override Parameter Clone() { return new ProfileParameter(this); } ////// Returns the updated value of the parameter. /// protected override object Evaluate(HttpContext context, Control control) { if (context == null || context.Profile == null) { return null; } return DataBinder.Eval(context.Profile, PropertyName); } } } // 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 user's profile data. /// [ DefaultProperty("PropertyName"), ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] public class ProfileParameter : Parameter { ////// Creates an instance of the ProfileParameter class. /// public ProfileParameter() { } ////// Creates an instance of the ProfileParameter class with the specified parameter name and profile property. /// public ProfileParameter(string name, string propertyName) : base(name) { PropertyName = propertyName; } ////// Creates an instance of the ProfileParameter class with the specified parameter name, type, and profile property. /// public ProfileParameter(string name, TypeCode type, string propertyName) : base(name, type) { PropertyName = propertyName; } ////// Creates an instance of the ProfileParameter class with the specified parameter name, database type, and /// profile property. /// public ProfileParameter(string name, DbType dbType, string propertyName) : base(name, dbType) { PropertyName = propertyName; } ////// Used to clone a parameter. /// protected ProfileParameter(ProfileParameter original) : base(original) { PropertyName = original.PropertyName; } ////// The name of the Profile property to get the value from. /// [ DefaultValue(""), WebCategory("Parameter"), WebSysDescription(SR.ProfileParameter_PropertyName), ] public string PropertyName { get { object o = ViewState["PropertyName"]; if (o == null) return String.Empty; return (string)o; } set { if (PropertyName != value) { ViewState["PropertyName"] = value; OnParameterChanged(); } } } ////// Creates a new ProfileParameter that is a copy of this ProfileParameter. /// protected override Parameter Clone() { return new ProfileParameter(this); } ////// Returns the updated value of the parameter. /// protected override object Evaluate(HttpContext context, Control control) { if (context == null || context.Profile == null) { return null; } return DataBinder.Eval(context.Profile, PropertyName); } } } // 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
- SiteMapDataSourceView.cs
- DataBoundControlDesigner.cs
- StrongNamePublicKeyBlob.cs
- ShortcutKeysEditor.cs
- PixelFormatConverter.cs
- SafePEFileHandle.cs
- HttpHandlerActionCollection.cs
- ExpressionTable.cs
- TextDpi.cs
- DataBindingCollection.cs
- SqlProfileProvider.cs
- SQLDecimalStorage.cs
- CodeConditionStatement.cs
- ToolStripDropDownClosingEventArgs.cs
- CompiledXpathExpr.cs
- SoapIgnoreAttribute.cs
- Compiler.cs
- PathFigureCollectionValueSerializer.cs
- util.cs
- SchemaMerger.cs
- ScaleTransform.cs
- DesignerTextViewAdapter.cs
- RawAppCommandInputReport.cs
- XmlImplementation.cs
- AnnotationStore.cs
- SafeReadContext.cs
- VisualProxy.cs
- ISFClipboardData.cs
- ListMarkerSourceInfo.cs
- AutomationAttributeInfo.cs
- WorkflowOwnerAsyncResult.cs
- TransformerConfigurationWizardBase.cs
- CellTreeNode.cs
- SqlTriggerContext.cs
- PrintDialogException.cs
- Splitter.cs
- SelectionItemProviderWrapper.cs
- UrlMappingsModule.cs
- HyperLinkColumn.cs
- counter.cs
- SQLInt16.cs
- ConfigXmlText.cs
- StickyNote.cs
- XPathDocumentBuilder.cs
- ObjectHandle.cs
- SoundPlayerAction.cs
- StylusPointPropertyId.cs
- DifferencingCollection.cs
- MetabaseSettingsIis7.cs
- CurrencyWrapper.cs
- PointF.cs
- COM2IProvidePropertyBuilderHandler.cs
- DrawingImage.cs
- cookieexception.cs
- SettingsPropertyValue.cs
- Int16Storage.cs
- EntityDataSourceSelectedEventArgs.cs
- RbTree.cs
- ComboBox.cs
- XmlUnspecifiedAttribute.cs
- TextModifier.cs
- SchemaInfo.cs
- WebRequestModuleElement.cs
- DockPatternIdentifiers.cs
- SingleStorage.cs
- NullableIntAverageAggregationOperator.cs
- ToolboxItemFilterAttribute.cs
- ToolStripArrowRenderEventArgs.cs
- WebUtil.cs
- isolationinterop.cs
- NativeMethods.cs
- Automation.cs
- EditingScope.cs
- HostingEnvironment.cs
- SqlDataSourceView.cs
- SqlEnums.cs
- TextDpi.cs
- TextureBrush.cs
- XpsFilter.cs
- _RegBlobWebProxyDataBuilder.cs
- HostProtectionException.cs
- RoleGroupCollection.cs
- XmlSchemaExporter.cs
- PixelFormatConverter.cs
- MemoryFailPoint.cs
- SQLInt16.cs
- ValidationService.cs
- DecimalStorage.cs
- UserControlBuildProvider.cs
- DataAccessor.cs
- RowParagraph.cs
- CustomAttribute.cs
- SessionIDManager.cs
- ButtonChrome.cs
- AncillaryOps.cs
- SaveFileDialog.cs
- ApplicationGesture.cs
- TextDecorationCollectionConverter.cs
- CommonProperties.cs
- ContextQuery.cs