Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / Reflection / __Filters.cs / 2 / __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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- VBCodeProvider.cs
- FixedSOMPage.cs
- InfiniteTimeSpanConverter.cs
- StylusLogic.cs
- HtmlTernaryTree.cs
- PackWebResponse.cs
- MenuAutomationPeer.cs
- UserThread.cs
- PointF.cs
- HelpOperationInvoker.cs
- WriteLine.cs
- HMACSHA512.cs
- AnimationStorage.cs
- XmlHierarchicalDataSourceView.cs
- GridViewEditEventArgs.cs
- GeneratedContractType.cs
- Geometry.cs
- XmlILCommand.cs
- XmlChildNodes.cs
- StrokeDescriptor.cs
- ZipIOLocalFileHeader.cs
- CqlParser.cs
- CommandArguments.cs
- SinglePageViewer.cs
- PersonalizationStateInfo.cs
- LightweightCodeGenerator.cs
- LogExtent.cs
- SerializationFieldInfo.cs
- CryptoApi.cs
- ColumnMapVisitor.cs
- Vector3DIndependentAnimationStorage.cs
- PropertyPath.cs
- DbProviderFactories.cs
- DataGridView.cs
- TextElementEditingBehaviorAttribute.cs
- XmlWriterSettings.cs
- RelationshipFixer.cs
- ReverseInheritProperty.cs
- SiteMapNodeItem.cs
- ClipboardProcessor.cs
- MonitorWrapper.cs
- WebPartsSection.cs
- Attributes.cs
- ImageCollectionCodeDomSerializer.cs
- UriSchemeKeyedCollection.cs
- EventLogEntry.cs
- URLBuilder.cs
- BuildManagerHost.cs
- DataGridViewColumnStateChangedEventArgs.cs
- WriteStateInfoBase.cs
- StaticSiteMapProvider.cs
- DataGridColumn.cs
- SchemaImporter.cs
- SchemaSetCompiler.cs
- NamespaceEmitter.cs
- LogicalTreeHelper.cs
- Transactions.cs
- PropertyEntry.cs
- ToolStripSplitStackLayout.cs
- MessageQueuePermissionEntryCollection.cs
- WebPartExportVerb.cs
- AspNetSynchronizationContext.cs
- BitmapEffectInputData.cs
- NavigationHelper.cs
- SerializationObjectManager.cs
- RawStylusInput.cs
- Literal.cs
- RefExpr.cs
- MethodImplAttribute.cs
- TextParagraphCache.cs
- XmlReflectionMember.cs
- OletxVolatileEnlistment.cs
- DataGridViewLayoutData.cs
- AesManaged.cs
- XPathDescendantIterator.cs
- BuilderPropertyEntry.cs
- TypefaceMap.cs
- GatewayDefinition.cs
- SafeBitVector32.cs
- HotSpotCollectionEditor.cs
- BasicCellRelation.cs
- ProxyManager.cs
- EntityConnectionStringBuilder.cs
- CachedCompositeFamily.cs
- PngBitmapDecoder.cs
- JoinTreeNode.cs
- UnmanagedMarshal.cs
- KeyManager.cs
- SqlCommandBuilder.cs
- TagMapInfo.cs
- SessionState.cs
- RepeatButton.cs
- IChannel.cs
- CardSpaceSelector.cs
- WinEventTracker.cs
- DllNotFoundException.cs
- FormattedText.cs
- ConfigurationElementProperty.cs
- SignedPkcs7.cs
- TextServicesDisplayAttribute.cs