Code:
/ FX-1434 / FX-1434 / 1.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
- StoreItemCollection.cs
- GZipDecoder.cs
- PrinterResolution.cs
- OperationContractAttribute.cs
- IdentityHolder.cs
- XmlDomTextWriter.cs
- EnumerationRangeValidationUtil.cs
- DisableDpiAwarenessAttribute.cs
- LocatorPartList.cs
- MaskedTextBoxTextEditorDropDown.cs
- CodeParameterDeclarationExpressionCollection.cs
- ProcessingInstructionAction.cs
- ConnectionsZoneDesigner.cs
- SelectionChangedEventArgs.cs
- HashCoreRequest.cs
- ScriptResourceInfo.cs
- Binding.cs
- ToolTipService.cs
- WaitForChangedResult.cs
- MouseEvent.cs
- ClientData.cs
- ColorConvertedBitmap.cs
- BuilderPropertyEntry.cs
- Literal.cs
- DesignerActionItem.cs
- Imaging.cs
- XPathParser.cs
- SqlMethodAttribute.cs
- Asn1Utilities.cs
- TimeoutException.cs
- CanonicalFontFamilyReference.cs
- GACIdentityPermission.cs
- AssemblyNameProxy.cs
- XamlPoint3DCollectionSerializer.cs
- DetailsViewCommandEventArgs.cs
- parserscommon.cs
- PlanCompilerUtil.cs
- ToolBar.cs
- AppDomainFactory.cs
- WmpBitmapDecoder.cs
- ListView.cs
- SQLUtility.cs
- ListControl.cs
- DataGridViewLinkCell.cs
- SortedList.cs
- CodeDOMProvider.cs
- OdbcStatementHandle.cs
- CaretElement.cs
- XmlQueryCardinality.cs
- HttpRuntimeSection.cs
- CustomError.cs
- DefaultProfileManager.cs
- TableSectionStyle.cs
- SqlNamer.cs
- BrowserCapabilitiesFactory.cs
- CodeBlockBuilder.cs
- WebConvert.cs
- CompilationSection.cs
- HttpContext.cs
- QueryReaderSettings.cs
- PolygonHotSpot.cs
- WindowsListViewItem.cs
- WindowClosedEventArgs.cs
- PeerNameRecord.cs
- ECDiffieHellmanPublicKey.cs
- ToolboxItemFilterAttribute.cs
- StatusBarItem.cs
- CustomErrorCollection.cs
- XhtmlTextWriter.cs
- SafeRightsManagementPubHandle.cs
- _Events.cs
- AutoGeneratedFieldProperties.cs
- RegistryKey.cs
- ContainerUIElement3D.cs
- DynamicPropertyHolder.cs
- DockPatternIdentifiers.cs
- ZipIOExtraFieldPaddingElement.cs
- Variant.cs
- SafeTimerHandle.cs
- PropertyIDSet.cs
- OrderPreservingSpoolingTask.cs
- Help.cs
- FormViewCommandEventArgs.cs
- XPathDescendantIterator.cs
- EventKeyword.cs
- XmlNodeChangedEventArgs.cs
- FragmentNavigationEventArgs.cs
- XmlAnyElementAttribute.cs
- AssemblyInfo.cs
- Cursor.cs
- Configuration.cs
- DbProviderServices.cs
- DummyDataSource.cs
- CheckBoxAutomationPeer.cs
- WithParamAction.cs
- TextBoxDesigner.cs
- ProfessionalColorTable.cs
- BitmapSource.cs
- BitmapImage.cs
- TogglePatternIdentifiers.cs