Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- PropertyChangedEventArgs.cs
- Vector3DAnimationBase.cs
- HttpResponse.cs
- Transform3D.cs
- DbConnectionStringBuilder.cs
- LogoValidationException.cs
- FontCollection.cs
- HttpProfileGroupBase.cs
- RepeaterItem.cs
- LayeredChannelFactory.cs
- DataPointer.cs
- DaylightTime.cs
- UDPClient.cs
- XmlQueryRuntime.cs
- _NetworkingPerfCounters.cs
- DataObjectPastingEventArgs.cs
- ProtectedConfiguration.cs
- SiteOfOriginContainer.cs
- contentDescriptor.cs
- ToolboxComponentsCreatingEventArgs.cs
- EventLog.cs
- parserscommon.cs
- StopStoryboard.cs
- CacheDependency.cs
- cookiecollection.cs
- KeyboardNavigation.cs
- InputScopeConverter.cs
- DocumentXPathNavigator.cs
- NotFiniteNumberException.cs
- BufferedStream.cs
- WebConvert.cs
- ListBox.cs
- SoapAttributes.cs
- ScalarType.cs
- XmlValidatingReader.cs
- DataObjectAttribute.cs
- ActiveDocumentEvent.cs
- DataControlPagerLinkButton.cs
- TypeFieldSchema.cs
- CommandHelpers.cs
- XmlDocument.cs
- ListViewAutomationPeer.cs
- Stopwatch.cs
- DataIdProcessor.cs
- MouseGestureConverter.cs
- util.cs
- MenuItemCollectionEditorDialog.cs
- SqlConnectionManager.cs
- RtType.cs
- ModelItemImpl.cs
- IteratorFilter.cs
- ImageKeyConverter.cs
- ToolStripItem.cs
- TextTreeRootNode.cs
- BindingGroup.cs
- AutomationPropertyInfo.cs
- FilterEventArgs.cs
- ManagementPath.cs
- RepeaterCommandEventArgs.cs
- ExpressionNormalizer.cs
- RenderingEventArgs.cs
- OdbcConnectionHandle.cs
- RemoveStoryboard.cs
- Stackframe.cs
- GeneralTransform3DGroup.cs
- Geometry3D.cs
- ObjectPropertyMapping.cs
- HybridDictionary.cs
- PromptEventArgs.cs
- PenThreadWorker.cs
- UInt64Converter.cs
- SqlRowUpdatingEvent.cs
- ObsoleteAttribute.cs
- WebHttpSecurityModeHelper.cs
- Crypto.cs
- ItemCheckedEvent.cs
- ComponentGuaranteesAttribute.cs
- GradientSpreadMethodValidation.cs
- MetadataArtifactLoaderResource.cs
- CodeTypeReferenceCollection.cs
- UInt32Storage.cs
- DBAsyncResult.cs
- TextRangeSerialization.cs
- UIElement.cs
- ThreadStartException.cs
- StopStoryboard.cs
- DesignerCalendarAdapter.cs
- SortExpressionBuilder.cs
- Win32MouseDevice.cs
- OleDbWrapper.cs
- RelationshipFixer.cs
- ImageAttributes.cs
- Inflater.cs
- RightsManagementSuppressedStream.cs
- XmlUtil.cs
- InProcStateClientManager.cs
- ObjectDisposedException.cs
- DataBindEngine.cs
- EdmFunctions.cs
- HttpCachePolicy.cs