Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / DEVDIV / depot / DevDiv / releases / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / UrlPropertyAttribute.cs / 1 / UrlPropertyAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.ComponentModel; using System.Security.Permissions; using System.Web.Util; // An UrlPropertyAttribute metadata attribute can be applied to string // properties that contain URL values. // This can be used to identify URLs which allows design-time functionality and runtime // functionality to do interesting things with the property values. [AttributeUsage(AttributeTargets.Property)] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class UrlPropertyAttribute : Attribute { private string _filter; // Used to mark a property as an URL. public UrlPropertyAttribute() : this("*.*") { } // Used to mark a property as an URL. In addition, the type of files allowed // can be specified. This can be used at design-time to customize the URL picker. public UrlPropertyAttribute(string filter) { if(filter == null) { _filter = "*.*"; } else { _filter = filter; } } // The file filter associated with the URL property. This takes // the form of a file filter string typically used with Open File // dialogs. The default is *.*, so all file types can be chosen. public string Filter { get { return _filter; } } public override int GetHashCode() { return Filter.GetHashCode(); } public override bool Equals(object obj) { if (obj == this) { return true; } UrlPropertyAttribute other = obj as UrlPropertyAttribute; if (other != null) { return Filter.Equals(other.Filter); } return false; } } } // 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 { using System; using System.ComponentModel; using System.Security.Permissions; using System.Web.Util; // An UrlPropertyAttribute metadata attribute can be applied to string // properties that contain URL values. // This can be used to identify URLs which allows design-time functionality and runtime // functionality to do interesting things with the property values. [AttributeUsage(AttributeTargets.Property)] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] public sealed class UrlPropertyAttribute : Attribute { private string _filter; // Used to mark a property as an URL. public UrlPropertyAttribute() : this("*.*") { } // Used to mark a property as an URL. In addition, the type of files allowed // can be specified. This can be used at design-time to customize the URL picker. public UrlPropertyAttribute(string filter) { if(filter == null) { _filter = "*.*"; } else { _filter = filter; } } // The file filter associated with the URL property. This takes // the form of a file filter string typically used with Open File // dialogs. The default is *.*, so all file types can be chosen. public string Filter { get { return _filter; } } public override int GetHashCode() { return Filter.GetHashCode(); } public override bool Equals(object obj) { if (obj == this) { return true; } UrlPropertyAttribute other = obj as UrlPropertyAttribute; if (other != null) { return Filter.Equals(other.Filter); } return false; } } } // 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
- WindowPattern.cs
- CoTaskMemHandle.cs
- ToolStripOverflow.cs
- Matrix3D.cs
- DeclaredTypeValidatorAttribute.cs
- BamlTreeNode.cs
- DBCSCodePageEncoding.cs
- FromRequest.cs
- Int32AnimationUsingKeyFrames.cs
- TraceProvider.cs
- Int16AnimationUsingKeyFrames.cs
- SchemaEntity.cs
- BufferedGraphicsContext.cs
- WebEncodingValidatorAttribute.cs
- WindowPatternIdentifiers.cs
- TreeNodeStyle.cs
- StorageAssociationSetMapping.cs
- LinqDataSource.cs
- UserControlBuildProvider.cs
- Italic.cs
- TransactionOptions.cs
- SecurityHeaderElementInferenceEngine.cs
- AssemblyAssociatedContentFileAttribute.cs
- ToolStripDropDownMenu.cs
- BooleanExpr.cs
- BCLDebug.cs
- DataGridViewSelectedCellCollection.cs
- XmlBufferedByteStreamReader.cs
- PaginationProgressEventArgs.cs
- Stream.cs
- COM2Properties.cs
- LowerCaseStringConverter.cs
- SafeCryptoKeyHandle.cs
- TextServicesContext.cs
- BuildProviderUtils.cs
- KeyInterop.cs
- SrgsSubset.cs
- GetWinFXPath.cs
- Condition.cs
- TargetControlTypeAttribute.cs
- StubHelpers.cs
- DrawingAttributes.cs
- KeyPullup.cs
- SqlDuplicator.cs
- RequestValidator.cs
- HttpListenerPrefixCollection.cs
- FontSourceCollection.cs
- CodeObject.cs
- CreateUserWizardStep.cs
- MethodBuilder.cs
- IndexObject.cs
- ExpressionCopier.cs
- MultiPropertyDescriptorGridEntry.cs
- BuildDependencySet.cs
- FontFamily.cs
- ColorTransformHelper.cs
- DocumentStream.cs
- DataControlFieldCell.cs
- CustomWebEventKey.cs
- dbdatarecord.cs
- DocumentScope.cs
- BamlLocalizableResourceKey.cs
- XmlObjectSerializerReadContextComplex.cs
- Assert.cs
- PageFunction.cs
- FormatConvertedBitmap.cs
- ComponentEditorForm.cs
- CommandBinding.cs
- DiscoveryClientReferences.cs
- XNodeSchemaApplier.cs
- ContentPresenter.cs
- HtmlLinkAdapter.cs
- DatePickerAutomationPeer.cs
- ExpressionEditor.cs
- ClientTarget.cs
- MgmtConfigurationRecord.cs
- RadioButton.cs
- TerminatingOperationBehavior.cs
- MapPathBasedVirtualPathProvider.cs
- CookieHandler.cs
- SqlReorderer.cs
- Activator.cs
- AsyncResult.cs
- RbTree.cs
- SequenceDesigner.cs
- FixedFindEngine.cs
- HostedTransportConfigurationManager.cs
- RequiredAttributeAttribute.cs
- DrawingGroup.cs
- odbcmetadatacolumnnames.cs
- LowerCaseStringConverter.cs
- Base64Stream.cs
- XslCompiledTransform.cs
- WindowsListView.cs
- IERequestCache.cs
- TableDetailsRow.cs
- EventsTab.cs
- MatrixConverter.cs
- XPathParser.cs
- CodeBinaryOperatorExpression.cs