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
- BrowserCapabilitiesCodeGenerator.cs
- PlatformCulture.cs
- DoWorkEventArgs.cs
- ScalarConstant.cs
- MaskPropertyEditor.cs
- TextBox.cs
- QilReference.cs
- ExtensionQuery.cs
- ScriptingProfileServiceSection.cs
- PropertyOrder.cs
- MaxMessageSizeStream.cs
- XmlSchemaGroupRef.cs
- TextDecorationCollectionConverter.cs
- smtppermission.cs
- StyleModeStack.cs
- ShapingWorkspace.cs
- CustomAttribute.cs
- RawStylusInputCustomDataList.cs
- ConfigurationManagerHelper.cs
- LoginName.cs
- WebPartsPersonalizationAuthorization.cs
- RepeaterItem.cs
- dataprotectionpermission.cs
- Transform.cs
- SortQueryOperator.cs
- FixedSOMGroup.cs
- MeasureData.cs
- SafeSecurityHandles.cs
- Emitter.cs
- TimersDescriptionAttribute.cs
- AspProxy.cs
- TableRow.cs
- DecoderBestFitFallback.cs
- SmtpTransport.cs
- MsmqTransportBindingElement.cs
- TreeSet.cs
- DBSqlParserColumn.cs
- DrawingContextWalker.cs
- CredentialCache.cs
- securitycriticaldata.cs
- TakeOrSkipWhileQueryOperator.cs
- ScrollProperties.cs
- SecurityValidationBehavior.cs
- MaskedTextBoxDesigner.cs
- Point3DAnimationBase.cs
- IncrementalReadDecoders.cs
- DoubleLinkListEnumerator.cs
- VirtualPathProvider.cs
- ApplicationProxyInternal.cs
- DoubleStorage.cs
- StandardOleMarshalObject.cs
- ItemCheckEvent.cs
- X509ImageLogo.cs
- ControlOperationBehavior.cs
- ElementMarkupObject.cs
- Screen.cs
- DesignerLoader.cs
- CodePrimitiveExpression.cs
- SiteIdentityPermission.cs
- WhileDesigner.cs
- FilteredXmlReader.cs
- DuplicateWaitObjectException.cs
- CultureTable.cs
- OracleRowUpdatedEventArgs.cs
- SHA1Managed.cs
- MethodExpr.cs
- DynamicValueConverter.cs
- EventLogPermissionAttribute.cs
- TdsParser.cs
- InputScopeConverter.cs
- TraceSection.cs
- DES.cs
- Invariant.cs
- DefaultEvaluationContext.cs
- UnknownBitmapEncoder.cs
- SqlAliaser.cs
- WebConfigurationHost.cs
- Perspective.cs
- EntityParameterCollection.cs
- Win32Exception.cs
- OSEnvironmentHelper.cs
- AndMessageFilter.cs
- WebBrowserSiteBase.cs
- AuthorizationPolicyTypeElement.cs
- DispatchOperationRuntime.cs
- ConsoleKeyInfo.cs
- EncryptedPackageFilter.cs
- ConfigPathUtility.cs
- MultipleViewPattern.cs
- DEREncoding.cs
- VirtualPath.cs
- BitStack.cs
- WinEventQueueItem.cs
- FrameworkReadOnlyPropertyMetadata.cs
- CheckBox.cs
- CellConstantDomain.cs
- DataGridViewCellConverter.cs
- WebBrowser.cs
- RotateTransform3D.cs
- TrustSection.cs