Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / UI / UrlPropertyAttribute.cs / 1305376 / UrlPropertyAttribute.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.ComponentModel; 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)] 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. // //----------------------------------------------------------------------------- namespace System.Web.UI { using System; using System.ComponentModel; 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)] 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- RegexParser.cs
- CreateParams.cs
- ClassHandlersStore.cs
- MultidimensionalArrayItemReference.cs
- Typography.cs
- XmlCharCheckingReader.cs
- TraceUtils.cs
- AnnotationHelper.cs
- TemplateInstanceAttribute.cs
- HMAC.cs
- DrawingDrawingContext.cs
- Restrictions.cs
- IteratorFilter.cs
- DataPagerCommandEventArgs.cs
- Point3DAnimationBase.cs
- DataGridViewColumnStateChangedEventArgs.cs
- XmlAtomicValue.cs
- CompareValidator.cs
- HttpCapabilitiesBase.cs
- SystemInformation.cs
- SafeHandles.cs
- CodePageUtils.cs
- XmlSchemaFacet.cs
- SystemResources.cs
- ErrorEventArgs.cs
- DataViewManager.cs
- OutputCacheSettingsSection.cs
- SchemaNotation.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- LocationUpdates.cs
- MultiAsyncResult.cs
- FlowLayoutPanel.cs
- ConfigXmlComment.cs
- ThousandthOfEmRealDoubles.cs
- DataProtection.cs
- Panel.cs
- CatalogPart.cs
- Interop.cs
- FontDialog.cs
- SqlReorderer.cs
- ConfigXmlComment.cs
- WSHttpBinding.cs
- FormsAuthenticationCredentials.cs
- NegotiateStream.cs
- SqlCacheDependencyDatabaseCollection.cs
- MULTI_QI.cs
- CharUnicodeInfo.cs
- ResourceCategoryAttribute.cs
- BatchParser.cs
- UInt16Converter.cs
- GlyphCache.cs
- SplitterEvent.cs
- Options.cs
- MetadataArtifactLoaderCompositeResource.cs
- TableRowCollection.cs
- KeySpline.cs
- StringResourceManager.cs
- Canvas.cs
- StatusBarItem.cs
- DbExpressionBuilder.cs
- EditBehavior.cs
- AssemblyResourceLoader.cs
- CodeNamespaceImport.cs
- MatrixCamera.cs
- MethodToken.cs
- ProfessionalColorTable.cs
- ReflectTypeDescriptionProvider.cs
- RouteCollection.cs
- DynamicValidator.cs
- InlineObject.cs
- SchemaElementLookUpTable.cs
- ItemContainerGenerator.cs
- Int16Animation.cs
- Span.cs
- RotateTransform.cs
- Int16.cs
- SchemaRegistration.cs
- StreamingContext.cs
- LineServicesCallbacks.cs
- AliasedSlot.cs
- MsmqIntegrationSecurityElement.cs
- BuildProvider.cs
- IsolatedStorageException.cs
- DataRelationPropertyDescriptor.cs
- InputLanguageEventArgs.cs
- Matrix3D.cs
- EventLogStatus.cs
- DBSqlParserTableCollection.cs
- MasterPageParser.cs
- JournalNavigationScope.cs
- TargetInvocationException.cs
- CLRBindingWorker.cs
- VerificationAttribute.cs
- ZipFileInfo.cs
- PersonalizationStateQuery.cs
- SessionPageStateSection.cs
- SmiRequestExecutor.cs
- SqlDataSourceCustomCommandPanel.cs
- Crc32Helper.cs
- ViewPort3D.cs