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
- SqlXmlStorage.cs
- ExpressionConverter.cs
- MailMessage.cs
- ImageConverter.cs
- RankException.cs
- NamespaceInfo.cs
- ListenerChannelContext.cs
- MailHeaderInfo.cs
- OrderedDictionary.cs
- XsdDateTime.cs
- TransportContext.cs
- PersonalizableAttribute.cs
- WebPartTransformerAttribute.cs
- RefExpr.cs
- ThreadExceptionEvent.cs
- ContainerParaClient.cs
- WebPartEditVerb.cs
- ConnectionProviderAttribute.cs
- UpdatePanelTriggerCollection.cs
- Vector3D.cs
- CompositeDispatchFormatter.cs
- MaskPropertyEditor.cs
- sqlstateclientmanager.cs
- StylusPoint.cs
- DesignerValidationSummaryAdapter.cs
- MulticastNotSupportedException.cs
- METAHEADER.cs
- TextProperties.cs
- ListChangedEventArgs.cs
- FacetDescriptionElement.cs
- CodeSnippetTypeMember.cs
- IndicCharClassifier.cs
- ProxyWebPartConnectionCollection.cs
- InternalConfigHost.cs
- VirtualizingPanel.cs
- MimePart.cs
- PolicyReader.cs
- WebPartAuthorizationEventArgs.cs
- UnSafeCharBuffer.cs
- WorkflowInstanceExtensionCollection.cs
- SoapClientProtocol.cs
- TcpServerChannel.cs
- BinaryUtilClasses.cs
- SimpleApplicationHost.cs
- AnnotationComponentChooser.cs
- WebConfigurationFileMap.cs
- SoapAttributeAttribute.cs
- ApplicationSecurityManager.cs
- PieceNameHelper.cs
- SoapIgnoreAttribute.cs
- NewArray.cs
- AuthenticationConfig.cs
- BaseParser.cs
- DockAndAnchorLayout.cs
- RequestTimeoutManager.cs
- PriorityItem.cs
- CryptoConfig.cs
- DataRowComparer.cs
- SqlDataSourceFilteringEventArgs.cs
- AppModelKnownContentFactory.cs
- ConfigurationManager.cs
- KnownBoxes.cs
- TextMessageEncodingElement.cs
- DefaultParameterValueAttribute.cs
- PropertyPathWorker.cs
- BufferModesCollection.cs
- UrlPath.cs
- LocatorBase.cs
- FullTextState.cs
- DataSourceConverter.cs
- SecureEnvironment.cs
- DiagnosticsElement.cs
- GeneratedCodeAttribute.cs
- FileVersionInfo.cs
- Vector3D.cs
- grammarelement.cs
- WebBrowserNavigatedEventHandler.cs
- externdll.cs
- RawStylusInput.cs
- TdsParserStateObject.cs
- Clock.cs
- SingleSelectRootGridEntry.cs
- TimeoutException.cs
- SamlAssertion.cs
- DataServiceClientException.cs
- ExpressionEditorAttribute.cs
- HtmlWindow.cs
- Propagator.JoinPropagator.cs
- DbParameterCollectionHelper.cs
- InArgumentConverter.cs
- SplitContainer.cs
- MetadataSource.cs
- DynamicField.cs
- VectorAnimationBase.cs
- DbQueryCommandTree.cs
- StoreItemCollection.cs
- StateDesignerConnector.cs
- CngProvider.cs
- Graphics.cs
- TimelineGroup.cs