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
- RegionData.cs
- Table.cs
- RegistrySecurity.cs
- AuthenticatedStream.cs
- DataGridRow.cs
- ContainerControl.cs
- SystemEvents.cs
- ProfilePropertySettingsCollection.cs
- MatrixConverter.cs
- TypeBuilder.cs
- RuleConditionDialog.cs
- TextCollapsingProperties.cs
- ProtectedConfigurationSection.cs
- IInstanceTable.cs
- SqlDataSourceCache.cs
- DataGridColumnReorderingEventArgs.cs
- ComAdminWrapper.cs
- StorageComplexTypeMapping.cs
- RuntimeConfigurationRecord.cs
- DescendantBaseQuery.cs
- ObjectFullSpanRewriter.cs
- ToolStripMenuItem.cs
- PersonalizationProviderCollection.cs
- SignerInfo.cs
- TypeConverterValueSerializer.cs
- SqlMultiplexer.cs
- TypeDescriptionProvider.cs
- DisplayNameAttribute.cs
- CallbackValidator.cs
- TypeInformation.cs
- ProfileEventArgs.cs
- InternalControlCollection.cs
- OneToOneMappingSerializer.cs
- RegexTree.cs
- BuildProvider.cs
- RootBuilder.cs
- FunctionImportMapping.cs
- Label.cs
- XsdValidatingReader.cs
- ReliableOutputSessionChannel.cs
- AxParameterData.cs
- ComponentManagerBroker.cs
- SamlEvidence.cs
- TextDecorationLocationValidation.cs
- Blend.cs
- FormsAuthenticationUserCollection.cs
- WebPartMovingEventArgs.cs
- WebPageTraceListener.cs
- RichTextBox.cs
- FormsAuthenticationCredentials.cs
- XmlText.cs
- Vector3DValueSerializer.cs
- DecoratedNameAttribute.cs
- UntypedNullExpression.cs
- FormViewInsertedEventArgs.cs
- RouteTable.cs
- Geometry3D.cs
- ParallelRangeManager.cs
- CodeFieldReferenceExpression.cs
- DbDataAdapter.cs
- ScrollableControl.cs
- HotCommands.cs
- AttributeTable.cs
- XXXOnTypeBuilderInstantiation.cs
- CacheOutputQuery.cs
- ConvertEvent.cs
- ArglessEventHandlerProxy.cs
- Tuple.cs
- HttpClientChannel.cs
- DbFunctionCommandTree.cs
- AppDomainShutdownMonitor.cs
- IdentifierCreationService.cs
- ArrayEditor.cs
- SHA384.cs
- DataBoundControlHelper.cs
- HashRepartitionStream.cs
- GridItem.cs
- DrawingContextWalker.cs
- AuthStoreRoleProvider.cs
- Properties.cs
- SystemWebCachingSectionGroup.cs
- ConfigurationPermission.cs
- CompositeScriptReferenceEventArgs.cs
- SafeProcessHandle.cs
- Domain.cs
- MemberListBinding.cs
- SystemColors.cs
- SoapMessage.cs
- FlowDocumentReaderAutomationPeer.cs
- Keyboard.cs
- EventMappingSettingsCollection.cs
- XslTransform.cs
- CacheVirtualItemsEvent.cs
- CultureInfoConverter.cs
- DesignerObjectListAdapter.cs
- Stylesheet.cs
- safex509handles.cs
- WindowsImpersonationContext.cs
- BindingValueChangedEventArgs.cs
- CheckBoxList.cs