Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TypeResolvingOptions.cs
- SiteOfOriginPart.cs
- LoginNameDesigner.cs
- RadioButtonDesigner.cs
- UrlMappingsSection.cs
- LinqDataSourceDeleteEventArgs.cs
- ApplicationInfo.cs
- CapabilitiesRule.cs
- DataTemplateKey.cs
- DirtyTextRange.cs
- OperationAbortedException.cs
- ToolStripItemTextRenderEventArgs.cs
- JsonGlobals.cs
- ToolStripPanelCell.cs
- StatusBarAutomationPeer.cs
- DefaultValueAttribute.cs
- DbDataSourceEnumerator.cs
- WebBrowser.cs
- StylusPointProperty.cs
- PingOptions.cs
- DynamicDataManager.cs
- RewritingProcessor.cs
- CryptoKeySecurity.cs
- TableSectionStyle.cs
- OleDbParameterCollection.cs
- Point.cs
- ImageField.cs
- MobilePage.cs
- NavigationPropertySingletonExpression.cs
- XamlContextStack.cs
- MouseGestureValueSerializer.cs
- PrinterUnitConvert.cs
- MarkerProperties.cs
- RSAPKCS1SignatureDeformatter.cs
- XPathConvert.cs
- ClientSponsor.cs
- SerializerDescriptor.cs
- StrokeIntersection.cs
- SystemInfo.cs
- StringBlob.cs
- SqlProfileProvider.cs
- StringComparer.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- AssociationTypeEmitter.cs
- MessageEventSubscriptionService.cs
- RSAPKCS1KeyExchangeFormatter.cs
- WebPartConnectionsConfigureVerb.cs
- DataGridViewImageColumn.cs
- PathGradientBrush.cs
- ExpressionEditorAttribute.cs
- SQLDateTime.cs
- SerializerProvider.cs
- MexServiceChannelBuilder.cs
- ConfigPathUtility.cs
- AttributeTable.cs
- SQLBinary.cs
- CryptoStream.cs
- _LoggingObject.cs
- DependencyPropertyKey.cs
- OutOfProcStateClientManager.cs
- CollectionContainer.cs
- GraphicsState.cs
- ConfigurationProperty.cs
- LoadItemsEventArgs.cs
- AssemblyHash.cs
- XamlGridLengthSerializer.cs
- StreamWriter.cs
- PassportAuthenticationModule.cs
- FolderLevelBuildProvider.cs
- TextRangeEdit.cs
- CodeTypeConstructor.cs
- AutomationEvent.cs
- AuthenticationService.cs
- Queue.cs
- QuotedPrintableStream.cs
- FontStyle.cs
- ImageAutomationPeer.cs
- GenericsNotImplementedException.cs
- HMACSHA512.cs
- CngKeyCreationParameters.cs
- _OSSOCK.cs
- ListControlConvertEventArgs.cs
- SamlSecurityToken.cs
- NativeMethods.cs
- RegexRunnerFactory.cs
- CreateUserWizardStep.cs
- ProxySimple.cs
- OdbcStatementHandle.cs
- NativeMethods.cs
- MethodExpr.cs
- messageonlyhwndwrapper.cs
- SmiEventStream.cs
- SplitContainer.cs
- PerformanceCounterLib.cs
- WbemException.cs
- StorageComplexTypeMapping.cs
- ProtocolsConfigurationHandler.cs
- ProjectionCamera.cs
- HtmlShim.cs
- Hash.cs