Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / clr / src / BCL / System / Reflection / __Filters.cs / 2 / __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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- dtdvalidator.cs
- ClientUtils.cs
- ISAPIApplicationHost.cs
- SettingsPropertyValueCollection.cs
- EventLogHandle.cs
- SamlAttributeStatement.cs
- XmlArrayItemAttributes.cs
- RayMeshGeometry3DHitTestResult.cs
- NullableIntMinMaxAggregationOperator.cs
- BuilderPropertyEntry.cs
- SqlInternalConnection.cs
- MaterialCollection.cs
- SymbolEqualComparer.cs
- TimeZone.cs
- TextBoxView.cs
- URLString.cs
- ResourcePool.cs
- ComboBoxRenderer.cs
- DataGridToolTip.cs
- ChildDocumentBlock.cs
- HitTestFilterBehavior.cs
- ErrorFormatter.cs
- MessageQueueException.cs
- SupportingTokenDuplexChannel.cs
- DivideByZeroException.cs
- XamlFilter.cs
- CollectionDataContractAttribute.cs
- DataGridColumnCollection.cs
- SessionStateUtil.cs
- ConnectionManagementElement.cs
- MultiBindingExpression.cs
- FixedDSBuilder.cs
- ProfessionalColorTable.cs
- InheritanceAttribute.cs
- ProtocolsSection.cs
- DBCommand.cs
- FixedPage.cs
- VersionedStream.cs
- SortKey.cs
- JsonByteArrayDataContract.cs
- XmlSchemaInferenceException.cs
- Axis.cs
- ExpressionParser.cs
- DirectoryInfo.cs
- SecurityPolicySection.cs
- SocketAddress.cs
- PolicyUnit.cs
- httpapplicationstate.cs
- WindowsButton.cs
- CheckBoxAutomationPeer.cs
- DataTemplate.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- HandoffBehavior.cs
- XmlSchemaAttributeGroupRef.cs
- ControlCommandSet.cs
- RootBuilder.cs
- HwndStylusInputProvider.cs
- ServiceNameElementCollection.cs
- WindowAutomationPeer.cs
- DateTimeValueSerializerContext.cs
- CollectionCodeDomSerializer.cs
- SerialPinChanges.cs
- XmlDocumentFragment.cs
- WebPartCollection.cs
- ZoomPercentageConverter.cs
- XmlByteStreamReader.cs
- SqlCacheDependencyDatabase.cs
- TimeZone.cs
- DurableMessageDispatchInspector.cs
- ScriptIgnoreAttribute.cs
- Boolean.cs
- SplineKeyFrames.cs
- Visual3DCollection.cs
- PipeSecurity.cs
- SoapFault.cs
- GlobalAllocSafeHandle.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- SafeArrayTypeMismatchException.cs
- SerializableReadOnlyDictionary.cs
- _NegoStream.cs
- PolyQuadraticBezierSegmentFigureLogic.cs
- SimpleType.cs
- IntPtr.cs
- ThicknessConverter.cs
- LinkButton.cs
- SqlUtil.cs
- WindowHideOrCloseTracker.cs
- PtsPage.cs
- HwndPanningFeedback.cs
- FormViewUpdateEventArgs.cs
- XmlImplementation.cs
- XmlSchemaImport.cs
- GridViewCellAutomationPeer.cs
- WorkerRequest.cs
- IISMapPath.cs
- ChangeNode.cs
- SignatureGenerator.cs
- FileStream.cs
- KeyToListMap.cs
- DesignTimeParseData.cs