Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // 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
- DataTableMappingCollection.cs
- SystemIPv4InterfaceProperties.cs
- DataGridViewCellStateChangedEventArgs.cs
- BitFlagsGenerator.cs
- ToolTip.cs
- UITypeEditor.cs
- ScriptManagerProxy.cs
- FlowPosition.cs
- StateMachineSubscription.cs
- CrossAppDomainChannel.cs
- TraceLevelStore.cs
- ViewManager.cs
- ProcessingInstructionAction.cs
- WindowsNonControl.cs
- Slider.cs
- SqlCacheDependencyDatabase.cs
- UnsafeNativeMethods.cs
- SimpleType.cs
- ServiceElementCollection.cs
- BoundingRectTracker.cs
- BindingBase.cs
- Sorting.cs
- EdmFunction.cs
- Translator.cs
- MultiPropertyDescriptorGridEntry.cs
- LineBreakRecord.cs
- DataGridPageChangedEventArgs.cs
- Quaternion.cs
- TypeLoadException.cs
- XhtmlMobileTextWriter.cs
- AccessText.cs
- LassoSelectionBehavior.cs
- Rotation3D.cs
- StringSorter.cs
- CardSpacePolicyElement.cs
- CodeRegionDirective.cs
- DynamicDiscoveryDocument.cs
- Util.cs
- IndividualDeviceConfig.cs
- DiffuseMaterial.cs
- DbModificationCommandTree.cs
- XmlWriterSettings.cs
- ImageConverter.cs
- AggregateNode.cs
- PeerMessageDispatcher.cs
- RootAction.cs
- Tag.cs
- EntityCommandCompilationException.cs
- SoapIncludeAttribute.cs
- ScriptRef.cs
- ExecutedRoutedEventArgs.cs
- UserControlFileEditor.cs
- TextDecorations.cs
- CodeComment.cs
- GridViewRowEventArgs.cs
- UpdatePanel.cs
- XamlInterfaces.cs
- SizeConverter.cs
- TreeIterators.cs
- SqlOuterApplyReducer.cs
- CacheRequest.cs
- TableCellCollection.cs
- Size.cs
- SiteIdentityPermission.cs
- BitmapEffectDrawingContent.cs
- XmlAttributes.cs
- Debug.cs
- PeerNameResolver.cs
- Style.cs
- NameValueSectionHandler.cs
- ServerTooBusyException.cs
- AsymmetricKeyExchangeDeformatter.cs
- UnsafeNativeMethods.cs
- Journaling.cs
- Signature.cs
- FixedFlowMap.cs
- InputQueueChannel.cs
- VectorAnimationBase.cs
- HierarchicalDataBoundControl.cs
- _UriSyntax.cs
- PackageRelationshipSelector.cs
- __Error.cs
- DataSourceCache.cs
- BooleanKeyFrameCollection.cs
- ImageMapEventArgs.cs
- coordinator.cs
- GPPOINT.cs
- BaseComponentEditor.cs
- InputLanguageProfileNotifySink.cs
- SystemWebCachingSectionGroup.cs
- StringArrayConverter.cs
- bidPrivateBase.cs
- XmlQueryOutput.cs
- MostlySingletonList.cs
- PocoPropertyAccessorStrategy.cs
- TaskHelper.cs
- FontFamily.cs
- TableLayoutPanel.cs
- DebugView.cs
- NamespaceEmitter.cs