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
- SessionPageStateSection.cs
- FileLogRecord.cs
- BaseCodeDomTreeGenerator.cs
- FilterableData.cs
- ApplicationDirectory.cs
- FontNamesConverter.cs
- ContextStaticAttribute.cs
- NativeObjectSecurity.cs
- HttpException.cs
- DesignParameter.cs
- Int32Rect.cs
- WebConvert.cs
- StatusBarPanel.cs
- errorpatternmatcher.cs
- DataGridViewTextBoxColumn.cs
- TextServicesDisplayAttribute.cs
- FixedPage.cs
- WebFaultClientMessageInspector.cs
- indexingfiltermarshaler.cs
- ObjRef.cs
- GlobalAllocSafeHandle.cs
- ImageListStreamer.cs
- HandlerWithFactory.cs
- LinkClickEvent.cs
- XPathPatternParser.cs
- MessageSecurityVersionConverter.cs
- RulePatternOps.cs
- Point3D.cs
- XmlObjectSerializer.cs
- ListViewDataItem.cs
- SchemaNotation.cs
- OneToOneMappingSerializer.cs
- StyleSelector.cs
- ErrorInfoXmlDocument.cs
- Drawing.cs
- DllNotFoundException.cs
- BehaviorEditorPart.cs
- DataObject.cs
- ACL.cs
- InvokeGenerator.cs
- BuilderElements.cs
- RadioButtonBaseAdapter.cs
- UrlPath.cs
- DbDataRecord.cs
- ProgressChangedEventArgs.cs
- ObjectToken.cs
- StringCollection.cs
- StringBlob.cs
- QilList.cs
- PropertyConverter.cs
- QilFactory.cs
- ClientSettingsStore.cs
- HtmlInputCheckBox.cs
- ReaderOutput.cs
- EncoderExceptionFallback.cs
- COM2ComponentEditor.cs
- CodeDOMUtility.cs
- EventLogConfiguration.cs
- XmlBindingWorker.cs
- BamlLocalizer.cs
- TargetControlTypeAttribute.cs
- Pens.cs
- ClientCredentialsElement.cs
- ObjectStateManagerMetadata.cs
- PropertyGeneratedEventArgs.cs
- SynchronizationContext.cs
- Property.cs
- streamingZipPartStream.cs
- Viewport3DAutomationPeer.cs
- NotConverter.cs
- SQLResource.cs
- ConfigurationPropertyAttribute.cs
- RadioButtonRenderer.cs
- CssClassPropertyAttribute.cs
- BinaryUtilClasses.cs
- VoiceInfo.cs
- DashStyles.cs
- ReceiveContext.cs
- EffectiveValueEntry.cs
- ContextMarshalException.cs
- PageCodeDomTreeGenerator.cs
- DateTimeOffsetAdapter.cs
- graph.cs
- TrackingProfile.cs
- CodeGotoStatement.cs
- AccessibleObject.cs
- HighlightComponent.cs
- SqlClientPermission.cs
- FormsAuthenticationUserCollection.cs
- BaseDataList.cs
- ConfigurationManagerInternal.cs
- TraceUtils.cs
- DragCompletedEventArgs.cs
- XmlSchemaExporter.cs
- BookmarkUndoUnit.cs
- Point3DConverter.cs
- ListBindableAttribute.cs
- WriteTimeStream.cs
- PrintDialog.cs
- XhtmlTextWriter.cs