Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Reflection / __Filters.cs / 1305376 / __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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- FileRecordSequenceHelper.cs
- EntityDataSourceSelectingEventArgs.cs
- figurelength.cs
- CultureMapper.cs
- TcpHostedTransportConfiguration.cs
- UnmanagedMarshal.cs
- ISessionStateStore.cs
- SamlSecurityTokenAuthenticator.cs
- SymbolEqualComparer.cs
- ConfigurationException.cs
- DataGridViewCellStyle.cs
- FlowDocument.cs
- FileCodeGroup.cs
- DataControlFieldHeaderCell.cs
- ParseElementCollection.cs
- RectKeyFrameCollection.cs
- ReferenceSchema.cs
- EventSinkActivity.cs
- KeyBinding.cs
- ErrorFormatterPage.cs
- IsolatedStorageException.cs
- MobileSysDescriptionAttribute.cs
- DateTimeFormat.cs
- FileUpload.cs
- QilInvoke.cs
- ChtmlLinkAdapter.cs
- SelectionGlyphBase.cs
- XmlSchemaType.cs
- ADConnectionHelper.cs
- DirectoryLocalQuery.cs
- FamilyMapCollection.cs
- XmlNamespaceManager.cs
- Dictionary.cs
- KnowledgeBase.cs
- CounterCreationData.cs
- ActivityStatusChangeEventArgs.cs
- ObjectQueryProvider.cs
- EntitySqlQueryCacheEntry.cs
- MessageBox.cs
- XmlSchemaSimpleTypeList.cs
- CompositeActivityCodeGenerator.cs
- InvalidOperationException.cs
- DataGridViewHeaderCell.cs
- XmlSchemaAnyAttribute.cs
- IDQuery.cs
- DiffuseMaterial.cs
- RowsCopiedEventArgs.cs
- PersonalizationProviderCollection.cs
- SchemaImporter.cs
- TablePattern.cs
- PageThemeBuildProvider.cs
- ConfigXmlElement.cs
- FontInfo.cs
- DataIdProcessor.cs
- GridSplitterAutomationPeer.cs
- activationcontext.cs
- ElementNotAvailableException.cs
- CqlParser.cs
- RouteCollection.cs
- Math.cs
- ListViewItemMouseHoverEvent.cs
- TextParagraphView.cs
- FastEncoder.cs
- TextRenderer.cs
- Converter.cs
- HighlightComponent.cs
- BaseValidator.cs
- WindowsNonControl.cs
- Conditional.cs
- DataGridItem.cs
- TransformerInfoCollection.cs
- PerformanceCounterManager.cs
- XPathArrayIterator.cs
- ControlEvent.cs
- IdentityHolder.cs
- JsonWriterDelegator.cs
- WebReferencesBuildProvider.cs
- EncryptedType.cs
- NeutralResourcesLanguageAttribute.cs
- CommandBindingCollection.cs
- ActiveDocumentEvent.cs
- CodeEventReferenceExpression.cs
- MetadataArtifactLoaderXmlReaderWrapper.cs
- SqlBooleanMismatchVisitor.cs
- DbTransaction.cs
- ChangeToolStripParentVerb.cs
- Expander.cs
- CriticalHandle.cs
- QilXmlWriter.cs
- GradientStopCollection.cs
- MimeMultiPart.cs
- EdmSchemaError.cs
- RadioButtonStandardAdapter.cs
- CacheDependency.cs
- FixUp.cs
- ObjectHandle.cs
- WebServiceData.cs
- Int32Storage.cs
- CheckBoxAutomationPeer.cs
- DockProviderWrapper.cs