Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / BaseTypeViewSchema.cs / 1 / BaseTypeViewSchema.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design { using System; using System.Collections; using System.ComponentModel; using System.Diagnostics; using System.Reflection; ////// Represents a view's schema based on a Type object retrieved /// through Reflection. This is the base class for several view schema /// types. /// [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags = System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] internal abstract class BaseTypeViewSchema : IDataSourceViewSchema { private Type _type; private string _viewName; protected BaseTypeViewSchema(string viewName, Type type) { Debug.Assert(type != null); _type = type; _viewName = viewName; } public IDataSourceFieldSchema[] GetFields() { // Search for indexer property System.Collections.Generic.Listfields = new System.Collections.Generic.List (); Type rowType = GetRowType(_type); if (rowType != null) { // We specifically don't get schema when the type implements // ICustomTypeDescriptor since it is unlikely to have the // correct schema at design time. if (!typeof(ICustomTypeDescriptor).IsAssignableFrom(rowType)) { PropertyDescriptorCollection rowProperties = TypeDescriptor.GetProperties(rowType); foreach (PropertyDescriptor rowProperty in rowProperties) { fields.Add(new TypeFieldSchema(rowProperty)); } } } return fields.ToArray(); } public IDataSourceViewSchema[] GetChildren() { return null; } /// /// Derived classes must implement this method to retrieve the row /// type for a given object types. For example, in a strongly typed /// DataTable the row type would be the strongly typed DataRow. /// protected abstract Type GetRowType(Type objectType); public string Name { get { return _viewName; } } } } // 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
- VirtualDirectoryMappingCollection.cs
- BuildProviderUtils.cs
- ServiceOperationParameter.cs
- BitmapCodecInfo.cs
- SystemUnicastIPAddressInformation.cs
- DbConnectionStringBuilder.cs
- TrackingLocation.cs
- RunWorkerCompletedEventArgs.cs
- sqlstateclientmanager.cs
- DataRow.cs
- UserValidatedEventArgs.cs
- WindowsRegion.cs
- CopyOfAction.cs
- TablePatternIdentifiers.cs
- EventMappingSettingsCollection.cs
- Win32Exception.cs
- CoTaskMemHandle.cs
- FontUnit.cs
- BufferedGraphicsContext.cs
- UserPreferenceChangingEventArgs.cs
- Interlocked.cs
- Vector3D.cs
- BrowserDefinition.cs
- FormsIdentity.cs
- BaseAddressElementCollection.cs
- EntitySetBase.cs
- Receive.cs
- OutputCacheSettingsSection.cs
- RotationValidation.cs
- _Events.cs
- DataColumnMappingCollection.cs
- XhtmlConformanceSection.cs
- DbConnectionOptions.cs
- ArgumentNullException.cs
- AppDomainUnloadedException.cs
- CompositeActivityTypeDescriptor.cs
- XmlSchemaSequence.cs
- HideDisabledControlAdapter.cs
- DefaultTextStore.cs
- StorageMappingItemCollection.cs
- StorageMappingFragment.cs
- TabItemWrapperAutomationPeer.cs
- EncryptedHeader.cs
- NumberSubstitution.cs
- HtmlAnchor.cs
- StatusBarPanelClickEvent.cs
- SynchronousChannel.cs
- GlyphInfoList.cs
- SplitterCancelEvent.cs
- XmlMembersMapping.cs
- LinqDataSourceContextEventArgs.cs
- basenumberconverter.cs
- OleDbConnectionInternal.cs
- DllNotFoundException.cs
- BrowserInteropHelper.cs
- ProxyHwnd.cs
- ProviderSettings.cs
- IList.cs
- AuthenticationServiceManager.cs
- HtmlString.cs
- ControlAdapter.cs
- SmiXetterAccessMap.cs
- SizeChangedEventArgs.cs
- RelatedPropertyManager.cs
- ActivitySurrogateSelector.cs
- Journal.cs
- WebPartDisplayModeEventArgs.cs
- XmlEntityReference.cs
- TraceListener.cs
- ConnectionPointCookie.cs
- InvalidComObjectException.cs
- ProvidePropertyAttribute.cs
- DataControlCommands.cs
- HostExecutionContextManager.cs
- UnsafePeerToPeerMethods.cs
- ThreadAttributes.cs
- ResourceExpression.cs
- IndexedEnumerable.cs
- WebPartDisplayModeCancelEventArgs.cs
- TableRowsCollectionEditor.cs
- XmlnsCache.cs
- XmlWhitespace.cs
- Tuple.cs
- SurrogateEncoder.cs
- ZoneLinkButton.cs
- CodeDomConfigurationHandler.cs
- Helper.cs
- PackageRelationshipCollection.cs
- CaseInsensitiveComparer.cs
- ThicknessAnimationBase.cs
- Vars.cs
- RuntimeVariableList.cs
- Int32CollectionConverter.cs
- XmlHierarchyData.cs
- TokenBasedSet.cs
- FamilyMap.cs
- HwndStylusInputProvider.cs
- EventData.cs
- EventMappingSettingsCollection.cs
- XpsManager.cs