Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / CompMod / System / ComponentModel / CollectionConverter.cs / 1305376 / CollectionConverter.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using Microsoft.Win32; using System.Collections; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Runtime.Serialization.Formatters; using System.Runtime.Remoting; using System.Runtime.InteropServices; using System.Security.Permissions; ////// [HostProtection(SharedState = true)] public class CollectionConverter : TypeConverter { ///Provides a type converter to convert /// collection objects to and from various other representations. ////// public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == null) { throw new ArgumentNullException("destinationType"); } if (destinationType == typeof(string)) { if (value is ICollection) { return SR.GetString(SR.CollectionConverterText); } } return base.ConvertTo(context, culture, value, destinationType); } ///Converts the given /// value object to the /// specified destination type. ////// public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) { //return new PropertyDescriptorCollection(null); return null; } ///Gets a collection of properties for /// the type of array specified by the value parameter using the specified context and /// attributes. ////// public override bool GetPropertiesSupported(ITypeDescriptorContext context) { return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //Gets a value indicating whether this object /// supports properties. ///// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- /* */ namespace System.ComponentModel { using Microsoft.Win32; using System.Collections; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.Runtime.Serialization.Formatters; using System.Runtime.Remoting; using System.Runtime.InteropServices; using System.Security.Permissions; ////// [HostProtection(SharedState = true)] public class CollectionConverter : TypeConverter { ///Provides a type converter to convert /// collection objects to and from various other representations. ////// public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == null) { throw new ArgumentNullException("destinationType"); } if (destinationType == typeof(string)) { if (value is ICollection) { return SR.GetString(SR.CollectionConverterText); } } return base.ConvertTo(context, culture, value, destinationType); } ///Converts the given /// value object to the /// specified destination type. ////// public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes) { //return new PropertyDescriptorCollection(null); return null; } ///Gets a collection of properties for /// the type of array specified by the value parameter using the specified context and /// attributes. ////// public override bool GetPropertiesSupported(ITypeDescriptorContext context) { return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.Gets a value indicating whether this object /// supports properties. ///
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataErrorValidationRule.cs
- EntityDataSourceUtil.cs
- IndexedGlyphRun.cs
- XmlSerializationWriter.cs
- ValidationManager.cs
- AttachmentCollection.cs
- SqlDataRecord.cs
- sqlser.cs
- httpserverutility.cs
- RouteTable.cs
- ThaiBuddhistCalendar.cs
- GridViewRow.cs
- SourceLineInfo.cs
- DesignTimeTemplateParser.cs
- TraceRecords.cs
- ReferencedAssembly.cs
- LinkUtilities.cs
- MarkerProperties.cs
- Decoder.cs
- BindableTemplateBuilder.cs
- OptionalColumn.cs
- ObjectDataSourceStatusEventArgs.cs
- MsmqIntegrationMessageProperty.cs
- SplineKeyFrames.cs
- ColumnPropertiesGroup.cs
- ConfigurationProviderException.cs
- MessageOperationFormatter.cs
- ExtenderProvidedPropertyAttribute.cs
- DatePicker.cs
- _TransmitFileOverlappedAsyncResult.cs
- SelectionEditingBehavior.cs
- CodeThrowExceptionStatement.cs
- Resources.Designer.cs
- ObjectStateEntry.cs
- CodeDefaultValueExpression.cs
- DataSourceControl.cs
- HealthMonitoringSectionHelper.cs
- PropertyGeneratedEventArgs.cs
- BaseDataListPage.cs
- mda.cs
- remotingproxy.cs
- VariableElement.cs
- TypeSource.cs
- ComponentEditorPage.cs
- ResourceManager.cs
- FormViewDeletedEventArgs.cs
- DropSourceBehavior.cs
- BitmapEffectInput.cs
- CodeTryCatchFinallyStatement.cs
- AsmxEndpointPickerExtension.cs
- SessionIDManager.cs
- TreeNode.cs
- DeleteHelper.cs
- DataRowExtensions.cs
- EpmCustomContentWriterNodeData.cs
- DbProviderFactoriesConfigurationHandler.cs
- NamespaceCollection.cs
- MobileUserControl.cs
- XmlWellformedWriterHelpers.cs
- TcpTransportBindingElement.cs
- TerminatorSinks.cs
- XmlObjectSerializerContext.cs
- Internal.cs
- NullRuntimeConfig.cs
- NameSpaceExtractor.cs
- PropertyOverridesTypeEditor.cs
- QilLoop.cs
- PropertyDescriptorCollection.cs
- IntAverageAggregationOperator.cs
- ExceptionRoutedEventArgs.cs
- ServiceModelConfiguration.cs
- WebControlAdapter.cs
- CodeTypeOfExpression.cs
- DefaultPropertyAttribute.cs
- TraceUtility.cs
- EntityDataSourceQueryBuilder.cs
- ListSurrogate.cs
- OleTxTransaction.cs
- Line.cs
- XmlWrappingReader.cs
- UIntPtr.cs
- SoapProtocolReflector.cs
- DataGridTablesFactory.cs
- StateItem.cs
- SystemInformation.cs
- Transform.cs
- StylusOverProperty.cs
- AddInPipelineAttributes.cs
- NodeLabelEditEvent.cs
- UIElementCollection.cs
- WindowsPen.cs
- ViewSimplifier.cs
- SignatureGenerator.cs
- CodeIndexerExpression.cs
- CatalogPart.cs
- unsafenativemethodsother.cs
- Unit.cs
- SqlCommandBuilder.cs
- coordinatorscratchpad.cs
- CodeMemberMethod.cs