Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- SkinIDTypeConverter.cs
- UInt32.cs
- SystemWebSectionGroup.cs
- SettingsContext.cs
- CacheSection.cs
- ControlAdapter.cs
- HttpApplication.cs
- Application.cs
- _FtpDataStream.cs
- ClientBuildManagerCallback.cs
- CodeAttributeArgumentCollection.cs
- CanonicalXml.cs
- CodeStatementCollection.cs
- BitmapPalettes.cs
- FontFamily.cs
- BrowserCapabilitiesCodeGenerator.cs
- LifetimeServices.cs
- Code.cs
- UriSectionData.cs
- HttpPostLocalhostServerProtocol.cs
- WebInvokeAttribute.cs
- configsystem.cs
- XmlToDatasetMap.cs
- ToolStripItemRenderEventArgs.cs
- BidPrivateBase.cs
- _NestedMultipleAsyncResult.cs
- XmlMessageFormatter.cs
- ErrorEventArgs.cs
- InkCanvasAutomationPeer.cs
- MDIWindowDialog.cs
- EntityConnectionStringBuilder.cs
- TemplateBuilder.cs
- mda.cs
- XmlSortKey.cs
- ParserOptions.cs
- CqlLexerHelpers.cs
- UnsignedPublishLicense.cs
- AssemblyBuilder.cs
- TransformPattern.cs
- MatcherBuilder.cs
- LoginUtil.cs
- DataColumnSelectionConverter.cs
- LogEntry.cs
- ComPlusTypeValidator.cs
- EventLogInternal.cs
- FrugalMap.cs
- XmlElementAttributes.cs
- BitmapMetadataEnumerator.cs
- ObservableCollection.cs
- SmuggledIUnknown.cs
- _FtpDataStream.cs
- FilterableAttribute.cs
- DataMember.cs
- EntityModelBuildProvider.cs
- DuplicateDetector.cs
- AdRotator.cs
- SortQuery.cs
- RenderOptions.cs
- RewritingValidator.cs
- RegionData.cs
- DataConnectionHelper.cs
- XDeferredAxisSource.cs
- OleCmdHelper.cs
- SqlDataReader.cs
- XamlStream.cs
- ProtocolsConfigurationHandler.cs
- SafeViewOfFileHandle.cs
- QueuePathDialog.cs
- ToolStripProgressBar.cs
- PrivateFontCollection.cs
- DocumentOrderComparer.cs
- MatrixTransform3D.cs
- TableParaClient.cs
- MailWriter.cs
- PropertyBuilder.cs
- InstanceKeyView.cs
- TextBoxAutomationPeer.cs
- MLangCodePageEncoding.cs
- InputScopeManager.cs
- DrawingContextWalker.cs
- DataGridViewIntLinkedList.cs
- FormatterServices.cs
- BitVector32.cs
- NullableLongSumAggregationOperator.cs
- PriorityItem.cs
- WebControlParameterProxy.cs
- RSACryptoServiceProvider.cs
- EpmContentDeSerializer.cs
- FrameworkElementAutomationPeer.cs
- SamlAuthenticationClaimResource.cs
- ComponentEvent.cs
- TextOptionsInternal.cs
- Pointer.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- WebPartConnectionsConfigureVerb.cs
- ExpressionPrinter.cs
- SettingsBase.cs
- WebPartConnectionsDisconnectVerb.cs
- DataGridPagerStyle.cs
- DataGridRow.cs