Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Common / EntitySql / Expr.cs / 1 / Expr.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backup [....]
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
{
using System;
using System.Globalization;
using System.Collections;
using System.Collections.Generic;
enum AstExprKind
{
Generic,
Query,
Insert,
Update,
Delete
}
///
/// Represents the base type of all Expression Nodes
///
internal abstract class Expr : AstNode
{
internal Expr() : base() { }
internal Expr( string query, int inputPos ) : base(query, inputPos) { }
internal virtual AstExprKind ExprKind
{
get { return AstExprKind.Generic; }
}
}
///
/// Represents generic list of expressions.
///
/// expression type
internal sealed class ExprList : Expr, System.Collections.Generic.IEnumerable
{
private List _exprList = new List();
///
/// default constructor
///
internal ExprList()
{
}
///
/// initializes adding one item to the list.
///
/// expression
internal ExprList( T item )
{
_exprList.Add(item);
}
///
/// add an expression to the expression list.
///
/// Expression
/// Updated ExpressionList
internal ExprList Add( T item )
{
_exprList.Add(item);
return this;
}
///
/// Returns the list of expressions
///
internal List Expressions
{
get { return _exprList; }
}
#if __WHEN_NEEDED__
///
/// Verifies if list elements if of specified type.
///
/// instance of a given type
/// true if is the same type, false otherwise
internal bool IsListOf( object o )
{
return o.GetType().Equals( typeof( T ) );
}
#endif
///
/// Returns the number of elements in the list
///
internal int Count
{
get { return _exprList.Count; }
}
///
/// Indexer to the list entries.
///
/// integer position of the element in the list
/// Expression
internal T this[int index]
{
get { return _exprList[index]; }
}
#region GetEnumerator
System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator()
{
return _exprList.GetEnumerator();
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return _exprList.GetEnumerator();
}
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backup [....]
//---------------------------------------------------------------------
namespace System.Data.Common.EntitySql
{
using System;
using System.Globalization;
using System.Collections;
using System.Collections.Generic;
enum AstExprKind
{
Generic,
Query,
Insert,
Update,
Delete
}
///
/// Represents the base type of all Expression Nodes
///
internal abstract class Expr : AstNode
{
internal Expr() : base() { }
internal Expr( string query, int inputPos ) : base(query, inputPos) { }
internal virtual AstExprKind ExprKind
{
get { return AstExprKind.Generic; }
}
}
///
/// Represents generic list of expressions.
///
/// expression type
internal sealed class ExprList : Expr, System.Collections.Generic.IEnumerable
{
private List _exprList = new List();
///
/// default constructor
///
internal ExprList()
{
}
///
/// initializes adding one item to the list.
///
/// expression
internal ExprList( T item )
{
_exprList.Add(item);
}
///
/// add an expression to the expression list.
///
/// Expression
/// Updated ExpressionList
internal ExprList Add( T item )
{
_exprList.Add(item);
return this;
}
///
/// Returns the list of expressions
///
internal List Expressions
{
get { return _exprList; }
}
#if __WHEN_NEEDED__
///
/// Verifies if list elements if of specified type.
///
/// instance of a given type
/// true if is the same type, false otherwise
internal bool IsListOf( object o )
{
return o.GetType().Equals( typeof( T ) );
}
#endif
///
/// Returns the number of elements in the list
///
internal int Count
{
get { return _exprList.Count; }
}
///
/// Indexer to the list entries.
///
/// integer position of the element in the list
/// Expression
internal T this[int index]
{
get { return _exprList[index]; }
}
#region GetEnumerator
System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator()
{
return _exprList.GetEnumerator();
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return _exprList.GetEnumerator();
}
#endregion
}
}
// 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
- AttributeConverter.cs
- ResourceCodeDomSerializer.cs
- TextContainerHelper.cs
- ColorMap.cs
- ConnectionManagementElementCollection.cs
- StatusBarItemAutomationPeer.cs
- GridViewItemAutomationPeer.cs
- TextEvent.cs
- ToolStripItemRenderEventArgs.cs
- TerminateWorkflow.cs
- MeasureData.cs
- DynamicRenderer.cs
- ChannelSinkStacks.cs
- TimeStampChecker.cs
- AttributeCollection.cs
- SinglePageViewer.cs
- AdvancedBindingPropertyDescriptor.cs
- TypeResolver.cs
- RolePrincipal.cs
- FormViewPageEventArgs.cs
- FacetDescriptionElement.cs
- InstanceStoreQueryResult.cs
- EncoderParameters.cs
- HtmlTernaryTree.cs
- DataTableMapping.cs
- AsymmetricSignatureFormatter.cs
- NetSectionGroup.cs
- DefaultAuthorizationContext.cs
- BooleanAnimationBase.cs
- InputReport.cs
- SerializationFieldInfo.cs
- EventProviderBase.cs
- JoinTreeSlot.cs
- WhitespaceRuleLookup.cs
- IsolatedStorageFilePermission.cs
- StoreContentChangedEventArgs.cs
- DiscoveryClient.cs
- EastAsianLunisolarCalendar.cs
- ColumnTypeConverter.cs
- GridViewSortEventArgs.cs
- PropertyToken.cs
- SystemGatewayIPAddressInformation.cs
- DrawingVisualDrawingContext.cs
- FloatUtil.cs
- RegionIterator.cs
- RedBlackList.cs
- DependencyPropertyKind.cs
- ScrollViewerAutomationPeer.cs
- UpDownEvent.cs
- ColorTranslator.cs
- CookieProtection.cs
- ObjectIDGenerator.cs
- AbandonedMutexException.cs
- StateItem.cs
- TextTreeFixupNode.cs
- WebPartMenuStyle.cs
- SafeRightsManagementPubHandle.cs
- HandleInitializationContext.cs
- RenderingEventArgs.cs
- SiteIdentityPermission.cs
- SymLanguageVendor.cs
- InternalDispatchObject.cs
- RowUpdatingEventArgs.cs
- XmlTextReaderImplHelpers.cs
- PartitionResolver.cs
- MemoryFailPoint.cs
- Guid.cs
- TdsRecordBufferSetter.cs
- MouseWheelEventArgs.cs
- UpdateTracker.cs
- basecomparevalidator.cs
- EnglishPluralizationService.cs
- XsltArgumentList.cs
- CodeTypeDeclaration.cs
- MulticastDelegate.cs
- SQLSingleStorage.cs
- CreateUserWizard.cs
- StringReader.cs
- Math.cs
- AutomationProperties.cs
- OleDbErrorCollection.cs
- Attributes.cs
- QualifiedCellIdBoolean.cs
- ContentElement.cs
- PlaceHolder.cs
- AnnotationMap.cs
- StyleSheetComponentEditor.cs
- JsonServiceDocumentSerializer.cs
- DataGridViewRow.cs
- URLString.cs
- QueryPrefixOp.cs
- HandleDictionary.cs
- MessageCredentialType.cs
- LateBoundChannelParameterCollection.cs
- DocumentAutomationPeer.cs
- NativeObjectSecurity.cs
- PackageStore.cs
- LocalizationComments.cs
- WindowsFormsHost.cs
- HostingEnvironmentSection.cs