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
- ActivityCollectionMarkupSerializer.cs
- XmlSecureResolver.cs
- XmlSchemaObject.cs
- ObjectQueryState.cs
- FamilyMap.cs
- TimestampInformation.cs
- CodeTryCatchFinallyStatement.cs
- ResXResourceWriter.cs
- BaseCAMarshaler.cs
- ReadOnlyCollectionBuilder.cs
- CollectionTypeElement.cs
- SemanticTag.cs
- CircleHotSpot.cs
- TraceSection.cs
- RoutedCommand.cs
- TreeNodeBindingCollection.cs
- GradientSpreadMethodValidation.cs
- DataIdProcessor.cs
- _SecureChannel.cs
- Menu.cs
- FormView.cs
- DispatchWrapper.cs
- VoiceSynthesis.cs
- ItemContainerPattern.cs
- TextTreeInsertElementUndoUnit.cs
- DbParameterCollectionHelper.cs
- FolderNameEditor.cs
- RightsManagementInformation.cs
- GridViewUpdatedEventArgs.cs
- SecurityKeyUsage.cs
- BitVector32.cs
- DataControlImageButton.cs
- ErrorFormatter.cs
- HttpTransportSecurity.cs
- AnonymousIdentificationSection.cs
- SessionStateContainer.cs
- HorizontalAlignConverter.cs
- AuthenticationModuleElementCollection.cs
- InheritanceContextHelper.cs
- WeakEventTable.cs
- Gdiplus.cs
- BindingExpressionBase.cs
- GridViewPageEventArgs.cs
- GZipUtils.cs
- QueryExtender.cs
- Event.cs
- SimpleApplicationHost.cs
- ProgressBarRenderer.cs
- ServiceDiscoveryElement.cs
- InvalidEnumArgumentException.cs
- HashCodeCombiner.cs
- EncoderParameters.cs
- KeySplineConverter.cs
- BinaryUtilClasses.cs
- Quaternion.cs
- AppLevelCompilationSectionCache.cs
- SqlCacheDependencyDatabaseCollection.cs
- OleAutBinder.cs
- COM2TypeInfoProcessor.cs
- DbException.cs
- _ConnectStream.cs
- WorkflowQueueInfo.cs
- AlignmentXValidation.cs
- _NestedMultipleAsyncResult.cs
- NativeMethods.cs
- GlobalAllocSafeHandle.cs
- RequiredAttributeAttribute.cs
- Decimal.cs
- JapaneseCalendar.cs
- TypeLoadException.cs
- LineServicesCallbacks.cs
- AnimatedTypeHelpers.cs
- BitmapFrameEncode.cs
- DefaultShape.cs
- MulticastDelegate.cs
- RoleManagerEventArgs.cs
- BaseAsyncResult.cs
- TimeStampChecker.cs
- TrailingSpaceComparer.cs
- ObjectContextServiceProvider.cs
- Cursor.cs
- HitTestParameters3D.cs
- SystemInformation.cs
- ButtonStandardAdapter.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- EventArgs.cs
- IndentedTextWriter.cs
- ListViewUpdatedEventArgs.cs
- AnnotationStore.cs
- ToolStripDropDownMenu.cs
- RadioButtonRenderer.cs
- SimpleLine.cs
- TemplateControlParser.cs
- LicFileLicenseProvider.cs
- dataobject.cs
- ThicknessAnimation.cs
- Stackframe.cs
- MultiView.cs
- ProfileEventArgs.cs
- EpmContentSerializerBase.cs