Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- ImportContext.cs
- HMACSHA256.cs
- ContentFilePart.cs
- AttributeQuery.cs
- AutomationPatternInfo.cs
- Main.cs
- ConfigXmlAttribute.cs
- RelatedView.cs
- EntityDataSource.cs
- Utils.cs
- SchemaElementLookUpTableEnumerator.cs
- WebPartConnectionsCancelEventArgs.cs
- RequestCachePolicyConverter.cs
- SqlTrackingWorkflowInstance.cs
- FileInfo.cs
- InternalBase.cs
- MinimizableAttributeTypeConverter.cs
- AuthenticationService.cs
- PlacementWorkspace.cs
- BaseHashHelper.cs
- ManifestBasedResourceGroveler.cs
- ObjectAnimationBase.cs
- Tile.cs
- ISCIIEncoding.cs
- unitconverter.cs
- FixedTextPointer.cs
- CrossContextChannel.cs
- ObjectManager.cs
- ParentUndoUnit.cs
- XmlSchemaAnyAttribute.cs
- WorkflowCreationContext.cs
- ExpandableObjectConverter.cs
- XmlNamedNodeMap.cs
- TypeProvider.cs
- PeerTransportListenAddressValidatorAttribute.cs
- WebHeaderCollection.cs
- CompilerGeneratedAttribute.cs
- CssStyleCollection.cs
- IImplicitResourceProvider.cs
- LassoSelectionBehavior.cs
- updateconfighost.cs
- Substitution.cs
- ManagedFilter.cs
- HtmlInputSubmit.cs
- BuildProviderCollection.cs
- CompareValidator.cs
- MemberMemberBinding.cs
- ObjectKeyFrameCollection.cs
- SystemGatewayIPAddressInformation.cs
- CustomError.cs
- RSAPKCS1KeyExchangeFormatter.cs
- LazyTextWriterCreator.cs
- Color.cs
- AliasedSlot.cs
- DocumentsTrace.cs
- ExpressionLink.cs
- XPathDocumentIterator.cs
- OleAutBinder.cs
- Connector.cs
- XmlSchemaChoice.cs
- GradientSpreadMethodValidation.cs
- StructuralObject.cs
- SimplePropertyEntry.cs
- formatter.cs
- _NTAuthentication.cs
- Int32.cs
- BaseDataList.cs
- XamlPointCollectionSerializer.cs
- SessionChannels.cs
- _KerberosClient.cs
- OpenTypeLayoutCache.cs
- UriTemplateClientFormatter.cs
- CornerRadius.cs
- AspNetSynchronizationContext.cs
- ArgumentOutOfRangeException.cs
- HMACSHA512.cs
- InputReport.cs
- EntityDesignerDataSourceView.cs
- LambdaCompiler.Generated.cs
- CompoundFileStorageReference.cs
- FreeFormDesigner.cs
- EditorAttribute.cs
- ModelFunction.cs
- PointUtil.cs
- FlowchartSizeFeature.cs
- ProfilePropertyNameValidator.cs
- StateValidator.cs
- SymbolEqualComparer.cs
- MarshalByRefObject.cs
- SqlUnionizer.cs
- HtmlInputSubmit.cs
- DbInsertCommandTree.cs
- LinqDataSourceView.cs
- WriteFileContext.cs
- SqlDataSourceCustomCommandEditor.cs
- TreeNodeBindingCollection.cs
- WinFormsSecurity.cs
- ComEventsHelper.cs
- BinaryCommonClasses.cs
- DataGridViewTextBoxEditingControl.cs