Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / Microsoft / Scripting / Ast / ParameterExpression.cs / 1305376 / ParameterExpression.cs
/* **************************************************************************** * * Copyright (c) Microsoft Corporation. * * This source code is subject to terms and conditions of the Microsoft Public License. A * copy of the license can be found in the License.html file at the root of this distribution. If * you cannot locate the Microsoft Public License, please send an email to * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound * by the terms of the Microsoft Public License. * * You must not remove this notice, or any other, from this software. * * * ***************************************************************************/ using System.Diagnostics; using System.Dynamic.Utils; #if SILVERLIGHT using System.Core; #endif namespace System.Linq.Expressions { ////// Represents a named parameter expression. /// #if !SILVERLIGHT [DebuggerTypeProxy(typeof(Expression.ParameterExpressionProxy))] #endif public class ParameterExpression : Expression { private readonly string _name; internal ParameterExpression(string name) { _name = name; } internal static ParameterExpression Make(Type type, string name, bool isByRef) { if (isByRef) { return new ByRefParameterExpression(type, name); } else { if (!type.IsEnum) { switch (Type.GetTypeCode(type)) { case TypeCode.Boolean: return new PrimitiveParameterExpression(name); case TypeCode.Byte: return new PrimitiveParameterExpression (name); case TypeCode.Char: return new PrimitiveParameterExpression (name); case TypeCode.DateTime: return new PrimitiveParameterExpression (name); case TypeCode.DBNull: return new PrimitiveParameterExpression (name); case TypeCode.Decimal: return new PrimitiveParameterExpression (name); case TypeCode.Double: return new PrimitiveParameterExpression (name); case TypeCode.Int16: return new PrimitiveParameterExpression (name); case TypeCode.Int32: return new PrimitiveParameterExpression (name); case TypeCode.Int64: return new PrimitiveParameterExpression (name); case TypeCode.Object: // common reference types which we optimize go here. Of course object is in // the list, the others are driven by profiling of various workloads. This list // should be kept short. if (type == typeof(object)) { return new ParameterExpression(name); } else if (type == typeof(Exception)) { return new PrimitiveParameterExpression (name); } else if (type == typeof(object[])) { return new PrimitiveParameterExpression
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- MissingSatelliteAssemblyException.cs
- QueryResults.cs
- InputManager.cs
- XmlLanguage.cs
- Label.cs
- SortDescriptionCollection.cs
- CodeRemoveEventStatement.cs
- OpenTypeLayout.cs
- ArraySegment.cs
- ConsoleTraceListener.cs
- MailMessageEventArgs.cs
- EventQueueState.cs
- ScrollChrome.cs
- EntityProviderServices.cs
- RequestCachePolicyConverter.cs
- embossbitmapeffect.cs
- DataGridPageChangedEventArgs.cs
- IgnoreFileBuildProvider.cs
- IgnoreDataMemberAttribute.cs
- TypeConverterBase.cs
- Point3DCollectionConverter.cs
- DesignerTransaction.cs
- EventMap.cs
- Int32CollectionConverter.cs
- OptimizedTemplateContent.cs
- UrlMappingsSection.cs
- ObjectTag.cs
- WebControl.cs
- ManualResetEvent.cs
- ManipulationVelocities.cs
- DataError.cs
- ProcessHost.cs
- SiteMapNodeCollection.cs
- PropertiesTab.cs
- StrokeSerializer.cs
- HandleCollector.cs
- CreateDataSourceDialog.cs
- TypeUtil.cs
- LineBreak.cs
- EnumMember.cs
- EventHandlerList.cs
- SqlDuplicator.cs
- PerspectiveCamera.cs
- BevelBitmapEffect.cs
- URL.cs
- UIElementParaClient.cs
- XamlRtfConverter.cs
- HashMembershipCondition.cs
- QilExpression.cs
- TextElement.cs
- SnapLine.cs
- SessionSwitchEventArgs.cs
- MembershipAdapter.cs
- RadioButtonAutomationPeer.cs
- AppDomainManager.cs
- GridViewRowPresenter.cs
- DataGridViewTopRowAccessibleObject.cs
- Point3DIndependentAnimationStorage.cs
- SelectorAutomationPeer.cs
- FormViewDesigner.cs
- StdValidatorsAndConverters.cs
- ErrorInfoXmlDocument.cs
- DataTable.cs
- DataServiceExpressionVisitor.cs
- SBCSCodePageEncoding.cs
- SchemaTypeEmitter.cs
- TableLayoutRowStyleCollection.cs
- COM2ComponentEditor.cs
- Dispatcher.cs
- MarkupExtensionParser.cs
- DiscoveryDocument.cs
- SRGSCompiler.cs
- BamlResourceSerializer.cs
- BitVector32.cs
- ContractUtils.cs
- HttpCacheVaryByContentEncodings.cs
- RequiredFieldValidator.cs
- GuidelineCollection.cs
- Utils.cs
- OpCopier.cs
- Stylus.cs
- FreezableDefaultValueFactory.cs
- SystemWebExtensionsSectionGroup.cs
- ServiceAuthorizationElement.cs
- SafeProcessHandle.cs
- OperationResponse.cs
- Rect3DConverter.cs
- PartialList.cs
- XamlRtfConverter.cs
- MenuScrollingVisibilityConverter.cs
- Emitter.cs
- RSAPKCS1SignatureDeformatter.cs
- ProxyHwnd.cs
- LambdaCompiler.Address.cs
- CodeMemberMethod.cs
- Misc.cs
- ArgIterator.cs
- DataGridViewCheckBoxCell.cs
- TextRunProperties.cs
- UdpDuplexChannel.cs