Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- ContextMarshalException.cs
- ByValueEqualityComparer.cs
- HttpApplicationFactory.cs
- PenLineCapValidation.cs
- XamlGridLengthSerializer.cs
- __TransparentProxy.cs
- FileUpload.cs
- JournalEntry.cs
- DBConnection.cs
- RoutingChannelExtension.cs
- ToolStripScrollButton.cs
- RepeaterItemEventArgs.cs
- TcpConnectionPoolSettings.cs
- NetMsmqSecurityMode.cs
- SQLConvert.cs
- InitiatorSessionSymmetricMessageSecurityProtocol.cs
- LocalizableAttribute.cs
- Trace.cs
- MulticastIPAddressInformationCollection.cs
- OpCellTreeNode.cs
- LocalizationParserHooks.cs
- SymbolType.cs
- fixedPageContentExtractor.cs
- ProfileEventArgs.cs
- Slider.cs
- BorderGapMaskConverter.cs
- ExtensionSurface.cs
- NamedPipeTransportBindingElement.cs
- SpellerStatusTable.cs
- Stylesheet.cs
- codemethodreferenceexpression.cs
- ProxyElement.cs
- PrePrepareMethodAttribute.cs
- Context.cs
- FramingFormat.cs
- RowCache.cs
- BrowserTree.cs
- MappingModelBuildProvider.cs
- IndividualDeviceConfig.cs
- TrustManagerPromptUI.cs
- FontFamily.cs
- sortedlist.cs
- MoveSizeWinEventHandler.cs
- Light.cs
- XmlDataContract.cs
- ProtocolElement.cs
- userdatakeys.cs
- Peer.cs
- Propagator.Evaluator.cs
- PartBasedPackageProperties.cs
- StaticContext.cs
- SupportsEventValidationAttribute.cs
- UnsafeNativeMethods.cs
- StoryFragments.cs
- RegionInfo.cs
- METAHEADER.cs
- TextAdaptor.cs
- IpcChannel.cs
- UIAgentInitializationException.cs
- FixedPageStructure.cs
- TabletCollection.cs
- SchemaAttDef.cs
- PieceDirectory.cs
- ServicePointManagerElement.cs
- UpdateTracker.cs
- SafePointer.cs
- KeyedHashAlgorithm.cs
- PageStatePersister.cs
- InternalDuplexChannelFactory.cs
- HtmlElementEventArgs.cs
- Substitution.cs
- XmlSchemaSubstitutionGroup.cs
- ServiceXNameTypeConverter.cs
- TextFormatterImp.cs
- MarkupProperty.cs
- ArraySubsetEnumerator.cs
- ForwardPositionQuery.cs
- RewritingPass.cs
- MethodBuilderInstantiation.cs
- Typography.cs
- XmlNamespaceManager.cs
- XsltLibrary.cs
- AdornerLayer.cs
- MenuItemStyleCollection.cs
- SizeAnimationUsingKeyFrames.cs
- SQLInt32Storage.cs
- ConfigUtil.cs
- TableStyle.cs
- BitmapSizeOptions.cs
- CodeIdentifiers.cs
- FrameworkName.cs
- HttpHandlersSection.cs
- ThreadSafeList.cs
- PropertyRef.cs
- StylusDownEventArgs.cs
- ToolBarButton.cs
- ConfigXmlWhitespace.cs
- SrgsDocumentParser.cs
- WindowsAuthenticationModule.cs
- TreeBuilder.cs