Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- InstanceKeyView.cs
- FileVersion.cs
- XslAstAnalyzer.cs
- MultiDataTrigger.cs
- CodeRemoveEventStatement.cs
- TransformProviderWrapper.cs
- EncryptedKeyIdentifierClause.cs
- DbConnectionPool.cs
- XmlParserContext.cs
- SqlTypeSystemProvider.cs
- MgmtConfigurationRecord.cs
- MaskedTextBox.cs
- HMACSHA512.cs
- TreeView.cs
- ResourceWriter.cs
- CompletedAsyncResult.cs
- MailBnfHelper.cs
- MessageQueue.cs
- GridView.cs
- ButtonField.cs
- ByteStreamGeometryContext.cs
- WhitespaceRuleLookup.cs
- TableRowCollection.cs
- SafeFileMapViewHandle.cs
- ManagementBaseObject.cs
- XmlTypeAttribute.cs
- SelectionManager.cs
- ListItemCollection.cs
- _NetworkingPerfCounters.cs
- SnapLine.cs
- SecurityContext.cs
- QueryAccessibilityHelpEvent.cs
- TemplatePartAttribute.cs
- XmlSchemaCollection.cs
- XmlQueryRuntime.cs
- DetailsViewCommandEventArgs.cs
- SystemIcmpV6Statistics.cs
- DataBindingExpressionBuilder.cs
- DocumentPage.cs
- CompiledQueryCacheKey.cs
- MissingMethodException.cs
- Sequence.cs
- VectorValueSerializer.cs
- ColumnHeader.cs
- DataContext.cs
- Selection.cs
- ProviderCollection.cs
- SqlXml.cs
- MembershipPasswordException.cs
- DataSetSchema.cs
- GridProviderWrapper.cs
- CodeIndexerExpression.cs
- TableLayoutSettingsTypeConverter.cs
- AdornerPresentationContext.cs
- KeyInfo.cs
- Guid.cs
- StatusBarPanelClickEvent.cs
- ClientSession.cs
- BamlTreeNode.cs
- keycontainerpermission.cs
- HtmlFormAdapter.cs
- LocalizableAttribute.cs
- XsltLoader.cs
- DataObject.cs
- Freezable.cs
- QuaternionAnimationUsingKeyFrames.cs
- BufferModeSettings.cs
- TreeNodeStyle.cs
- EpmTargetPathSegment.cs
- RSAOAEPKeyExchangeFormatter.cs
- ProcessModuleCollection.cs
- ConfigXmlText.cs
- Mutex.cs
- SerialPort.cs
- NotImplementedException.cs
- CrossContextChannel.cs
- WindowsMenu.cs
- Rotation3DAnimationBase.cs
- AssemblySettingAttributes.cs
- ObjectKeyFrameCollection.cs
- DataBindingHandlerAttribute.cs
- PlainXmlDeserializer.cs
- ClientRolePrincipal.cs
- BrushMappingModeValidation.cs
- XmlSerializerFactory.cs
- DrawListViewSubItemEventArgs.cs
- SettingsContext.cs
- DataSysAttribute.cs
- Storyboard.cs
- NullableFloatMinMaxAggregationOperator.cs
- XmlnsDefinitionAttribute.cs
- FloatMinMaxAggregationOperator.cs
- IIS7WorkerRequest.cs
- StringUtil.cs
- CompilerResults.cs
- BrowserCapabilitiesFactory.cs
- PartialToken.cs
- EditorZone.cs
- GridViewRow.cs
- XmlDigitalSignatureProcessor.cs