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
- HtmlInputCheckBox.cs
- SignedPkcs7.cs
- XmlSchemaComplexContentRestriction.cs
- ThemeableAttribute.cs
- PartialList.cs
- StateItem.cs
- BaseEntityWrapper.cs
- TranslateTransform.cs
- SignedInfo.cs
- DataObjectPastingEventArgs.cs
- DebugHandleTracker.cs
- EncoderNLS.cs
- OleDbEnumerator.cs
- DataBoundLiteralControl.cs
- TransactionContext.cs
- TemplatedWizardStep.cs
- TextBoxAutomationPeer.cs
- SchemaNotation.cs
- DataTablePropertyDescriptor.cs
- ViewCellSlot.cs
- StrongNameIdentityPermission.cs
- TextDecorationCollection.cs
- VolatileEnlistmentState.cs
- TableSectionStyle.cs
- DataViewSetting.cs
- SqlBuffer.cs
- FamilyCollection.cs
- ChtmlLinkAdapter.cs
- Certificate.cs
- X509ChainPolicy.cs
- Control.cs
- UIElementCollection.cs
- altserialization.cs
- Merger.cs
- PropertyAccessVisitor.cs
- InstanceKeyView.cs
- CompoundFileReference.cs
- ClientSession.cs
- GuidelineCollection.cs
- RefreshInfo.cs
- SymDocumentType.cs
- ConnectionStringsExpressionEditor.cs
- CaseCqlBlock.cs
- DrawToolTipEventArgs.cs
- ParserOptions.cs
- ObjectCloneHelper.cs
- SecurityPermission.cs
- _Win32.cs
- MetadataArtifactLoaderCompositeResource.cs
- TCPClient.cs
- ImageAttributes.cs
- SystemFonts.cs
- ChannelAcceptor.cs
- AppModelKnownContentFactory.cs
- CodeConstructor.cs
- ToolStripEditorManager.cs
- ProfessionalColorTable.cs
- ExecutedRoutedEventArgs.cs
- JournalEntryStack.cs
- SplashScreenNativeMethods.cs
- InfiniteTimeSpanConverter.cs
- Control.cs
- QilInvokeEarlyBound.cs
- DefaultObjectMappingItemCollection.cs
- SystemFonts.cs
- EncodingNLS.cs
- TraceEventCache.cs
- BaseValidator.cs
- SqlExpander.cs
- ProcessHost.cs
- NavigationPropertyEmitter.cs
- And.cs
- EmptyStringExpandableObjectConverter.cs
- TypeForwardedToAttribute.cs
- PrintPageEvent.cs
- RuleSettings.cs
- SQLUtility.cs
- SelectingProviderEventArgs.cs
- UserControl.cs
- DelayedRegex.cs
- ScriptControl.cs
- CodeArrayIndexerExpression.cs
- TdsParserSafeHandles.cs
- OutKeywords.cs
- CommonProperties.cs
- SharedPerformanceCounter.cs
- AmbientLight.cs
- TextFormatter.cs
- NativeObjectSecurity.cs
- XmlCharacterData.cs
- SlotInfo.cs
- WebPartUserCapability.cs
- SchemaEntity.cs
- OneWayBindingElementImporter.cs
- SimpleApplicationHost.cs
- ThreadStartException.cs
- FileClassifier.cs
- WebPartTransformerCollection.cs
- SettingsProviderCollection.cs
- XhtmlBasicTextViewAdapter.cs