Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WebForms / System / Web / UI / Design / WebControls / XmlDesignerDataSourceView.cs / 1 / XmlDesignerDataSourceView.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.WebControls { using System; using System.Collections; using System.Diagnostics; using System.Web.UI.WebControls; ////// XmlDesignerDataSourceView is the designer view associated with a XmlDataSourceDesigner. /// [System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags = System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode)] public class XmlDesignerDataSourceView : DesignerDataSourceView { private XmlDataSourceDesigner _owner; public XmlDesignerDataSourceView(XmlDataSourceDesigner owner, string viewName) : base(owner, viewName) { _owner = owner; } public override IDataSourceViewSchema Schema { get { XmlDataSource xmlDataSource = _owner.GetDesignTimeXmlDataSource(String.Empty); if (xmlDataSource == null) { return null; } string xPath = xmlDataSource.XPath; if (xPath.Length == 0) { xPath = "/node()/node()"; } IDataSourceSchema schema = new XmlDocumentSchema(xmlDataSource.GetXmlDocument(), xPath); if (schema != null) { IDataSourceViewSchema[] viewSchemas = schema.GetViews(); if ((viewSchemas != null) && (viewSchemas.Length > 0)) { return viewSchemas[0]; } } return null; } } public override IEnumerable GetDesignTimeData(int minimumRows, out bool isSampleData) { // First try to use the runtime control to load actual data IEnumerable runtimeData = _owner.GetRuntimeEnumerable(Name); if (runtimeData != null) { // Runtime data was loaded, return it isSampleData = false; return runtimeData; } // No design time data could be retrieved, show dummy data return base.GetDesignTimeData(minimumRows, out isSampleData); } } } // 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
- EdmEntityTypeAttribute.cs
- IsolatedStorageFilePermission.cs
- FragmentQueryKB.cs
- Icon.cs
- TaiwanCalendar.cs
- ValidatorCollection.cs
- IncrementalCompileAnalyzer.cs
- CredentialManagerDialog.cs
- XmlSignatureManifest.cs
- InvalidateEvent.cs
- StrongNameHelpers.cs
- PixelFormatConverter.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- BindingGroup.cs
- StackOverflowException.cs
- WebPartCollection.cs
- PersonalizationAdministration.cs
- DataGridViewCellValidatingEventArgs.cs
- TextPenaltyModule.cs
- ThemeDirectoryCompiler.cs
- FunctionGenerator.cs
- ReachVisualSerializer.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- SafeMarshalContext.cs
- BooleanKeyFrameCollection.cs
- WebPartCatalogAddVerb.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- Attribute.cs
- NTAccount.cs
- WebBrowserHelper.cs
- AppDomain.cs
- RadialGradientBrush.cs
- XPathNavigatorReader.cs
- Translator.cs
- LambdaCompiler.Unary.cs
- AssemblySettingAttributes.cs
- DataServiceContext.cs
- SmiSettersStream.cs
- TCPListener.cs
- ToolStripGripRenderEventArgs.cs
- ProviderBase.cs
- DoWhileDesigner.xaml.cs
- DefaultPrintController.cs
- Documentation.cs
- RawUIStateInputReport.cs
- ObjectDataProvider.cs
- TaskbarItemInfo.cs
- ConnectionInterfaceCollection.cs
- FontDriver.cs
- IndicCharClassifier.cs
- SqlTriggerAttribute.cs
- HelpEvent.cs
- DoubleLink.cs
- DBSchemaRow.cs
- ResXResourceWriter.cs
- XmlCollation.cs
- AssemblyBuilder.cs
- SQLDecimalStorage.cs
- PseudoWebRequest.cs
- DataSourceXmlSerializer.cs
- DataGridViewUtilities.cs
- SqlWorkflowInstanceStoreLock.cs
- XmlSchemaInclude.cs
- DiscoveryMessageSequence.cs
- XNameTypeConverter.cs
- XamlTypeMapper.cs
- VirtualPathUtility.cs
- Compiler.cs
- ping.cs
- CreateParams.cs
- IDReferencePropertyAttribute.cs
- ExpanderAutomationPeer.cs
- QilLoop.cs
- DateRangeEvent.cs
- FormatPage.cs
- TemplateKey.cs
- DataGridViewImageColumn.cs
- DataGridViewCellStyleChangedEventArgs.cs
- BaseValidator.cs
- TailCallAnalyzer.cs
- SrgsElementFactoryCompiler.cs
- AmbiguousMatchException.cs
- MaskPropertyEditor.cs
- DecodeHelper.cs
- AnnotationStore.cs
- RemoveFromCollection.cs
- DirectionalLight.cs
- RequestBringIntoViewEventArgs.cs
- ServiceOperationParameter.cs
- IRCollection.cs
- UnwrappedTypesXmlSerializerManager.cs
- ViewStateModeByIdAttribute.cs
- SubqueryTrackingVisitor.cs
- CodeMethodInvokeExpression.cs
- AsymmetricCryptoHandle.cs
- InProcStateClientManager.cs
- OdbcErrorCollection.cs
- CheckBoxAutomationPeer.cs
- ExtendedProperty.cs
- XmlAttributeHolder.cs