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
- HttpCookie.cs
- ReadWriteObjectLock.cs
- DataSourceXmlElementAttribute.cs
- CheckPair.cs
- QilFunction.cs
- InstancePersistenceCommandException.cs
- CodeConstructor.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- NotFiniteNumberException.cs
- DynamicDataExtensions.cs
- ListControl.cs
- ServicePointManager.cs
- PerspectiveCamera.cs
- GradientSpreadMethodValidation.cs
- WmiPutTraceRecord.cs
- MemberMemberBinding.cs
- TimeSpan.cs
- SymLanguageType.cs
- OlePropertyStructs.cs
- GridViewDeleteEventArgs.cs
- DrawListViewItemEventArgs.cs
- Cell.cs
- Transactions.cs
- PropertyEmitter.cs
- NetDataContractSerializer.cs
- AVElementHelper.cs
- ConsoleKeyInfo.cs
- SmtpDigestAuthenticationModule.cs
- SerializationInfo.cs
- TabletDevice.cs
- Path.cs
- TraceContextEventArgs.cs
- UdpTransportSettingsElement.cs
- ErrorTableItemStyle.cs
- IndicShape.cs
- StreamingContext.cs
- DiagnosticEventProvider.cs
- ByteViewer.cs
- EnvelopedPkcs7.cs
- Clock.cs
- Behavior.cs
- CheckBoxField.cs
- Transform3D.cs
- FontInfo.cs
- CommandManager.cs
- LinearKeyFrames.cs
- SimpleType.cs
- LocatorGroup.cs
- SqlBinder.cs
- EventSinkHelperWriter.cs
- FixedDocumentSequencePaginator.cs
- HttpResponseInternalWrapper.cs
- CompilationUtil.cs
- HttpProfileBase.cs
- SqlConnectionStringBuilder.cs
- XmlQuerySequence.cs
- VirtualPathUtility.cs
- SqlStream.cs
- RichTextBox.cs
- _LocalDataStore.cs
- BamlBinaryReader.cs
- CalendarDay.cs
- XamlStackWriter.cs
- EntityDataSourceConfigureObjectContext.cs
- QueryRewriter.cs
- SqlTypeConverter.cs
- DotExpr.cs
- HttpModuleCollection.cs
- XmlElementCollection.cs
- ServicePointManagerElement.cs
- SamlAssertionKeyIdentifierClause.cs
- AnnotationStore.cs
- AlternateViewCollection.cs
- ContextMarshalException.cs
- EditorReuseAttribute.cs
- KeyValuePair.cs
- BindingMemberInfo.cs
- formatter.cs
- Globals.cs
- TextTabProperties.cs
- OdbcTransaction.cs
- SingleAnimationUsingKeyFrames.cs
- SelfIssuedAuthProofToken.cs
- CodeEntryPointMethod.cs
- HtmlUtf8RawTextWriter.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- DataGridViewRowsAddedEventArgs.cs
- SynchronizationContext.cs
- ContextCorrelationInitializer.cs
- EmbeddedObject.cs
- CommonObjectSecurity.cs
- CodeExpressionStatement.cs
- XmlCharCheckingWriter.cs
- __ComObject.cs
- Predicate.cs
- SourceFilter.cs
- SQLInt16Storage.cs
- InstanceContext.cs
- DateTimeConverter2.cs
- DynamicObjectAccessor.cs