Code:
/ DotNET / DotNET / 8.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
- PropertyGrid.cs
- ProgressPage.cs
- PropertyNames.cs
- ColorConvertedBitmap.cs
- OneOfConst.cs
- TraceContext.cs
- Frame.cs
- TextViewSelectionProcessor.cs
- Compilation.cs
- TiffBitmapDecoder.cs
- DrawingContext.cs
- RuntimeResourceSet.cs
- BufferedWebEventProvider.cs
- IgnoreFileBuildProvider.cs
- TextModifierScope.cs
- HttpCacheVary.cs
- ThemeableAttribute.cs
- TableDetailsRow.cs
- LayoutExceptionEventArgs.cs
- CustomErrorsSectionWrapper.cs
- Translator.cs
- DocumentApplication.cs
- ScrollBarAutomationPeer.cs
- UserControlDocumentDesigner.cs
- FilteredXmlReader.cs
- RsaKeyGen.cs
- DistributedTransactionPermission.cs
- AutomationPropertyInfo.cs
- WinInetCache.cs
- BinHexDecoder.cs
- ComponentSerializationService.cs
- SoapConverter.cs
- XmlHelper.cs
- ExpressionConverter.cs
- ApplicationContext.cs
- UIElementPropertyUndoUnit.cs
- HostingEnvironmentSection.cs
- AssertFilter.cs
- EntityModelSchemaGenerator.cs
- WindowsListViewItemStartMenu.cs
- ConfigurationException.cs
- PrivateFontCollection.cs
- MetadataLocation.cs
- IdentityManager.cs
- CacheChildrenQuery.cs
- EncryptedKeyIdentifierClause.cs
- DecoderExceptionFallback.cs
- TreeNode.cs
- JpegBitmapDecoder.cs
- ConfigXmlText.cs
- TableAdapterManagerNameHandler.cs
- NativeMethods.cs
- WindowsRichEdit.cs
- ChameleonKey.cs
- MimeBasePart.cs
- InkCanvasSelection.cs
- MaterialGroup.cs
- ChannelFactoryRefCache.cs
- SessionState.cs
- SAPICategories.cs
- WebPartDisplayModeEventArgs.cs
- HelpEvent.cs
- HttpStaticObjectsCollectionWrapper.cs
- ProtocolsConfigurationEntry.cs
- DataServiceKeyAttribute.cs
- CreateDataSourceDialog.cs
- MapPathBasedVirtualPathProvider.cs
- Vector3DAnimationUsingKeyFrames.cs
- GenericTypeParameterConverter.cs
- PathSegment.cs
- _emptywebproxy.cs
- VisualStyleTypesAndProperties.cs
- JsonObjectDataContract.cs
- ToolCreatedEventArgs.cs
- WorkflowServiceBehavior.cs
- TargetParameterCountException.cs
- PartManifestEntry.cs
- Help.cs
- DeploymentSection.cs
- LoginCancelEventArgs.cs
- FormatterServices.cs
- FunctionQuery.cs
- ButtonChrome.cs
- SmtpNegotiateAuthenticationModule.cs
- ScopelessEnumAttribute.cs
- Error.cs
- DataGridItemAttachedStorage.cs
- AnnotationResource.cs
- WsatAdminException.cs
- XMLDiffLoader.cs
- BamlBinaryWriter.cs
- ToolstripProfessionalRenderer.cs
- XmlSchemaSimpleContentExtension.cs
- DesignSurfaceManager.cs
- ContentPlaceHolder.cs
- StrongNameIdentityPermission.cs
- documentsequencetextcontainer.cs
- DSACryptoServiceProvider.cs
- WorkflowWebHostingModule.cs
- NetTcpBinding.cs