Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / clr / src / BCL / System / Reflection / __Filters.cs / 1 / __Filters.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // // This class defines the delegate methods for the COM+ implemented filters. // This is the reflection version of these. There is also a _Filters class in // runtime which is related to this. // // // // namespace System.Reflection { using System; using System.Globalization; //< [Serializable()] internal class __Filters { // FilterTypeName // This method will filter the class based upon the name. It supports // a trailing wild card. public virtual bool FilterTypeName(Type cls,Object filterCriteria) { // Check that the criteria object is a String object if (filterCriteria == null || !(filterCriteria is String)) throw new InvalidFilterCriteriaException(System.Environment.GetResourceString("RFLCT.FltCritString")); String str = (String) filterCriteria; //str = str.Trim(); // Check to see if this is a prefix or exact match requirement if (str.Length > 0 && str[str.Length - 1] == '*') { str = str.Substring(0, str.Length - 1); return cls.Name.StartsWith(str, StringComparison.Ordinal); } return cls.Name.Equals(str); } // FilterFieldNameIgnoreCase // This method filter the Type based upon name, it ignores case. public virtual bool FilterTypeNameIgnoreCase(Type cls, Object filterCriteria) { // Check that the criteria object is a String object if(filterCriteria == null || !(filterCriteria is String)) throw new InvalidFilterCriteriaException(System.Environment.GetResourceString("RFLCT.FltCritString")); String str = (String) filterCriteria; //str = str.Trim(); // Check to see if this is a prefix or exact match requirement if (str.Length > 0 && str[str.Length - 1] == '*') { str = str.Substring(0, str.Length - 1); String name = cls.Name; if (name.Length >= str.Length) return (String.Compare(name,0,str,0,str.Length,StringComparison.OrdinalIgnoreCase)==0); else return false; } return (String.Compare(str,cls.Name, StringComparison.OrdinalIgnoreCase) == 0); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ActivityBuilderHelper.cs
- StrokeFIndices.cs
- Pen.cs
- OleDbInfoMessageEvent.cs
- ExclusiveNamedPipeTransportManager.cs
- XmlILTrace.cs
- PaintEvent.cs
- GeometryCombineModeValidation.cs
- brushes.cs
- EntityDataSourceWrapper.cs
- TextBoxBase.cs
- TextEffect.cs
- ReadOnlyDictionary.cs
- Serializer.cs
- AudienceUriMode.cs
- ActivityTypeCodeDomSerializer.cs
- ArgumentReference.cs
- ActivationWorker.cs
- SimpleHandlerFactory.cs
- UriExt.cs
- ScriptMethodAttribute.cs
- ExcCanonicalXml.cs
- PageAsyncTask.cs
- DelegateArgumentReference.cs
- PTManager.cs
- XPathParser.cs
- SocketElement.cs
- DefaultProxySection.cs
- ScrollEventArgs.cs
- ArgumentsParser.cs
- DeflateStream.cs
- ConfigurationFileMap.cs
- ThousandthOfEmRealDoubles.cs
- CompilationRelaxations.cs
- HostingEnvironment.cs
- ConnectionPoint.cs
- IsolatedStorageFilePermission.cs
- CodeCastExpression.cs
- IdleTimeoutMonitor.cs
- NavigatingCancelEventArgs.cs
- AppManager.cs
- LazyLoadBehavior.cs
- WebPartConnectionsConnectVerb.cs
- IMembershipProvider.cs
- SqlTypeSystemProvider.cs
- SQLDoubleStorage.cs
- PaperSize.cs
- NativeMethods.cs
- ExpressionLink.cs
- RightsManagementInformation.cs
- BevelBitmapEffect.cs
- Application.cs
- SqlIdentifier.cs
- PropVariant.cs
- BackgroundFormatInfo.cs
- SortDescriptionCollection.cs
- DateTimeStorage.cs
- PersonalizationStateInfo.cs
- IPEndPoint.cs
- ServiceHostingEnvironment.cs
- CompressedStack.cs
- BmpBitmapEncoder.cs
- CoTaskMemHandle.cs
- TableLayoutSettings.cs
- SqlParameterCollection.cs
- Tracking.cs
- WindowsFormsHelpers.cs
- ObsoleteAttribute.cs
- RegexMatchCollection.cs
- ObjectViewFactory.cs
- ApplicationHost.cs
- XmlNodeReader.cs
- IImplicitResourceProvider.cs
- HostedBindingBehavior.cs
- AdapterUtil.cs
- ToolStripItemGlyph.cs
- DetailsViewInsertedEventArgs.cs
- Claim.cs
- DataServiceConfiguration.cs
- DesignDataSource.cs
- IndentedTextWriter.cs
- TcpClientChannel.cs
- RadioButton.cs
- PageClientProxyGenerator.cs
- RepeaterDataBoundAdapter.cs
- IDReferencePropertyAttribute.cs
- Activator.cs
- ControlBuilderAttribute.cs
- SqlUserDefinedTypeAttribute.cs
- Debug.cs
- FragmentQueryKB.cs
- ImageListImage.cs
- MatrixCamera.cs
- SqlUdtInfo.cs
- InputScopeManager.cs
- XmlDocument.cs
- XmlBoundElement.cs
- SqlServer2KCompatibilityAnnotation.cs
- DependencyObjectValidator.cs
- ProfileEventArgs.cs