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
- ServiceMemoryGates.cs
- WindowsFormsHost.cs
- GCHandleCookieTable.cs
- TransformValueSerializer.cs
- PageThemeBuildProvider.cs
- ConfigurationStrings.cs
- LineServicesCallbacks.cs
- CodeExpressionCollection.cs
- TextServicesProperty.cs
- Reference.cs
- ClientOperationFormatterProvider.cs
- DataGridPagerStyle.cs
- ArraySegment.cs
- DataRecordInfo.cs
- WmlCalendarAdapter.cs
- Avt.cs
- WebPartDescriptionCollection.cs
- ActivityScheduledRecord.cs
- SynchronizedChannelCollection.cs
- ToolStripItemDataObject.cs
- TokenCreationException.cs
- FigureHelper.cs
- SurrogateSelector.cs
- uribuilder.cs
- IncrementalCompileAnalyzer.cs
- RouteItem.cs
- assertwrapper.cs
- ServiceConfigurationTraceRecord.cs
- HtmlInputImage.cs
- QueryInterceptorAttribute.cs
- DataSourceCacheDurationConverter.cs
- ObjectQuery_EntitySqlExtensions.cs
- Unit.cs
- GridViewEditEventArgs.cs
- CustomWebEventKey.cs
- XmlNodeReader.cs
- StateMachine.cs
- EndpointReference.cs
- SiteOfOriginPart.cs
- TableTextElementCollectionInternal.cs
- VideoDrawing.cs
- Underline.cs
- CheckBoxStandardAdapter.cs
- ETagAttribute.cs
- BaseParaClient.cs
- StateManagedCollection.cs
- NonParentingControl.cs
- DateTimeFormat.cs
- AbandonedMutexException.cs
- EditorZoneBase.cs
- OleDbEnumerator.cs
- AssemblyCache.cs
- EditorZone.cs
- TextDecorationCollectionConverter.cs
- SQLChars.cs
- LightweightCodeGenerator.cs
- DataGridSortCommandEventArgs.cs
- ConstraintManager.cs
- XmlIgnoreAttribute.cs
- SelectionProviderWrapper.cs
- TimeManager.cs
- Memoizer.cs
- Enum.cs
- ProgressBarRenderer.cs
- FacetDescription.cs
- WebConfigurationHost.cs
- WebColorConverter.cs
- WindowsImpersonationContext.cs
- ListParaClient.cs
- LassoHelper.cs
- BooleanConverter.cs
- KeysConverter.cs
- HostUtils.cs
- ArcSegment.cs
- StrongNameUtility.cs
- ProcessHostConfigUtils.cs
- Baml2006ReaderSettings.cs
- ObjectDataSourceStatusEventArgs.cs
- DocComment.cs
- PeerSecurityManager.cs
- SqlBinder.cs
- Misc.cs
- OleDbEnumerator.cs
- StylusCaptureWithinProperty.cs
- ToolStripDesignerAvailabilityAttribute.cs
- KeyFrames.cs
- InkCollectionBehavior.cs
- SQLInt64Storage.cs
- GridPatternIdentifiers.cs
- FontStretchConverter.cs
- ListSourceHelper.cs
- HtmlGenericControl.cs
- PerformanceCounter.cs
- COM2ExtendedBrowsingHandler.cs
- BoundPropertyEntry.cs
- AVElementHelper.cs
- XmlNamedNodeMap.cs
- DataSourceXmlClassAttribute.cs
- SamlSubject.cs
- ImportDesigner.xaml.cs