Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- Rights.cs
- PointLight.cs
- SplashScreen.cs
- SoapElementAttribute.cs
- NativeWindow.cs
- MetaChildrenColumn.cs
- ConnectionPointCookie.cs
- MultilineStringConverter.cs
- AutomationFocusChangedEventArgs.cs
- ContainerFilterService.cs
- VirtualPathProvider.cs
- QilStrConcat.cs
- ListArgumentProvider.cs
- ProcessStartInfo.cs
- Completion.cs
- AutomationProperties.cs
- KnownBoxes.cs
- SourceFilter.cs
- WebPartConnectionsEventArgs.cs
- EventLog.cs
- RuleCache.cs
- Lease.cs
- WebConfigurationFileMap.cs
- CompressedStack.cs
- WebPartUtil.cs
- CfgRule.cs
- OverlappedAsyncResult.cs
- PeerPresenceInfo.cs
- DataGridRow.cs
- SchemaSetCompiler.cs
- Paragraph.cs
- XsltSettings.cs
- ListParagraph.cs
- DependencyPropertyKind.cs
- glyphs.cs
- Deflater.cs
- XmlChildEnumerator.cs
- SystemTcpConnection.cs
- PeerDefaultCustomResolverClient.cs
- PropertyMetadata.cs
- WebPartManager.cs
- CrossSiteScriptingValidation.cs
- BindingContext.cs
- TabControl.cs
- ListBase.cs
- TransportElement.cs
- WebSysDescriptionAttribute.cs
- SiteMapHierarchicalDataSourceView.cs
- OdbcUtils.cs
- TemplateControlParser.cs
- KnownColorTable.cs
- BufferModeSettings.cs
- ResolveMatchesApril2005.cs
- SessionParameter.cs
- SocketAddress.cs
- DataGridPagerStyle.cs
- StdRegProviderWrapper.cs
- AutomationPatternInfo.cs
- HttpServerVarsCollection.cs
- EventNotify.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- Material.cs
- WeakReferenceEnumerator.cs
- StylusPointProperties.cs
- PreApplicationStartMethodAttribute.cs
- DataGridViewColumnHeaderCell.cs
- SemaphoreSlim.cs
- NavigatorOutput.cs
- ADRoleFactory.cs
- XmlSchemaSimpleTypeList.cs
- GridViewDeletedEventArgs.cs
- DataSourceNameHandler.cs
- BamlLocalizableResourceKey.cs
- Marshal.cs
- SimpleTypeResolver.cs
- ExecutionScope.cs
- HashCodeCombiner.cs
- WebPartConnectionsDisconnectVerb.cs
- SqlClientWrapperSmiStreamChars.cs
- DateTimeSerializationSection.cs
- DrawingCollection.cs
- Pkcs7Recipient.cs
- CategoryEditor.cs
- ZoneMembershipCondition.cs
- Vector3DCollection.cs
- SqlCommandBuilder.cs
- BinaryObjectReader.cs
- DiscardableAttribute.cs
- ButtonAutomationPeer.cs
- GridViewDeleteEventArgs.cs
- NumberFormatInfo.cs
- StreamGeometry.cs
- EventLogEntryCollection.cs
- RectangleConverter.cs
- InheritablePropertyChangeInfo.cs
- Vector.cs
- SchemaSetCompiler.cs
- mansign.cs
- LayoutEditorPart.cs
- Int32Converter.cs