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
- PrintPreviewDialog.cs
- ServicePointManager.cs
- ConnectionsZoneDesigner.cs
- AttributeCollection.cs
- ProfileGroupSettings.cs
- XmlValidatingReaderImpl.cs
- ArgumentDirectionHelper.cs
- CompilerScopeManager.cs
- ByteStreamMessageEncodingElement.cs
- GrammarBuilderPhrase.cs
- WebRequest.cs
- DbConnectionClosed.cs
- Formatter.cs
- NavigationPropertyAccessor.cs
- SessionState.cs
- Container.cs
- Certificate.cs
- DecimalAnimationBase.cs
- CollectionViewGroupInternal.cs
- SmtpReplyReader.cs
- DecimalFormatter.cs
- UInt64.cs
- CmsInterop.cs
- X509ChainPolicy.cs
- ScrollBar.cs
- MatchingStyle.cs
- ImageUrlEditor.cs
- TripleDES.cs
- DbConnectionFactory.cs
- EpmTargetPathSegment.cs
- WindowsFont.cs
- ActiveXContainer.cs
- BookmarkOptionsHelper.cs
- ScrollContentPresenter.cs
- DynamicMetaObjectBinder.cs
- DispatchChannelSink.cs
- FlowPosition.cs
- WindowsPrincipal.cs
- SmiContextFactory.cs
- SessionParameter.cs
- HttpProfileBase.cs
- Ops.cs
- Frame.cs
- XmlSubtreeReader.cs
- SignedXml.cs
- DataGridViewSortCompareEventArgs.cs
- ConfigXmlSignificantWhitespace.cs
- ConstantCheck.cs
- FixedLineResult.cs
- HttpClientCertificate.cs
- Expander.cs
- MetadataHelper.cs
- IISUnsafeMethods.cs
- EntityContainerRelationshipSet.cs
- XPathSingletonIterator.cs
- XPathDocument.cs
- DefaultSerializationProviderAttribute.cs
- ResXResourceSet.cs
- BufferedWebEventProvider.cs
- RuntimeConfigLKG.cs
- MatchSingleFxEngineOpcode.cs
- HexParser.cs
- SqlConnection.cs
- KnownIds.cs
- PersonalizablePropertyEntry.cs
- SimpleHandlerBuildProvider.cs
- ObjectHelper.cs
- DecodeHelper.cs
- DetailsViewCommandEventArgs.cs
- Dynamic.cs
- GlobalEventManager.cs
- CompilationPass2TaskInternal.cs
- SystemColorTracker.cs
- Base64Encoder.cs
- FontStretches.cs
- MatrixKeyFrameCollection.cs
- compensatingcollection.cs
- OutputCacheSection.cs
- HwndPanningFeedback.cs
- SQLByteStorage.cs
- DeferredElementTreeState.cs
- WSSecurityXXX2005.cs
- CharEnumerator.cs
- SrgsElementList.cs
- ObjectRef.cs
- Int64AnimationUsingKeyFrames.cs
- CopyNodeSetAction.cs
- BitVector32.cs
- CommonObjectSecurity.cs
- CodeDelegateInvokeExpression.cs
- RegexStringValidator.cs
- documentsequencetextcontainer.cs
- CapabilitiesSection.cs
- GrammarBuilderBase.cs
- DataGridViewRowCancelEventArgs.cs
- GridViewHeaderRowPresenter.cs
- CacheChildrenQuery.cs
- CodeBlockBuilder.cs
- ExceptionAggregator.cs
- HtmlInputReset.cs