Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / 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
- CodeAttributeArgumentCollection.cs
- ContextStaticAttribute.cs
- Main.cs
- SkinBuilder.cs
- CachedBitmap.cs
- TextRunCache.cs
- ObjectListDataBindEventArgs.cs
- FormViewUpdatedEventArgs.cs
- TextFormatter.cs
- DispatcherTimer.cs
- ObjectPersistData.cs
- Evidence.cs
- RegexFCD.cs
- DataSourceXmlClassAttribute.cs
- DesignerAutoFormatCollection.cs
- SafeUserTokenHandle.cs
- AccessViolationException.cs
- ResXBuildProvider.cs
- ConsumerConnectionPoint.cs
- InfoCardProofToken.cs
- ArraySortHelper.cs
- ThreadStateException.cs
- OptimizedTemplateContentHelper.cs
- ComplexBindingPropertiesAttribute.cs
- WinFormsSecurity.cs
- EntityDataSourceDesigner.cs
- FormViewActionList.cs
- AnimatedTypeHelpers.cs
- FunctionUpdateCommand.cs
- DataGridViewRowsRemovedEventArgs.cs
- ReceiveActivityDesigner.cs
- InvalidDataContractException.cs
- ProfileGroupSettingsCollection.cs
- FunctionDescription.cs
- GraphicsContext.cs
- InProcStateClientManager.cs
- WmlObjectListAdapter.cs
- DispatcherEventArgs.cs
- GlyphTypeface.cs
- SecurityResources.cs
- TraceContext.cs
- WebPartManager.cs
- HierarchicalDataSourceControl.cs
- OutOfProcStateClientManager.cs
- Configuration.cs
- RecipientInfo.cs
- Point3DAnimation.cs
- GridToolTip.cs
- DataGrid.cs
- DataConnectionHelper.cs
- TextBreakpoint.cs
- TreeNodeEventArgs.cs
- HttpRequest.cs
- LinkLabel.cs
- XmlBindingWorker.cs
- CodeLabeledStatement.cs
- HttpAsyncResult.cs
- ToolstripProfessionalRenderer.cs
- BamlStream.cs
- PrintEvent.cs
- PkcsMisc.cs
- AlignmentYValidation.cs
- ToggleButton.cs
- ApplicationManager.cs
- UnsafeNativeMethods.cs
- ObjectListField.cs
- MailHeaderInfo.cs
- RuntimeVariablesExpression.cs
- CngProvider.cs
- HtmlWindow.cs
- _NegoStream.cs
- CodeCatchClause.cs
- ReflectTypeDescriptionProvider.cs
- FactoryMaker.cs
- SqlMultiplexer.cs
- OutputCacheSection.cs
- ColumnWidthChangedEvent.cs
- DirectoryNotFoundException.cs
- FaultConverter.cs
- figurelength.cs
- ImpersonateTokenRef.cs
- SessionStateUtil.cs
- TextElement.cs
- DropShadowEffect.cs
- NamespaceInfo.cs
- AndCondition.cs
- ICollection.cs
- Pens.cs
- MergePropertyDescriptor.cs
- WebPartConnectionsCancelEventArgs.cs
- Compiler.cs
- Parser.cs
- XmlExtensionFunction.cs
- Point3DAnimationUsingKeyFrames.cs
- State.cs
- XmlObjectSerializerWriteContext.cs
- entityreference_tresulttype.cs
- EdmComplexPropertyAttribute.cs
- SafeEventLogWriteHandle.cs
- LineInfo.cs