Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWebControlsDesign / System / Data / WebControls / Design / EntityDesignerDataSourceView.cs / 1305376 / EntityDesignerDataSourceView.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//-----------------------------------------------------------------------------
using System.Collections;
using System.Data;
using System.Web.UI.Design;
namespace System.Web.UI.Design.WebControls
{
public class EntityDesignerDataSourceView : DesignerDataSourceView
{
private EntityDataSourceDesignerHelper _helper;
public EntityDesignerDataSourceView(EntityDataSourceDesigner owner)
: base(owner, EntityDataSourceDesignerHelper.DefaultViewName)
{
_helper = owner.Helper;
}
public override bool CanDelete
{
get
{
return CanModify && _helper.EnableDelete;
}
}
public override bool CanInsert
{
get
{
return CanModify && _helper.EnableInsert;
}
}
internal bool CanModify
{
get
{
return !String.IsNullOrEmpty(_helper.EntitySetName) &&
String.IsNullOrEmpty(_helper.Select) &&
String.IsNullOrEmpty(_helper.CommandText) &&
String.IsNullOrEmpty(_helper.GroupBy);
}
}
public override bool CanPage
{
get
{
return _helper.CanPage;
}
}
public override bool CanSort
{
get
{
return _helper.CanSort;
}
}
public override bool CanUpdate
{
get
{
return CanModify && _helper.EnableUpdate;
}
}
public override IDataSourceViewSchema Schema
{
get
{
DataTable schemaTable = _helper.LoadSchema();
if (schemaTable == null)
{
return null;
}
return new DataSetViewSchema(schemaTable);
}
}
public override IEnumerable GetDesignTimeData(int minimumRows, out bool isSampleData)
{
DataTable schemaTable = _helper.LoadSchema();
if (schemaTable != null)
{
isSampleData = true;
return DesignTimeData.GetDesignTimeDataSource(DesignTimeData.CreateSampleDataTable(new DataView(schemaTable), true), minimumRows);
}
// Couldn't find design-time schema, use base implementation
return base.GetDesignTimeData(minimumRows, out isSampleData);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//-----------------------------------------------------------------------------
using System.Collections;
using System.Data;
using System.Web.UI.Design;
namespace System.Web.UI.Design.WebControls
{
public class EntityDesignerDataSourceView : DesignerDataSourceView
{
private EntityDataSourceDesignerHelper _helper;
public EntityDesignerDataSourceView(EntityDataSourceDesigner owner)
: base(owner, EntityDataSourceDesignerHelper.DefaultViewName)
{
_helper = owner.Helper;
}
public override bool CanDelete
{
get
{
return CanModify && _helper.EnableDelete;
}
}
public override bool CanInsert
{
get
{
return CanModify && _helper.EnableInsert;
}
}
internal bool CanModify
{
get
{
return !String.IsNullOrEmpty(_helper.EntitySetName) &&
String.IsNullOrEmpty(_helper.Select) &&
String.IsNullOrEmpty(_helper.CommandText) &&
String.IsNullOrEmpty(_helper.GroupBy);
}
}
public override bool CanPage
{
get
{
return _helper.CanPage;
}
}
public override bool CanSort
{
get
{
return _helper.CanSort;
}
}
public override bool CanUpdate
{
get
{
return CanModify && _helper.EnableUpdate;
}
}
public override IDataSourceViewSchema Schema
{
get
{
DataTable schemaTable = _helper.LoadSchema();
if (schemaTable == null)
{
return null;
}
return new DataSetViewSchema(schemaTable);
}
}
public override IEnumerable GetDesignTimeData(int minimumRows, out bool isSampleData)
{
DataTable schemaTable = _helper.LoadSchema();
if (schemaTable != null)
{
isSampleData = true;
return DesignTimeData.GetDesignTimeDataSource(DesignTimeData.CreateSampleDataTable(new DataView(schemaTable), true), minimumRows);
}
// Couldn't find design-time schema, use base implementation
return base.GetDesignTimeData(minimumRows, out isSampleData);
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CachedResourceDictionaryExtension.cs
- SqlTransaction.cs
- PageThemeBuildProvider.cs
- SapiRecoContext.cs
- ContentElement.cs
- webproxy.cs
- FontStretches.cs
- XPathDocument.cs
- MD5CryptoServiceProvider.cs
- ProgressBarRenderer.cs
- SegmentInfo.cs
- DataConnectionHelper.cs
- SinglePhaseEnlistment.cs
- AssociationEndMember.cs
- DataGridViewCellStyleConverter.cs
- SqlFileStream.cs
- WebPartConnectionsCancelVerb.cs
- DataSourceBooleanViewSchemaConverter.cs
- IsolatedStorageFilePermission.cs
- EventHandlersStore.cs
- TextTreeRootTextBlock.cs
- Shape.cs
- DataGridViewSelectedColumnCollection.cs
- PageCatalogPart.cs
- PingOptions.cs
- TextureBrush.cs
- PerformanceCountersElement.cs
- ToolStripActionList.cs
- HtmlInputReset.cs
- SkipStoryboardToFill.cs
- PointLight.cs
- AssemblyContextControlItem.cs
- BinaryFormatterWriter.cs
- BindToObject.cs
- InvalidOleVariantTypeException.cs
- SymLanguageType.cs
- ScrollProviderWrapper.cs
- ServiceNameCollection.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- RelationshipDetailsRow.cs
- InternalControlCollection.cs
- SHA512Managed.cs
- RootProjectionNode.cs
- SaveFileDialog.cs
- Drawing.cs
- HybridCollection.cs
- Int16Converter.cs
- Codec.cs
- RenderData.cs
- WorkflowWebHostingModule.cs
- ApplicationFileParser.cs
- SynchronizedDispatch.cs
- DbMetaDataColumnNames.cs
- EncodingFallbackAwareXmlTextWriter.cs
- SrgsRule.cs
- MenuItemStyleCollection.cs
- RepeaterCommandEventArgs.cs
- GPStream.cs
- Convert.cs
- X509ThumbprintKeyIdentifierClause.cs
- StaticContext.cs
- CustomErrorsSection.cs
- BaseResourcesBuildProvider.cs
- MsmqInputSessionChannel.cs
- ExpressionBuilder.cs
- HMACSHA512.cs
- NumericPagerField.cs
- LiteralControl.cs
- BuilderPropertyEntry.cs
- ExpressionBindingCollection.cs
- ObjectDisposedException.cs
- ArrayHelper.cs
- VisualStyleRenderer.cs
- CodeDirectionExpression.cs
- CroppedBitmap.cs
- EventlogProvider.cs
- ClrProviderManifest.cs
- Interlocked.cs
- Scripts.cs
- ColorContextHelper.cs
- CacheModeValueSerializer.cs
- Stopwatch.cs
- EdmMember.cs
- SerializationObjectManager.cs
- MenuCommands.cs
- SettingsAttributes.cs
- DataGrid.cs
- TreeNodeCollection.cs
- Menu.cs
- SamlSubject.cs
- ACE.cs
- CodeExpressionStatement.cs
- ToolStripItemClickedEventArgs.cs
- EntityReference.cs
- Nodes.cs
- AttributeProviderAttribute.cs
- BaseTemplateCodeDomTreeGenerator.cs
- DbExpressionVisitor_TResultType.cs
- BitArray.cs
- ExtentJoinTreeNode.cs