Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataSet / System / Data / TypedTableBase.cs / 1 / TypedTableBase.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
// spather
//-----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.Serialization;
namespace System.Data {
///
/// This is the generic base class for TypedDataSet
///
[Serializable]
public abstract class TypedTableBase : DataTable, IEnumerable where T : DataRow {
///
/// Default constructor for generic TypedTableBase.
/// Will be called by generated Typed DataSet classes and is not for public use.
///
protected TypedTableBase() : base() {}
///
/// Constructor for the generic TypedTableBase with takes SerializationInfo and StreamingContext.
/// Will be called by generated Typed DataSet classes and
/// is not for public use.
///
///
/// SerializationInfo containing data to construct the object.
///
///
/// The streaming context for the object being deserializad.
///
protected TypedTableBase(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context) {}
///
/// This property returns a enumerator of T for the TypedTable. Note, this could
/// execute the underlying Linq expression.
///
///
/// IEnumerable of T.
///
public IEnumerator GetEnumerator() {
return this.Rows.Cast().GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator() {
return GetEnumerator();
}
///
/// Casts an EnumerableDataTable_TSource into EnumerableDataTable_TResult
///
public EnumerableRowCollection Cast()
{
EnumerableRowCollection erc = new EnumerableRowCollection((DataTable)this);
return erc.Cast();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// [....]
// spather
//-----------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.Serialization;
namespace System.Data {
///
/// This is the generic base class for TypedDataSet
///
[Serializable]
public abstract class TypedTableBase : DataTable, IEnumerable where T : DataRow {
///
/// Default constructor for generic TypedTableBase.
/// Will be called by generated Typed DataSet classes and is not for public use.
///
protected TypedTableBase() : base() {}
///
/// Constructor for the generic TypedTableBase with takes SerializationInfo and StreamingContext.
/// Will be called by generated Typed DataSet classes and
/// is not for public use.
///
///
/// SerializationInfo containing data to construct the object.
///
///
/// The streaming context for the object being deserializad.
///
protected TypedTableBase(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context) {}
///
/// This property returns a enumerator of T for the TypedTable. Note, this could
/// execute the underlying Linq expression.
///
///
/// IEnumerable of T.
///
public IEnumerator GetEnumerator() {
return this.Rows.Cast().GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator() {
return GetEnumerator();
}
///
/// Casts an EnumerableDataTable_TSource into EnumerableDataTable_TResult
///
public EnumerableRowCollection Cast()
{
EnumerableRowCollection erc = new EnumerableRowCollection((DataTable)this);
return erc.Cast();
}
}
}
// 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
- Point3DCollectionValueSerializer.cs
- DesigntimeLicenseContext.cs
- NumberFunctions.cs
- SocketException.cs
- ToolBar.cs
- DelegateArgumentReference.cs
- Mappings.cs
- DataSourceProvider.cs
- WeakReferenceEnumerator.cs
- XamlStyleSerializer.cs
- MSAAWinEventWrap.cs
- ToolBarOverflowPanel.cs
- CodeDirectionExpression.cs
- CollectionViewGroupInternal.cs
- CompilerCollection.cs
- GlyphElement.cs
- XsltOutput.cs
- BitmapSourceSafeMILHandle.cs
- COM2IDispatchConverter.cs
- PnrpPermission.cs
- XmlSchemaInclude.cs
- ProcessManager.cs
- GeneralTransformGroup.cs
- X509IssuerSerialKeyIdentifierClause.cs
- CapabilitiesRule.cs
- ObjectParameter.cs
- AsyncDataRequest.cs
- AlphabeticalEnumConverter.cs
- MessageSecurityOverMsmq.cs
- LinkLabel.cs
- TreeNodeEventArgs.cs
- NonBatchDirectoryCompiler.cs
- ExtensionDataReader.cs
- SqlParameter.cs
- PersonalizationAdministration.cs
- StringFunctions.cs
- VisualBrush.cs
- BlurBitmapEffect.cs
- AnnotationAdorner.cs
- _ScatterGatherBuffers.cs
- AppDomainProtocolHandler.cs
- ProviderSettings.cs
- ScriptModule.cs
- XmlSchemaRedefine.cs
- UpdateCompiler.cs
- ProtocolInformationReader.cs
- DbConnectionStringCommon.cs
- ExtensionDataReader.cs
- PrefixQName.cs
- PersistenceTypeAttribute.cs
- WebServiceEnumData.cs
- ColorConvertedBitmap.cs
- ActivityMarkupSerializationProvider.cs
- UrlMappingsSection.cs
- SortQuery.cs
- KeyInfo.cs
- UIElement3DAutomationPeer.cs
- DomNameTable.cs
- SqlCharStream.cs
- XPathNavigator.cs
- TransactionBehavior.cs
- UpdateTracker.cs
- LayoutTable.cs
- ChannelTokenTypeConverter.cs
- LoginView.cs
- SoapCodeExporter.cs
- OrthographicCamera.cs
- CalculatedColumn.cs
- CmsInterop.cs
- XmlDomTextWriter.cs
- HttpCacheParams.cs
- ScanQueryOperator.cs
- SortedList.cs
- SchemaRegistration.cs
- SchemaContext.cs
- SystemSounds.cs
- ResourceDefaultValueAttribute.cs
- UnitySerializationHolder.cs
- SchemaEntity.cs
- SqlRowUpdatedEvent.cs
- DeviceSpecificDialogCachedState.cs
- Timeline.cs
- KnownColorTable.cs
- As.cs
- As.cs
- DataGridViewAutoSizeColumnsModeEventArgs.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- Baml6Assembly.cs
- OutputCacheProviderCollection.cs
- AssociationEndMember.cs
- XmlAttributeCache.cs
- KeySpline.cs
- DecoderFallback.cs
- SecUtil.cs
- mactripleDES.cs
- TrustManagerPromptUI.cs
- CompareInfo.cs
- XmlSchemaCompilationSettings.cs
- ControlIdConverter.cs
- ClientRoleProvider.cs