Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- ExceptionAggregator.cs
- OdbcReferenceCollection.cs
- GACMembershipCondition.cs
- CollectionContainer.cs
- SemanticResolver.cs
- MultiTargetingUtil.cs
- OleDbMetaDataFactory.cs
- PreviewControlDesigner.cs
- regiisutil.cs
- MetricEntry.cs
- NegatedConstant.cs
- SqlDataReaderSmi.cs
- ZipIOExtraField.cs
- XPathNavigator.cs
- DirectoryInfo.cs
- QuaternionKeyFrameCollection.cs
- EdmRelationshipRoleAttribute.cs
- DictionaryEntry.cs
- DeviceContext.cs
- ConditionChanges.cs
- WebPermission.cs
- NamedPipeTransportManager.cs
- IOException.cs
- XmlIgnoreAttribute.cs
- ProxyGenerator.cs
- ProxyElement.cs
- ThaiBuddhistCalendar.cs
- XmlDataSourceNodeDescriptor.cs
- CodePageUtils.cs
- GridProviderWrapper.cs
- DependencyObjectPropertyDescriptor.cs
- SqlCacheDependencyDatabase.cs
- CombinedTcpChannel.cs
- HttpFileCollectionWrapper.cs
- DbProviderServices.cs
- Cell.cs
- LayoutEvent.cs
- QilInvokeLateBound.cs
- WindowsTab.cs
- BindToObject.cs
- XmlSerializerAssemblyAttribute.cs
- NameNode.cs
- CompilerWrapper.cs
- XmlTextWriter.cs
- Facet.cs
- WebPartMenu.cs
- FixedDocumentPaginator.cs
- WebBrowserProgressChangedEventHandler.cs
- ContainsRowNumberChecker.cs
- ContentWrapperAttribute.cs
- WebServicesDescriptionAttribute.cs
- SpeakInfo.cs
- DataSourceControlBuilder.cs
- GridItemProviderWrapper.cs
- MergeFailedEvent.cs
- ListContractAdapter.cs
- MexHttpBindingElement.cs
- X509CertificateCollection.cs
- TypeTypeConverter.cs
- TableItemStyle.cs
- Hashtable.cs
- GacUtil.cs
- BaseTreeIterator.cs
- safelink.cs
- EntityDataSourceWrapper.cs
- QueryAccessibilityHelpEvent.cs
- ReadOnlyDataSourceView.cs
- XmlCollation.cs
- BuilderPropertyEntry.cs
- CodePageUtils.cs
- Point3DAnimation.cs
- ChildDocumentBlock.cs
- DecoderReplacementFallback.cs
- MultiBindingExpression.cs
- OleAutBinder.cs
- IncrementalHitTester.cs
- FrameworkObject.cs
- CFGGrammar.cs
- ImmutableCollection.cs
- wgx_exports.cs
- QilExpression.cs
- MapPathBasedVirtualPathProvider.cs
- ManipulationInertiaStartingEventArgs.cs
- PointLight.cs
- EventMap.cs
- OracleCommandBuilder.cs
- MaterializeFromAtom.cs
- ImageIndexConverter.cs
- TextElementAutomationPeer.cs
- SchemaHelper.cs
- AssertSection.cs
- Selection.cs
- Button.cs
- CheckBoxAutomationPeer.cs
- SqlErrorCollection.cs
- SqlDataSourceFilteringEventArgs.cs
- TableHeaderCell.cs
- PrintDocument.cs
- NetCodeGroup.cs
- HandleCollector.cs