Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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. // //----------------------------------------------------------------------------- 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CommandExpr.cs
- XmlParserContext.cs
- ServicePoint.cs
- ZipIOFileItemStream.cs
- TargetException.cs
- PeerNameRecordCollection.cs
- FormatConvertedBitmap.cs
- PrefixQName.cs
- ConfigurationElementCollection.cs
- TabletDevice.cs
- SqlDependencyListener.cs
- MenuDesigner.cs
- JsonWriter.cs
- StreamInfo.cs
- documentsequencetextcontainer.cs
- DuplicateWaitObjectException.cs
- OLEDB_Enum.cs
- WSFederationHttpSecurity.cs
- DocumentSchemaValidator.cs
- BezierSegment.cs
- CharConverter.cs
- SqlDataSourceParameterParser.cs
- ApplicationSecurityInfo.cs
- ManagementOptions.cs
- Stackframe.cs
- AdRotator.cs
- SessionSwitchEventArgs.cs
- WebServiceFault.cs
- TypeNameConverter.cs
- TreeViewImageKeyConverter.cs
- _NtlmClient.cs
- UserPreferenceChangingEventArgs.cs
- Compiler.cs
- ThaiBuddhistCalendar.cs
- StateRuntime.cs
- SimpleMailWebEventProvider.cs
- AssociationTypeEmitter.cs
- NetworkStream.cs
- EncryptedHeader.cs
- PngBitmapEncoder.cs
- ExpressionContext.cs
- XmlWriterDelegator.cs
- AxisAngleRotation3D.cs
- StylusPointProperty.cs
- Selection.cs
- CapabilitiesState.cs
- EntityKeyElement.cs
- ObjectComplexPropertyMapping.cs
- XPathItem.cs
- HttpChannelListener.cs
- _ConnectionGroup.cs
- HtmlLabelAdapter.cs
- SchemaExporter.cs
- TablePatternIdentifiers.cs
- IndicCharClassifier.cs
- SafeHandles.cs
- ADMembershipUser.cs
- Visitors.cs
- GenericEnumConverter.cs
- ClientApiGenerator.cs
- TypeConverters.cs
- FlowLayoutPanel.cs
- UIElementCollection.cs
- FirstMatchCodeGroup.cs
- HasCopySemanticsAttribute.cs
- PersonalizationDictionary.cs
- DocumentSchemaValidator.cs
- FontStretch.cs
- QuotedPrintableStream.cs
- RegexInterpreter.cs
- VariableQuery.cs
- ErrorTableItemStyle.cs
- SymmetricKey.cs
- XmlAnyAttributeAttribute.cs
- CodeTypeMemberCollection.cs
- TransformedBitmap.cs
- IsolatedStorageException.cs
- DesignerToolboxInfo.cs
- MemberProjectionIndex.cs
- SafeSecurityHelper.cs
- CriticalHandle.cs
- PatternMatcher.cs
- DataMemberFieldConverter.cs
- ReceiveContextCollection.cs
- PermissionSetEnumerator.cs
- XPathException.cs
- Pool.cs
- METAHEADER.cs
- ErrorHandler.cs
- TdsParserStaticMethods.cs
- SettingsPropertyIsReadOnlyException.cs
- PagedDataSource.cs
- OdbcCommand.cs
- FrameworkElementFactoryMarkupObject.cs
- AssemblyCollection.cs
- ShapeTypeface.cs
- DataGridTextBox.cs
- LinqExpressionNormalizer.cs
- RegexRunner.cs
- IdentityHolder.cs