Code:
/ FX-1434 / FX-1434 / 1.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
- MyContact.cs
- XmlDigitalSignatureProcessor.cs
- WSSecurityPolicy12.cs
- ObjectToIdCache.cs
- CanonicalFormWriter.cs
- WindowsFormsHost.cs
- COM2ExtendedBrowsingHandler.cs
- HtmlWindowCollection.cs
- MetadataItemSerializer.cs
- GeometryHitTestParameters.cs
- TableLayoutPanel.cs
- QualifiedCellIdBoolean.cs
- ClockController.cs
- TextParaClient.cs
- MenuBase.cs
- SectionInformation.cs
- ClientSettingsProvider.cs
- DefaultAutoFieldGenerator.cs
- TextServicesProperty.cs
- AppDomain.cs
- DataGridTablesFactory.cs
- MeshGeometry3D.cs
- FilteredXmlReader.cs
- DataConnectionHelper.cs
- MiniConstructorInfo.cs
- WebServiceEnumData.cs
- StorageComplexTypeMapping.cs
- PerfCounterSection.cs
- ExternalException.cs
- ValidationErrorEventArgs.cs
- TextOnlyOutput.cs
- ExecutionContext.cs
- CacheMemory.cs
- PartialCachingAttribute.cs
- CodeLinePragma.cs
- SafeMemoryMappedFileHandle.cs
- DataStorage.cs
- ScriptModule.cs
- BitmapCache.cs
- VisualTreeHelper.cs
- XmlAttributeHolder.cs
- FamilyMapCollection.cs
- NumberSubstitution.cs
- AttributeQuery.cs
- SortAction.cs
- EventHandlersStore.cs
- TripleDESCryptoServiceProvider.cs
- DockPatternIdentifiers.cs
- SimpleWebHandlerParser.cs
- GridViewSelectEventArgs.cs
- NumericPagerField.cs
- BinaryNode.cs
- SelectionListComponentEditor.cs
- CodeParameterDeclarationExpressionCollection.cs
- WebPartEditorCancelVerb.cs
- __Error.cs
- LiteralDesigner.cs
- CodeExpressionCollection.cs
- InvalidOleVariantTypeException.cs
- Storyboard.cs
- webproxy.cs
- RuleConditionDialog.Designer.cs
- Material.cs
- XmlChoiceIdentifierAttribute.cs
- BackEase.cs
- PocoEntityKeyStrategy.cs
- XmlnsPrefixAttribute.cs
- ParallelQuery.cs
- DataGridViewCellContextMenuStripNeededEventArgs.cs
- DataObjectSettingDataEventArgs.cs
- MenuItemBinding.cs
- RangeValidator.cs
- SupportsPreviewControlAttribute.cs
- ScrollProviderWrapper.cs
- SafeProcessHandle.cs
- ToolStripItemClickedEventArgs.cs
- ILGenerator.cs
- TargetFrameworkAttribute.cs
- SpecialTypeDataContract.cs
- FontStretches.cs
- StackSpiller.Generated.cs
- EventDescriptor.cs
- WebPartConnectionsEventArgs.cs
- followingsibling.cs
- CodeGenerator.cs
- SecurityNegotiationException.cs
- TimeSpanStorage.cs
- OptimalBreakSession.cs
- ListChangedEventArgs.cs
- TreeWalker.cs
- _BufferOffsetSize.cs
- WindowsToolbar.cs
- TokenizerHelper.cs
- SplayTreeNode.cs
- Byte.cs
- OdbcConnectionStringbuilder.cs
- FontNamesConverter.cs
- BaseTemplateParser.cs
- ServicePointManager.cs
- AppendHelper.cs