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
- DataGridViewCell.cs
- EdmType.cs
- MenuAdapter.cs
- BitmapMetadataBlob.cs
- CharacterBuffer.cs
- DataSourceCache.cs
- CustomValidator.cs
- ChtmlImageAdapter.cs
- RawTextInputReport.cs
- TreeNodeStyle.cs
- SecurityContext.cs
- BaseParser.cs
- LinqMaximalSubtreeNominator.cs
- WebBrowserSiteBase.cs
- AllMembershipCondition.cs
- MatrixTransform3D.cs
- TracingConnectionInitiator.cs
- ZipIOCentralDirectoryFileHeader.cs
- SecurityUtils.cs
- XmlSchemaValidator.cs
- MemberInfoSerializationHolder.cs
- TextElementCollectionHelper.cs
- InvalidateEvent.cs
- Light.cs
- HtmlInputControl.cs
- NullEntityWrapper.cs
- Mouse.cs
- DataTableNewRowEvent.cs
- XmlElementCollection.cs
- List.cs
- FlowSwitch.cs
- XPathCompileException.cs
- FillBehavior.cs
- WinInetCache.cs
- InvokeHandlers.cs
- PermissionSetEnumerator.cs
- HeaderCollection.cs
- CompiledIdentityConstraint.cs
- HtmlLabelAdapter.cs
- DesignerTextViewAdapter.cs
- EventData.cs
- Trace.cs
- WindowsListViewScroll.cs
- DataSourceProvider.cs
- StatusBarAutomationPeer.cs
- Pair.cs
- StringBuilder.cs
- BaseTemplateParser.cs
- HtmlGenericControl.cs
- PropertyChangedEventManager.cs
- DeflateStream.cs
- DataRelationPropertyDescriptor.cs
- NameSpaceEvent.cs
- ColumnMapProcessor.cs
- X509CertificateClaimSet.cs
- MouseActionConverter.cs
- SystemMulticastIPAddressInformation.cs
- SinglePageViewer.cs
- ComponentRenameEvent.cs
- DelegateBodyWriter.cs
- InheritablePropertyChangeInfo.cs
- PathGradientBrush.cs
- WebPartEditorCancelVerb.cs
- AssociationType.cs
- SafeNativeMethodsMilCoreApi.cs
- BitmapEffectDrawingContextWalker.cs
- ConversionContext.cs
- PackageRelationshipSelector.cs
- FilterException.cs
- BitFlagsGenerator.cs
- TreeViewDataItemAutomationPeer.cs
- Utils.cs
- BitmapEffectInput.cs
- Model3DCollection.cs
- TagPrefixCollection.cs
- StatusStrip.cs
- GenerateHelper.cs
- StateItem.cs
- MailMessage.cs
- SafeEventLogWriteHandle.cs
- GACMembershipCondition.cs
- VsPropertyGrid.cs
- UriScheme.cs
- UnsafeNativeMethods.cs
- ConfigXmlSignificantWhitespace.cs
- CfgArc.cs
- Point3D.cs
- EndPoint.cs
- CodeExpressionStatement.cs
- ContextMenu.cs
- CodeRegionDirective.cs
- BaseDataBoundControl.cs
- DataGridBoolColumn.cs
- PolicyValidationException.cs
- COM2ExtendedTypeConverter.cs
- _SSPISessionCache.cs
- ConditionalAttribute.cs
- UserInitiatedNavigationPermission.cs
- UserControlCodeDomTreeGenerator.cs
- CompleteWizardStep.cs