Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- MatrixAnimationUsingKeyFrames.cs
- MetroSerializationManager.cs
- serverconfig.cs
- TypeConverterMarkupExtension.cs
- HostingEnvironmentException.cs
- NavigationExpr.cs
- XsdDataContractImporter.cs
- CommonRemoteMemoryBlock.cs
- CoreSwitches.cs
- RawStylusInputCustomData.cs
- SqlWebEventProvider.cs
- SafeHandles.cs
- _SslSessionsCache.cs
- OutputScopeManager.cs
- HttpCookieCollection.cs
- VirtualDirectoryMappingCollection.cs
- FileInfo.cs
- ViewRendering.cs
- TableDetailsCollection.cs
- InvalidDataException.cs
- XmlWrappingWriter.cs
- ShutDownListener.cs
- Crc32.cs
- DocumentApplication.cs
- StopRoutingHandler.cs
- Int16Animation.cs
- TemplateXamlTreeBuilder.cs
- SystemIPAddressInformation.cs
- remotingproxy.cs
- SessionConnectionReader.cs
- MetadataCollection.cs
- ViewManager.cs
- WindowsGraphicsWrapper.cs
- TranslateTransform3D.cs
- QilPatternFactory.cs
- WorkflowElementDialog.cs
- DesignSurfaceServiceContainer.cs
- WebServiceErrorEvent.cs
- CopyNodeSetAction.cs
- DBSqlParserColumnCollection.cs
- AnnotationComponentChooser.cs
- UnsafeMethods.cs
- TcpWorkerProcess.cs
- CursorConverter.cs
- MetadataItem_Static.cs
- AppDomainFactory.cs
- DataViewSetting.cs
- _ConnectOverlappedAsyncResult.cs
- ResourceAttributes.cs
- DefaultMemberAttribute.cs
- AttributeCollection.cs
- BindingBase.cs
- TableItemPattern.cs
- EUCJPEncoding.cs
- VectorCollectionValueSerializer.cs
- ToolStripArrowRenderEventArgs.cs
- ModelServiceImpl.cs
- EntityProviderServices.cs
- CertificateManager.cs
- ToolStripDropTargetManager.cs
- XsdDataContractExporter.cs
- EdmEntityTypeAttribute.cs
- SourceFileBuildProvider.cs
- SQLInt64Storage.cs
- SmtpMail.cs
- ActivityPreviewDesigner.cs
- BasicExpandProvider.cs
- JsonServiceDocumentSerializer.cs
- StylusPointPropertyInfoDefaults.cs
- _ContextAwareResult.cs
- OleServicesContext.cs
- ArgumentsParser.cs
- DrawingContextWalker.cs
- RSAPKCS1SignatureFormatter.cs
- PolyBezierSegmentFigureLogic.cs
- XmlQueryStaticData.cs
- XmlCharCheckingWriter.cs
- MailBnfHelper.cs
- ArrayItemReference.cs
- _ConnectOverlappedAsyncResult.cs
- SynchronizationLockException.cs
- unsafenativemethodstextservices.cs
- RawStylusSystemGestureInputReport.cs
- NavigationExpr.cs
- EntityCommandDefinition.cs
- PointCollectionValueSerializer.cs
- FileNotFoundException.cs
- InnerItemCollectionView.cs
- ListDependantCardsRequest.cs
- ScaleTransform3D.cs
- ResourceCollectionInfo.cs
- StorageSetMapping.cs
- InvalidProgramException.cs
- EdmTypeAttribute.cs
- InstanceCreationEditor.cs
- ExpressionHelper.cs
- RelationshipNavigation.cs
- ConfigurationElementCollection.cs
- CellParagraph.cs
- OptionUsage.cs