Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / Reflection / __Filters.cs / 2 / __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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ReadOnlyTernaryTree.cs
- ToolStripGripRenderEventArgs.cs
- SiteMapNodeItem.cs
- WebServiceTypeData.cs
- ClientCultureInfo.cs
- unsafenativemethodsother.cs
- TextParagraphProperties.cs
- RoleManagerEventArgs.cs
- MenuItemCollection.cs
- SegmentInfo.cs
- SHA1Cng.cs
- CallInfo.cs
- RuntimeConfigLKG.cs
- MonitorWrapper.cs
- RenderData.cs
- ActivityIdHeader.cs
- DecimalAnimationUsingKeyFrames.cs
- GenericNameHandler.cs
- FeatureSupport.cs
- DrawListViewColumnHeaderEventArgs.cs
- ImageCodecInfoPrivate.cs
- MD5CryptoServiceProvider.cs
- RandomNumberGenerator.cs
- ArrayTypeMismatchException.cs
- SafeFileMapViewHandle.cs
- MinimizableAttributeTypeConverter.cs
- ProviderIncompatibleException.cs
- DrawingContextWalker.cs
- CodeGenerator.cs
- InheritanceAttribute.cs
- Latin1Encoding.cs
- FamilyTypefaceCollection.cs
- FileSystemWatcher.cs
- TriggerBase.cs
- PropertyMappingExceptionEventArgs.cs
- ImportOptions.cs
- ActivityIdHeader.cs
- IsolationInterop.cs
- GridItem.cs
- QuadraticBezierSegment.cs
- FormsAuthenticationUserCollection.cs
- WebPartManagerDesigner.cs
- InkPresenter.cs
- AlternateViewCollection.cs
- ListViewGroup.cs
- ProjectionCamera.cs
- _ListenerResponseStream.cs
- RelationshipNavigation.cs
- URLString.cs
- ContainerParaClient.cs
- SyntaxCheck.cs
- ServiceXNameTypeConverter.cs
- CommittableTransaction.cs
- DataViewManager.cs
- SystemDiagnosticsSection.cs
- BaseCodeDomTreeGenerator.cs
- WebPartEditorOkVerb.cs
- WebBrowserNavigatingEventHandler.cs
- ForceCopyBuildProvider.cs
- SortedSet.cs
- LocalizableAttribute.cs
- CompoundFileDeflateTransform.cs
- EnterpriseServicesHelper.cs
- DataGridViewCell.cs
- Enlistment.cs
- ToolStripTemplateNode.cs
- TypeReference.cs
- TrackingProfileCache.cs
- AnonymousIdentificationSection.cs
- FilterQuery.cs
- TdsParserStaticMethods.cs
- ProcessModelInfo.cs
- SymbolType.cs
- ScriptHandlerFactory.cs
- ModelUIElement3D.cs
- WebPartConnectionsDisconnectVerb.cs
- FileSystemEventArgs.cs
- RequestCachingSection.cs
- Page.cs
- ProxyAttribute.cs
- WebServiceEnumData.cs
- SystemUdpStatistics.cs
- ThreadSafeList.cs
- TextChange.cs
- EntityDataSourceValidationException.cs
- SizeAnimationClockResource.cs
- DelegateSerializationHolder.cs
- DataGridViewCellCollection.cs
- ScriptingAuthenticationServiceSection.cs
- cookieexception.cs
- SqlBulkCopyColumnMappingCollection.cs
- DefaultPrintController.cs
- ByteRangeDownloader.cs
- ConfigurationElementProperty.cs
- HashHelper.cs
- DocumentAutomationPeer.cs
- FontFamily.cs
- IsolatedStorageFileStream.cs
- XmlSchemaProviderAttribute.cs