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
- DataConnectionHelper.cs
- DependencyPropertyKind.cs
- MsmqOutputMessage.cs
- ClientRolePrincipal.cs
- PeerTransportListenAddressConverter.cs
- Assert.cs
- ConfigurationValue.cs
- MiniCustomAttributeInfo.cs
- BindToObject.cs
- SamlDoNotCacheCondition.cs
- BooleanAnimationBase.cs
- WindowsPen.cs
- TimelineGroup.cs
- RectConverter.cs
- ScaleTransform3D.cs
- OleDbRowUpdatedEvent.cs
- WindowsListViewItem.cs
- OdbcParameter.cs
- WebPartActionVerb.cs
- CookieProtection.cs
- returneventsaver.cs
- DecimalKeyFrameCollection.cs
- FileDialog.cs
- AuthStoreRoleProvider.cs
- FlowDocumentReaderAutomationPeer.cs
- _RequestLifetimeSetter.cs
- MultitargetUtil.cs
- BinaryFormatter.cs
- ReadOnlyDictionary.cs
- CodeAccessPermission.cs
- HttpGetProtocolReflector.cs
- GridViewCancelEditEventArgs.cs
- RoutedUICommand.cs
- TokenBasedSet.cs
- LockedBorderGlyph.cs
- XXXInfos.cs
- CatalogZoneBase.cs
- HostingEnvironmentException.cs
- WindowsGraphics2.cs
- securitycriticaldataformultiplegetandset.cs
- SharedUtils.cs
- ColorKeyFrameCollection.cs
- AjaxFrameworkAssemblyAttribute.cs
- RsaKeyIdentifierClause.cs
- SerializerWriterEventHandlers.cs
- WebBrowserHelper.cs
- Message.cs
- ChtmlPhoneCallAdapter.cs
- ResolvedKeyFrameEntry.cs
- EUCJPEncoding.cs
- WeakReferenceEnumerator.cs
- x509store.cs
- HttpApplicationFactory.cs
- Encoding.cs
- SqlDataAdapter.cs
- ParameterModifier.cs
- RtfToken.cs
- FontCollection.cs
- MdiWindowListStrip.cs
- PointCollectionValueSerializer.cs
- InputDevice.cs
- UInt16.cs
- StylusDevice.cs
- ContainsRowNumberChecker.cs
- ExeContext.cs
- SerializationFieldInfo.cs
- OperationCanceledException.cs
- XsltSettings.cs
- SqlNodeTypeOperators.cs
- BlockCollection.cs
- RbTree.cs
- ProtocolImporter.cs
- PolygonHotSpot.cs
- XsdCachingReader.cs
- DeploymentSection.cs
- DataMisalignedException.cs
- webeventbuffer.cs
- Transactions.cs
- TaskFactory.cs
- TextViewSelectionProcessor.cs
- ConstraintCollection.cs
- SingleObjectCollection.cs
- IriParsingElement.cs
- EdmScalarPropertyAttribute.cs
- PolicyLevel.cs
- FlowDocumentView.cs
- Control.cs
- SerializerWriterEventHandlers.cs
- RichTextBox.cs
- SecurityAccessDeniedException.cs
- NamedPipeTransportManager.cs
- PrefixHandle.cs
- CreateRefExpr.cs
- JapaneseLunisolarCalendar.cs
- DbConnectionHelper.cs
- OdbcCommand.cs
- PathParser.cs
- EditorResources.cs
- BaseDataList.cs
- Stylesheet.cs