Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Reflection / __Filters.cs / 1305376 / __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); } } } // 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
- SelectionRangeConverter.cs
- SiteMapHierarchicalDataSourceView.cs
- StatusBarPanel.cs
- SHA512CryptoServiceProvider.cs
- WindowsAuthenticationModule.cs
- SolidBrush.cs
- MemoryMappedViewStream.cs
- XmlNode.cs
- SqlFacetAttribute.cs
- TextEditorSpelling.cs
- HMACSHA512.cs
- HMACSHA256.cs
- StylusPointProperty.cs
- ExtensionsSection.cs
- EncodingInfo.cs
- MultiAsyncResult.cs
- DurationConverter.cs
- OleDbDataAdapter.cs
- ControlCollection.cs
- CheckBoxBaseAdapter.cs
- Selection.cs
- MergablePropertyAttribute.cs
- DSASignatureDeformatter.cs
- ScriptManagerProxy.cs
- UserUseLicenseDictionaryLoader.cs
- ClientCultureInfo.cs
- sqlmetadatafactory.cs
- SystemBrushes.cs
- RequestCachingSection.cs
- GridViewCommandEventArgs.cs
- ButtonChrome.cs
- DataGridViewComponentPropertyGridSite.cs
- DiscoveryRequestHandler.cs
- Cell.cs
- EtwTrace.cs
- Ray3DHitTestResult.cs
- GridItemPatternIdentifiers.cs
- DiscoveryClient.cs
- EventToken.cs
- TransactedBatchingElement.cs
- PaintEvent.cs
- LinearKeyFrames.cs
- Msec.cs
- Int16Animation.cs
- CuspData.cs
- DbXmlEnabledProviderManifest.cs
- AnimationClockResource.cs
- TimelineGroup.cs
- WebSysDescriptionAttribute.cs
- AnnotationResourceCollection.cs
- ComponentCache.cs
- EncoderParameters.cs
- XmlExtensionFunction.cs
- SerialPort.cs
- HttpRequest.cs
- Section.cs
- Currency.cs
- FigureParagraph.cs
- HtmlAnchor.cs
- UiaCoreProviderApi.cs
- FileEnumerator.cs
- SoapSchemaExporter.cs
- FormCollection.cs
- WmpBitmapEncoder.cs
- BufferedStream.cs
- PersonalizablePropertyEntry.cs
- SqlBinder.cs
- DirectionalLight.cs
- SingleConverter.cs
- HMAC.cs
- RemoteHelper.cs
- DbTransaction.cs
- Int32AnimationUsingKeyFrames.cs
- DrawItemEvent.cs
- Activity.cs
- CompareInfo.cs
- DoubleLinkList.cs
- DataSet.cs
- CommandField.cs
- DataGridViewLinkColumn.cs
- RoleManagerSection.cs
- SymbolMethod.cs
- MyContact.cs
- ExplicitDiscriminatorMap.cs
- DataListItemEventArgs.cs
- Compiler.cs
- FontDifferentiator.cs
- DocumentSignatureManager.cs
- ListViewEditEventArgs.cs
- SafeSecurityHandles.cs
- StylusDownEventArgs.cs
- ReliableRequestSessionChannel.cs
- DefaultTextStore.cs
- InfoCard.cs
- Transform.cs
- BitmapEffect.cs
- KnownTypeDataContractResolver.cs
- TypeResolver.cs
- WebPartZoneBaseDesigner.cs
- Baml2006ReaderSettings.cs