Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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. // //----------------------------------------------------------------------------- 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- NamedPipeTransportManager.cs
- DownloadProgressEventArgs.cs
- JournalEntry.cs
- LogLogRecord.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- ChannelPool.cs
- Help.cs
- ConstantSlot.cs
- CopyOnWriteList.cs
- TrustSection.cs
- BevelBitmapEffect.cs
- BrowserCapabilitiesFactory.cs
- Token.cs
- VectorAnimationBase.cs
- TreeNodeMouseHoverEvent.cs
- LineMetrics.cs
- ScopedKnownTypes.cs
- SweepDirectionValidation.cs
- RouteData.cs
- AnimationClock.cs
- UnsafePeerToPeerMethods.cs
- XamlReaderHelper.cs
- FixedNode.cs
- Barrier.cs
- CopyAttributesAction.cs
- RemoteArgument.cs
- DataGridViewTextBoxColumn.cs
- CompiledQueryCacheKey.cs
- autovalidator.cs
- InstanceOwnerQueryResult.cs
- unsafenativemethodstextservices.cs
- ConfigXmlCDataSection.cs
- QueryConverter.cs
- EditorPart.cs
- XmlWrappingReader.cs
- ResXFileRef.cs
- TraceHandler.cs
- HyperlinkAutomationPeer.cs
- BaseParagraph.cs
- ExeConfigurationFileMap.cs
- CreateUserWizardStep.cs
- RangeValidator.cs
- DesignDataSource.cs
- FactoryGenerator.cs
- RoutedUICommand.cs
- Stack.cs
- MatchingStyle.cs
- FakeModelItemImpl.cs
- ConfigXmlElement.cs
- ListenerSessionConnection.cs
- FieldDescriptor.cs
- AttributeAction.cs
- BorderGapMaskConverter.cs
- ObservableDictionary.cs
- GeometryGroup.cs
- HtmlGenericControl.cs
- ContextMarshalException.cs
- TextEditor.cs
- Operators.cs
- Validator.cs
- MemoryRecordBuffer.cs
- InternalBufferOverflowException.cs
- CodeFieldReferenceExpression.cs
- ProviderUtil.cs
- Assembly.cs
- DuplicateWaitObjectException.cs
- ExtentKey.cs
- FontSource.cs
- hebrewshape.cs
- _CookieModule.cs
- Helpers.cs
- InstanceKeyCompleteException.cs
- TransformerInfoCollection.cs
- InvalidAsynchronousStateException.cs
- DLinqDataModelProvider.cs
- DataGridViewTopRowAccessibleObject.cs
- AdRotatorDesigner.cs
- BoundPropertyEntry.cs
- TraceEventCache.cs
- DispatcherObject.cs
- DbParameterCollection.cs
- HelloOperationCD1AsyncResult.cs
- DataGridViewComboBoxCell.cs
- DataViewSettingCollection.cs
- VariantWrapper.cs
- FontInfo.cs
- ProxyManager.cs
- ObfuscateAssemblyAttribute.cs
- View.cs
- DataGridItemCollection.cs
- SQLMembershipProvider.cs
- CustomPopupPlacement.cs
- BatchServiceHost.cs
- FixedStringLookup.cs
- SystemKeyConverter.cs
- Ticks.cs
- TabletDeviceInfo.cs
- GeneratedCodeAttribute.cs
- SessionState.cs
- filewebrequest.cs