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
- IUnknownConstantAttribute.cs
- TraceInternal.cs
- XmlElementList.cs
- ComponentFactoryHelpers.cs
- ApplicationDirectory.cs
- DateTimeAutomationPeer.cs
- Perspective.cs
- PermissionRequestEvidence.cs
- TableRowCollection.cs
- XmlSchema.cs
- PrinterSettings.cs
- DataTrigger.cs
- TriggerBase.cs
- GridItemCollection.cs
- StylusPointProperties.cs
- ReaderWriterLockSlim.cs
- WrapperEqualityComparer.cs
- ManualResetEventSlim.cs
- SoapSchemaMember.cs
- InternalConfigEventArgs.cs
- CharacterMetricsDictionary.cs
- ChildTable.cs
- MachineSettingsSection.cs
- Utility.cs
- SystemIPGlobalStatistics.cs
- TryCatch.cs
- SocketInformation.cs
- TypeBuilderInstantiation.cs
- NetTcpBindingElement.cs
- AuthenticationSchemesHelper.cs
- XmlSerializer.cs
- HttpProfileGroupBase.cs
- TextDecorationCollectionConverter.cs
- _SSPISessionCache.cs
- DrawingCollection.cs
- HttpCookie.cs
- EntityDataSourceMemberPath.cs
- BuildProvidersCompiler.cs
- FileLogRecord.cs
- PersonalizationAdministration.cs
- MessageSecurityVersion.cs
- KeyValueSerializer.cs
- FlowDocument.cs
- SqlDependencyListener.cs
- CacheEntry.cs
- ValidationResult.cs
- Int32.cs
- ClientScriptItemCollection.cs
- SoapClientProtocol.cs
- ClientTarget.cs
- Margins.cs
- Graphics.cs
- TextSpan.cs
- WebPartConnectionsEventArgs.cs
- __ConsoleStream.cs
- NetCodeGroup.cs
- RelationshipSet.cs
- DefaultSettingsSection.cs
- RemoteDebugger.cs
- ObjectReaderCompiler.cs
- DesignerCategoryAttribute.cs
- HttpPostClientProtocol.cs
- FixedTextContainer.cs
- COAUTHINFO.cs
- PersistenceTypeAttribute.cs
- PointAnimationClockResource.cs
- AppSettingsReader.cs
- MailDefinition.cs
- LineUtil.cs
- WebPartDisplayModeCollection.cs
- XamlStyleSerializer.cs
- ServiceOperationParameter.cs
- ListenerHandler.cs
- MobileContainerDesigner.cs
- TriggerActionCollection.cs
- XmlSerializableServices.cs
- DynamicObject.cs
- DPCustomTypeDescriptor.cs
- DuplexSecurityProtocolFactory.cs
- DescendentsWalker.cs
- UnionCqlBlock.cs
- PageRouteHandler.cs
- BooleanFacetDescriptionElement.cs
- WebPartZoneBase.cs
- UIPermission.cs
- BaseProcessProtocolHandler.cs
- ExpandCollapsePattern.cs
- DateTimeUtil.cs
- WindowsSspiNegotiation.cs
- NamespaceDecl.cs
- ResourceDictionary.cs
- UInt32.cs
- ListViewItemEventArgs.cs
- DBConnection.cs
- CheckBox.cs
- LineSegment.cs
- TemplatedAdorner.cs
- InvokeMethodActivity.cs
- ConfigXmlCDataSection.cs
- FloatSumAggregationOperator.cs