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
- TransactionOptions.cs
- XPathAncestorIterator.cs
- SmtpReplyReaderFactory.cs
- DocumentCollection.cs
- DiscoveryMessageProperty.cs
- SafeHandles.cs
- Trace.cs
- OutputCacheSettings.cs
- AdRotator.cs
- DataGridColumnHeadersPresenter.cs
- DynamicDocumentPaginator.cs
- AppliedDeviceFiltersEditor.cs
- LabelExpression.cs
- HtmlTableCell.cs
- EffectiveValueEntry.cs
- ADConnectionHelper.cs
- ValuePattern.cs
- TdsParserHelperClasses.cs
- FrugalList.cs
- CodeTypeConstructor.cs
- SQLBinary.cs
- ResourceReferenceKeyNotFoundException.cs
- ToolTipAutomationPeer.cs
- LinearKeyFrames.cs
- LineInfo.cs
- WebConfigurationHostFileChange.cs
- SynchronizationHandlesCodeDomSerializer.cs
- StoreAnnotationsMap.cs
- ConfigurationCollectionAttribute.cs
- DispatcherObject.cs
- ManipulationDelta.cs
- FixedSOMTable.cs
- SvcMapFileSerializer.cs
- Journal.cs
- EventDescriptorCollection.cs
- XmlWriterTraceListener.cs
- ClientTargetSection.cs
- QueryStringHandler.cs
- DataService.cs
- AggregatePushdown.cs
- ProcessHostConfigUtils.cs
- RemoteTokenFactory.cs
- CommonXSendMessage.cs
- AttachmentCollection.cs
- Blend.cs
- Rect3D.cs
- CalendarDesigner.cs
- StructuralCache.cs
- ToolStripDropDownButton.cs
- DrawingServices.cs
- ListItemCollection.cs
- CompiledQuery.cs
- ToolStripItem.cs
- XmlReader.cs
- ScriptManagerProxy.cs
- XmlSchemaDatatype.cs
- _NetRes.cs
- RegexWorker.cs
- Matrix.cs
- Pen.cs
- SessionPageStatePersister.cs
- BooleanSwitch.cs
- TrustManagerPromptUI.cs
- EventDescriptor.cs
- WsdlImporterElement.cs
- EdmConstants.cs
- SettingsAttributeDictionary.cs
- FileUtil.cs
- FlowDocumentFormatter.cs
- GcSettings.cs
- ConfigXmlCDataSection.cs
- AsymmetricSignatureDeformatter.cs
- FontStyle.cs
- EpmContentDeSerializerBase.cs
- Column.cs
- AnyAllSearchOperator.cs
- _HelperAsyncResults.cs
- DependencySource.cs
- ComboBoxAutomationPeer.cs
- COSERVERINFO.cs
- TableHeaderCell.cs
- NonSerializedAttribute.cs
- ColumnTypeConverter.cs
- TextDecorationCollection.cs
- EntitySqlQueryCacheEntry.cs
- StringUtil.cs
- Config.cs
- DispatcherExceptionEventArgs.cs
- EditingScopeUndoUnit.cs
- RangeExpression.cs
- PackageDigitalSignature.cs
- HandlerBase.cs
- NamedPermissionSet.cs
- StateItem.cs
- PresentationTraceSources.cs
- SrgsSemanticInterpretationTag.cs
- Propagator.cs
- ConvertEvent.cs
- EntityConnection.cs
- NetworkInterface.cs