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
- TemplateBindingExpressionConverter.cs
- ReflectTypeDescriptionProvider.cs
- BamlTreeUpdater.cs
- HTTPNotFoundHandler.cs
- SqlException.cs
- TimerEventSubscription.cs
- ProxyGenerator.cs
- CodeDOMUtility.cs
- AssemblyBuilderData.cs
- TextElementCollection.cs
- ExpandSegment.cs
- InputQueue.cs
- mediaeventshelper.cs
- CalendarDay.cs
- XmlUtil.cs
- Thumb.cs
- ScriptModule.cs
- LinqDataSourceDisposeEventArgs.cs
- MonitorWrapper.cs
- CreateUserWizard.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- ColorTransform.cs
- XXXOnTypeBuilderInstantiation.cs
- HatchBrush.cs
- ProfileGroupSettings.cs
- TabPage.cs
- NativeWindow.cs
- ProviderBase.cs
- GradientStop.cs
- unsafenativemethodsother.cs
- PersonalizationStateQuery.cs
- RegexRunnerFactory.cs
- BufferedGraphicsContext.cs
- NetworkCredential.cs
- AnimationLayer.cs
- IisTraceListener.cs
- AssemblyUtil.cs
- DependencyObjectProvider.cs
- GridItemPattern.cs
- DataIdProcessor.cs
- GradientBrush.cs
- DataGridCell.cs
- TextParagraph.cs
- ReferencedType.cs
- InstanceHandleReference.cs
- MdiWindowListItemConverter.cs
- LogicalChannel.cs
- CorrelationHandle.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- FixedPageAutomationPeer.cs
- ByteAnimation.cs
- Timer.cs
- WebPartChrome.cs
- SelectionUIService.cs
- HexParser.cs
- ConsoleCancelEventArgs.cs
- EventLogQuery.cs
- InvalidProgramException.cs
- WebMessageBodyStyleHelper.cs
- unsafeIndexingFilterStream.cs
- EventRecord.cs
- NativeObjectSecurity.cs
- DiagnosticsConfiguration.cs
- TaskHelper.cs
- WebPartTransformer.cs
- PackWebRequest.cs
- QueryCacheEntry.cs
- CollectionChangeEventArgs.cs
- ContentHostHelper.cs
- LinqDataSourceContextData.cs
- BulletedListEventArgs.cs
- CodeGroup.cs
- cookieexception.cs
- MonitorWrapper.cs
- XmlWriterSettings.cs
- InternalSafeNativeMethods.cs
- QueryCursorEventArgs.cs
- ListBoxItemWrapperAutomationPeer.cs
- DrawingContextWalker.cs
- BindingParameterCollection.cs
- Hash.cs
- StreamingContext.cs
- SelectionRangeConverter.cs
- ModelUIElement3D.cs
- ExtensionMethods.cs
- CounterCreationDataConverter.cs
- Application.cs
- XmlSchemaCompilationSettings.cs
- WebGetAttribute.cs
- InstalledVoice.cs
- SetterBaseCollection.cs
- FixedFlowMap.cs
- RoleService.cs
- PeerContact.cs
- ToolBarPanel.cs
- BitmapSource.cs
- DBProviderConfigurationHandler.cs
- AmbientProperties.cs
- CipherData.cs
- SqlDataSourceView.cs