Code:
/ DotNET / DotNET / 8.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
- QilIterator.cs
- PreviewPrintController.cs
- _FixedSizeReader.cs
- DataSvcMapFile.cs
- SQLString.cs
- DbXmlEnabledProviderManifest.cs
- ElementNotEnabledException.cs
- WebContext.cs
- TransformedBitmap.cs
- RepeaterDataBoundAdapter.cs
- TextTreeInsertUndoUnit.cs
- TypeConverters.cs
- KeyToListMap.cs
- Light.cs
- Attachment.cs
- RSAOAEPKeyExchangeDeformatter.cs
- columnmapfactory.cs
- KeySpline.cs
- X509CertificateRecipientServiceCredential.cs
- ThreadAttributes.cs
- SourceItem.cs
- DynamicILGenerator.cs
- List.cs
- SmtpClient.cs
- PtsContext.cs
- ScrollEvent.cs
- WmlTextBoxAdapter.cs
- BitmapImage.cs
- NetworkCredential.cs
- TypeDescriptionProviderAttribute.cs
- Int32EqualityComparer.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- SHA1CryptoServiceProvider.cs
- InternalConfigRoot.cs
- ManifestResourceInfo.cs
- DictionaryGlobals.cs
- VariableModifiersHelper.cs
- UnsafeNativeMethods.cs
- ContentPosition.cs
- WebServiceBindingAttribute.cs
- EtwTrace.cs
- RequiredAttributeAttribute.cs
- QuaternionAnimation.cs
- InputLanguageEventArgs.cs
- SQLString.cs
- GeometryCollection.cs
- FontDifferentiator.cs
- DataGridViewColumnCollectionDialog.cs
- StdValidatorsAndConverters.cs
- OletxResourceManager.cs
- StagingAreaInputItem.cs
- DrawingServices.cs
- ElementUtil.cs
- _LazyAsyncResult.cs
- MaxMessageSizeStream.cs
- ExpressionVisitor.cs
- FaultContractInfo.cs
- AnonymousIdentificationModule.cs
- WeakEventManager.cs
- PreProcessInputEventArgs.cs
- EmptyCollection.cs
- GridProviderWrapper.cs
- Drawing.cs
- CodeDomComponentSerializationService.cs
- SrgsElementFactoryCompiler.cs
- EnumerableRowCollectionExtensions.cs
- Stroke2.cs
- TextTreeFixupNode.cs
- SecurityTokenResolver.cs
- SessionParameter.cs
- TemplateXamlParser.cs
- ListenerElementsCollection.cs
- MarkupExtensionParser.cs
- DomNameTable.cs
- ObjectStorage.cs
- BaseCAMarshaler.cs
- EventLogger.cs
- CompilerTypeWithParams.cs
- ArrayExtension.cs
- TypedTableBase.cs
- HttpWebRequest.cs
- DetailsViewPagerRow.cs
- ReflectionServiceProvider.cs
- ButtonStandardAdapter.cs
- OleDbConnectionFactory.cs
- CompositeFontInfo.cs
- ListViewSortEventArgs.cs
- DataGridViewButtonColumn.cs
- Privilege.cs
- DESCryptoServiceProvider.cs
- StandardRuntimeEnumValidatorAttribute.cs
- LeafCellTreeNode.cs
- bidPrivateBase.cs
- EnumBuilder.cs
- SqlFileStream.cs
- ItemType.cs
- ButtonField.cs
- ByteFacetDescriptionElement.cs
- RNGCryptoServiceProvider.cs
- SwitchElementsCollection.cs