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
- ViewDesigner.cs
- Int32Rect.cs
- PersianCalendar.cs
- ToolStripOverflow.cs
- AutomationPeer.cs
- ObjectDataSourceSelectingEventArgs.cs
- SecurityManager.cs
- TableColumn.cs
- MulticastNotSupportedException.cs
- MarkupCompilePass1.cs
- SqlWriter.cs
- SafeNativeMethods.cs
- Scene3D.cs
- TreeViewCancelEvent.cs
- Identifier.cs
- SiteMapNodeCollection.cs
- SqlPersonalizationProvider.cs
- DetailsViewModeEventArgs.cs
- SoapCodeExporter.cs
- PageAsyncTask.cs
- DrawListViewColumnHeaderEventArgs.cs
- IERequestCache.cs
- AnimatedTypeHelpers.cs
- WebPartZone.cs
- DataServiceClientException.cs
- CompiledQueryCacheEntry.cs
- ScrollBarRenderer.cs
- ButtonChrome.cs
- NativeCppClassAttribute.cs
- LinearGradientBrush.cs
- MetadataUtilsSmi.cs
- AxisAngleRotation3D.cs
- PaintValueEventArgs.cs
- PipelineModuleStepContainer.cs
- ToolStripSeparator.cs
- LongValidator.cs
- SamlConstants.cs
- safesecurityhelperavalon.cs
- MailWebEventProvider.cs
- ProtocolReflector.cs
- XmlSchemaInferenceException.cs
- DesignerHost.cs
- SafeMILHandle.cs
- PermissionToken.cs
- DataGridBoolColumn.cs
- CompositeFontFamily.cs
- ChannelSinkStacks.cs
- DataGridViewCellConverter.cs
- IsolatedStorageFile.cs
- SmtpCommands.cs
- ExpressionBuilderCollection.cs
- StrictAndMessageFilter.cs
- BindingContext.cs
- SchemaElement.cs
- BitmapImage.cs
- InlineUIContainer.cs
- COM2IDispatchConverter.cs
- DiagnosticTraceSource.cs
- TextServicesHost.cs
- NativeRecognizer.cs
- OleDbPropertySetGuid.cs
- InternalsVisibleToAttribute.cs
- SmtpNegotiateAuthenticationModule.cs
- FileIOPermission.cs
- PreProcessor.cs
- CurrencyWrapper.cs
- StylusEventArgs.cs
- HMACSHA384.cs
- TreeViewDataItemAutomationPeer.cs
- TextBoxBase.cs
- NamespaceMapping.cs
- PageSettings.cs
- LayoutEditorPart.cs
- SystemFonts.cs
- DictionaryEntry.cs
- SslStreamSecurityElement.cs
- PreviewPageInfo.cs
- WindowsFont.cs
- X509CertificateValidationMode.cs
- UnknownBitmapDecoder.cs
- EventProviderWriter.cs
- Vector3DKeyFrameCollection.cs
- XsltContext.cs
- BinHexDecoder.cs
- ConfigErrorGlyph.cs
- ProfilePropertyNameValidator.cs
- CompatibleComparer.cs
- ImageAttributes.cs
- RelationshipDetailsRow.cs
- GcSettings.cs
- WindowsRichEdit.cs
- EnvelopedSignatureTransform.cs
- XamlBrushSerializer.cs
- GroupBoxAutomationPeer.cs
- FillErrorEventArgs.cs
- RSACryptoServiceProvider.cs
- WebServiceHandler.cs
- RoleServiceManager.cs
- XPathDescendantIterator.cs
- PanelStyle.cs