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
- _FtpDataStream.cs
- TextDecorations.cs
- Operand.cs
- PagesSection.cs
- WindowsListViewGroupSubsetLink.cs
- DbMetaDataColumnNames.cs
- MetadataArtifactLoaderFile.cs
- ViewBase.cs
- NotifyIcon.cs
- GeneratedView.cs
- _NegoState.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- Operator.cs
- DataControlReference.cs
- NavigatorInput.cs
- PTConverter.cs
- Image.cs
- UInt16.cs
- DrawItemEvent.cs
- ChtmlTextWriter.cs
- AudioSignalProblemOccurredEventArgs.cs
- MonthCalendar.cs
- PropertyToken.cs
- WindowsContainer.cs
- GC.cs
- SpellerHighlightLayer.cs
- HandledEventArgs.cs
- Size3D.cs
- SchemaObjectWriter.cs
- XmlArrayAttribute.cs
- TemplateField.cs
- DataGridViewRowEventArgs.cs
- TypefaceMap.cs
- DataServiceQuery.cs
- BinaryMethodMessage.cs
- WebPartsPersonalization.cs
- ResourceDescriptionAttribute.cs
- ExtensionSurface.cs
- RtfControlWordInfo.cs
- ControlParser.cs
- AlphaSortedEnumConverter.cs
- DefaultObjectMappingItemCollection.cs
- TextServicesDisplayAttribute.cs
- XmlQualifiedName.cs
- BitVec.cs
- NetworkInterface.cs
- EventMappingSettings.cs
- RemotingConfiguration.cs
- ProjectedSlot.cs
- NetworkInformationPermission.cs
- HttpHandlerActionCollection.cs
- CheckBox.cs
- DnsCache.cs
- PeerCustomResolverBindingElement.cs
- TextEditorSelection.cs
- HTMLTextWriter.cs
- CalculatedColumn.cs
- ContractCodeDomInfo.cs
- WindowsListViewItemCheckBox.cs
- LogWriteRestartAreaState.cs
- ParameterReplacerVisitor.cs
- DPCustomTypeDescriptor.cs
- HtmlEmptyTagControlBuilder.cs
- EntryWrittenEventArgs.cs
- HashStream.cs
- XmlSchemaExternal.cs
- XmlCustomFormatter.cs
- ProviderUtil.cs
- XamlDesignerSerializationManager.cs
- Panel.cs
- ByteStreamBufferedMessageData.cs
- WebService.cs
- ColorConvertedBitmap.cs
- Expander.cs
- SecurityTraceRecordHelper.cs
- Vector3DValueSerializer.cs
- X509Chain.cs
- ProfessionalColorTable.cs
- SapiRecoContext.cs
- CanonicalFontFamilyReference.cs
- HMAC.cs
- Thickness.cs
- RegistryConfigurationProvider.cs
- ObjectDisposedException.cs
- AllMembershipCondition.cs
- WindowsUpDown.cs
- QEncodedStream.cs
- BatchStream.cs
- FixedPosition.cs
- CompilerParameters.cs
- ConfigsHelper.cs
- ACL.cs
- SqlRemoveConstantOrderBy.cs
- FixedDocumentPaginator.cs
- StrokeNodeData.cs
- CodeObjectCreateExpression.cs
- SafeBitVector32.cs
- Expression.cs
- EdmItemCollection.cs
- ConfigurationLocation.cs