Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- JournalEntryListConverter.cs
- __ComObject.cs
- WebScriptServiceHost.cs
- PresentationTraceSources.cs
- EventWaitHandle.cs
- AnonymousIdentificationSection.cs
- ClientTarget.cs
- Schema.cs
- DateTimeOffsetConverter.cs
- TogglePattern.cs
- AutomationIdentifier.cs
- OleDbParameter.cs
- CfgParser.cs
- ReturnEventArgs.cs
- BrowserCapabilitiesCodeGenerator.cs
- CompressedStack.cs
- TablePattern.cs
- MailDefinition.cs
- SQLGuidStorage.cs
- UpdateEventArgs.cs
- ParameterBinding.cs
- DynamicQueryStringParameter.cs
- SqlRewriteScalarSubqueries.cs
- ModuleBuilderData.cs
- ToolBarPanel.cs
- DurableInstanceProvider.cs
- RowParagraph.cs
- WorkflowStateRollbackService.cs
- SystemIPv4InterfaceProperties.cs
- NavigatorOutput.cs
- MD5HashHelper.cs
- ModelUIElement3D.cs
- ThousandthOfEmRealPoints.cs
- cookie.cs
- HtmlPhoneCallAdapter.cs
- PackWebRequest.cs
- QueryStringParameter.cs
- NativeWindow.cs
- Maps.cs
- KnownIds.cs
- RelationshipType.cs
- TraceContext.cs
- UserControl.cs
- SchemaAttDef.cs
- PersistenceException.cs
- SourceElementsCollection.cs
- OutOfProcStateClientManager.cs
- PenContext.cs
- XmlQueryStaticData.cs
- MatchAttribute.cs
- SystemFonts.cs
- SecurityContext.cs
- Assert.cs
- CqlBlock.cs
- TdsParserSessionPool.cs
- PresentationAppDomainManager.cs
- ReadOnlyNameValueCollection.cs
- ResponseBodyWriter.cs
- BindingBase.cs
- TextServicesPropertyRanges.cs
- BaseServiceProvider.cs
- XmlSchemaDocumentation.cs
- DelegatedStream.cs
- arclist.cs
- BoolExpressionVisitors.cs
- URI.cs
- AnonymousIdentificationSection.cs
- Span.cs
- Context.cs
- TextHidden.cs
- CodeTypeMemberCollection.cs
- SqlDataReader.cs
- XmlSchemaAppInfo.cs
- EventWaitHandleSecurity.cs
- ContactManager.cs
- AlgoModule.cs
- TableItemProviderWrapper.cs
- Odbc32.cs
- AnnotationComponentChooser.cs
- DataGridColumnsPage.cs
- List.cs
- List.cs
- CellParagraph.cs
- CollectionContainer.cs
- ETagAttribute.cs
- ExpandCollapsePattern.cs
- LoginView.cs
- WebExceptionStatus.cs
- EntityClientCacheKey.cs
- DetailsViewUpdateEventArgs.cs
- X509CertificateChain.cs
- WebBrowser.cs
- ServiceDescriptionReflector.cs
- SerializableAttribute.cs
- NodeCounter.cs
- IImplicitResourceProvider.cs
- UnmanagedMarshal.cs
- ValidationError.cs
- PartialList.cs
- TdsRecordBufferSetter.cs