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 / Map / Update / Internal / UpdateExpressionVisitor.cs / 1 / UpdateExpressionVisitor.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
namespace System.Data.Mapping.Update.Internal
{
///
/// Abstract implementation of node visitor that allows the specification of visit methods
/// for different node types (VisitPre virtual methods) and evaluation of nodes with respect
/// to the typed (TReturn) return values of their children.
///
///
/// This is not a general purpose class. It is tailored to the needs of the update pipeline.
///
/// All virtual methods throw NotSupportedException (must be explicitly overridden by each visitor).
///
/// Return type for the visitor
internal abstract class UpdateExpressionVisitor : DbExpressionVisitor
{
///
/// Gets the name of this visitor for debugging and tracing purposes.
///
protected abstract string VisitorName
{
get;
}
///
/// Utility method to generate an exception when unsupported node types are encountered.
///
/// Unsupported node
/// Not supported exception
protected NotSupportedException ConstructNotSupportedException(DbExpression node)
{
string nodeKind = null == node ? null :
node.ExpressionKind.ToString();
return EntityUtil.NotSupported(
System.Data.Entity.Strings.Update_UnsupportedExpressionKind(nodeKind, VisitorName));
}
#region IExpressionVisitor Members
public override TReturn Visit(DbExpression expression)
{
if (null != expression)
{
return expression.Accept(this);
}
else
{
throw ConstructNotSupportedException(expression);
}
}
public override TReturn Visit(DbAndExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbApplyExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbArithmeticExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbCaseExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbCastExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbComparisonExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbConstantExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbCrossJoinExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbDerefExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbDistinctExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbElementExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbExceptExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbFilterExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbFunctionExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbEntityRefExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbRefKeyExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbGroupByExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbIntersectExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbIsEmptyExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbIsNullExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbIsOfExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbJoinExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbLikeExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbLimitExpression expression)
{
throw ConstructNotSupportedException(expression);
}
#if METHOD_EXPRESSION
public override TReturn Visit(MethodExpression expression)
{
throw ConstructNotSupportedException(expression);
}
#endif
public override TReturn Visit(DbNewInstanceExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbNotExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbNullExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbOfTypeExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbOrExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbParameterReferenceExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbProjectExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbPropertyExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbQuantifierExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbRefExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbRelationshipNavigationExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbSkipExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbSortExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbTreatExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbUnionAllExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbVariableReferenceExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbScanExpression expression)
{
throw ConstructNotSupportedException(expression);
}
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//---------------------------------------------------------------------
using System.Data.Common.CommandTrees;
namespace System.Data.Mapping.Update.Internal
{
///
/// Abstract implementation of node visitor that allows the specification of visit methods
/// for different node types (VisitPre virtual methods) and evaluation of nodes with respect
/// to the typed (TReturn) return values of their children.
///
///
/// This is not a general purpose class. It is tailored to the needs of the update pipeline.
///
/// All virtual methods throw NotSupportedException (must be explicitly overridden by each visitor).
///
/// Return type for the visitor
internal abstract class UpdateExpressionVisitor : DbExpressionVisitor
{
///
/// Gets the name of this visitor for debugging and tracing purposes.
///
protected abstract string VisitorName
{
get;
}
///
/// Utility method to generate an exception when unsupported node types are encountered.
///
/// Unsupported node
/// Not supported exception
protected NotSupportedException ConstructNotSupportedException(DbExpression node)
{
string nodeKind = null == node ? null :
node.ExpressionKind.ToString();
return EntityUtil.NotSupported(
System.Data.Entity.Strings.Update_UnsupportedExpressionKind(nodeKind, VisitorName));
}
#region IExpressionVisitor Members
public override TReturn Visit(DbExpression expression)
{
if (null != expression)
{
return expression.Accept(this);
}
else
{
throw ConstructNotSupportedException(expression);
}
}
public override TReturn Visit(DbAndExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbApplyExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbArithmeticExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbCaseExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbCastExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbComparisonExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbConstantExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbCrossJoinExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbDerefExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbDistinctExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbElementExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbExceptExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbFilterExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbFunctionExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbEntityRefExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbRefKeyExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbGroupByExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbIntersectExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbIsEmptyExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbIsNullExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbIsOfExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbJoinExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbLikeExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbLimitExpression expression)
{
throw ConstructNotSupportedException(expression);
}
#if METHOD_EXPRESSION
public override TReturn Visit(MethodExpression expression)
{
throw ConstructNotSupportedException(expression);
}
#endif
public override TReturn Visit(DbNewInstanceExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbNotExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbNullExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbOfTypeExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbOrExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbParameterReferenceExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbProjectExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbPropertyExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbQuantifierExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbRefExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbRelationshipNavigationExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbSkipExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbSortExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbTreatExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbUnionAllExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbVariableReferenceExpression expression)
{
throw ConstructNotSupportedException(expression);
}
public override TReturn Visit(DbScanExpression expression)
{
throw ConstructNotSupportedException(expression);
}
#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
- ListViewEditEventArgs.cs
- WindowsToolbarItemAsMenuItem.cs
- WebException.cs
- TimeoutValidationAttribute.cs
- BaseHashHelper.cs
- EdmToObjectNamespaceMap.cs
- DataGridViewButtonCell.cs
- SessionStateUtil.cs
- EntityContainerEntitySet.cs
- XmlFormatExtensionPrefixAttribute.cs
- SchemaCollectionPreprocessor.cs
- SessionStateModule.cs
- DataObjectSettingDataEventArgs.cs
- RegexCapture.cs
- SortDescription.cs
- _CommandStream.cs
- XmlReflectionMember.cs
- WsdlBuildProvider.cs
- CustomWebEventKey.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- TextOptionsInternal.cs
- URL.cs
- ReflectionPermission.cs
- PropertyNames.cs
- EventsTab.cs
- TextContainerChangedEventArgs.cs
- AddInAttribute.cs
- SurrogateEncoder.cs
- ToggleButtonAutomationPeer.cs
- CodeAccessPermission.cs
- AdjustableArrowCap.cs
- DocumentPageHost.cs
- translator.cs
- DataKey.cs
- RecommendedAsConfigurableAttribute.cs
- WebPartAddingEventArgs.cs
- streamingZipPartStream.cs
- SwitchAttribute.cs
- ToolboxItemAttribute.cs
- WebPartVerb.cs
- DataSourceUtil.cs
- ConnectionStringsExpressionBuilder.cs
- CellCreator.cs
- XmlCDATASection.cs
- CompareValidator.cs
- PrivilegedConfigurationManager.cs
- PageContentAsyncResult.cs
- Overlapped.cs
- InkCanvasInnerCanvas.cs
- SortedList.cs
- DataDesignUtil.cs
- OdbcCommandBuilder.cs
- HtmlWindow.cs
- TaskResultSetter.cs
- ServiceDefaults.cs
- CharEnumerator.cs
- MemberCollection.cs
- CodeRemoveEventStatement.cs
- TypeContext.cs
- AssemblyCollection.cs
- ClusterSafeNativeMethods.cs
- ByteStreamGeometryContext.cs
- SmtpSpecifiedPickupDirectoryElement.cs
- FileDataSourceCache.cs
- Stroke.cs
- ToolStripProgressBar.cs
- ServiceNameElement.cs
- Pointer.cs
- ReliableChannelFactory.cs
- ConfigurationSettings.cs
- ProxyWebPartConnectionCollection.cs
- SortAction.cs
- ParserContext.cs
- ConfigXmlText.cs
- ThemeDictionaryExtension.cs
- BitStream.cs
- TreeViewAutomationPeer.cs
- _NTAuthentication.cs
- TreeNodeConverter.cs
- MultiTargetingUtil.cs
- PropertyEmitterBase.cs
- PrtCap_Builder.cs
- WeakReference.cs
- TreeBuilderXamlTranslator.cs
- WebPartEventArgs.cs
- XmlWellformedWriterHelpers.cs
- UInt64.cs
- Literal.cs
- DrawTreeNodeEventArgs.cs
- FieldBuilder.cs
- SoapExtensionTypeElement.cs
- FixedTextView.cs
- MsmqIntegrationBindingElement.cs
- UnsafeNativeMethods.cs
- ScrollBarRenderer.cs
- VolatileResourceManager.cs
- Point.cs
- FixedBufferAttribute.cs
- LongValidator.cs
- XmlSchemaComplexType.cs