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
- Cursors.cs
- RoutingService.cs
- RadioButtonFlatAdapter.cs
- DataGridViewComboBoxEditingControl.cs
- ContourSegment.cs
- TcpTransportManager.cs
- PartialCachingAttribute.cs
- FaultConverter.cs
- DataGridCellInfo.cs
- RawStylusInputReport.cs
- WorkflowWebHostingModule.cs
- GeneralTransform3D.cs
- TextRunTypographyProperties.cs
- ControlCommandSet.cs
- ResourceDefaultValueAttribute.cs
- ValueChangedEventManager.cs
- TextTreePropertyUndoUnit.cs
- XmlNullResolver.cs
- FirstMatchCodeGroup.cs
- ContractsBCL.cs
- ContentElementAutomationPeer.cs
- MouseGesture.cs
- TimelineCollection.cs
- HwndMouseInputProvider.cs
- ProcessModelInfo.cs
- DocumentViewerAutomationPeer.cs
- TextFormatter.cs
- Select.cs
- ApplicationInterop.cs
- MeshGeometry3D.cs
- ValidationErrorCollection.cs
- WindowsGraphics2.cs
- TextPenaltyModule.cs
- MergeFilterQuery.cs
- InvalidOleVariantTypeException.cs
- wmiprovider.cs
- EdmProperty.cs
- TextTrailingCharacterEllipsis.cs
- WpfSharedBamlSchemaContext.cs
- OracleColumn.cs
- AncestorChangedEventArgs.cs
- DataSetUtil.cs
- OperationInvokerTrace.cs
- XmlDocument.cs
- SetIterators.cs
- FontWeight.cs
- FillBehavior.cs
- PropertyItemInternal.cs
- SolidColorBrush.cs
- LogSwitch.cs
- SqlUserDefinedTypeAttribute.cs
- AssertSection.cs
- BinaryNode.cs
- RequestQueryParser.cs
- PackageRelationship.cs
- TypefaceCollection.cs
- CookieProtection.cs
- XmlNodeReader.cs
- AtomEntry.cs
- PrintPreviewDialog.cs
- TileBrush.cs
- EditingMode.cs
- PeerToPeerException.cs
- UntrustedRecipientException.cs
- SerializationInfoEnumerator.cs
- UserPreferenceChangedEventArgs.cs
- FileNotFoundException.cs
- LinearKeyFrames.cs
- CodeAccessPermission.cs
- ReceiveSecurityHeader.cs
- BitmapFrameDecode.cs
- SQLInt64Storage.cs
- PeerNameRecord.cs
- ToolStripItemCollection.cs
- OleDbEnumerator.cs
- ProxyGenerationError.cs
- LeftCellWrapper.cs
- TemplateBindingExpressionConverter.cs
- SoapFault.cs
- Encoder.cs
- InvalidEnumArgumentException.cs
- CodeGeneratorOptions.cs
- DesignerView.cs
- RuleSettings.cs
- Control.cs
- LineServices.cs
- ModuleConfigurationInfo.cs
- PackageProperties.cs
- StringExpressionSet.cs
- SecurityTokenTypes.cs
- BindingNavigator.cs
- BamlRecords.cs
- CommandExpr.cs
- FormatterServices.cs
- securitymgrsite.cs
- Canvas.cs
- Activity.cs
- PeerService.cs
- ClassValidator.cs
- ToolBarOverflowPanel.cs