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
- SetStoryboardSpeedRatio.cs
- CodeArrayCreateExpression.cs
- TreeBuilder.cs
- IisTraceListener.cs
- ScrollChrome.cs
- Ipv6Element.cs
- RecognitionEventArgs.cs
- IsolatedStorage.cs
- DataAdapter.cs
- XmlValueConverter.cs
- SerializationAttributes.cs
- DeferredBinaryDeserializerExtension.cs
- PreservationFileReader.cs
- PointKeyFrameCollection.cs
- ExceptionUtil.cs
- DateTimeFormatInfo.cs
- WindowsAuthenticationEventArgs.cs
- AccessText.cs
- SqlError.cs
- WhileDesigner.xaml.cs
- followingsibling.cs
- AcceptorSessionSymmetricMessageSecurityProtocol.cs
- UnauthorizedAccessException.cs
- XmlQualifiedNameTest.cs
- FloaterBaseParagraph.cs
- SqlPersonalizationProvider.cs
- WorkerRequest.cs
- CharAnimationBase.cs
- IBuiltInEvidence.cs
- AttachmentService.cs
- sqlstateclientmanager.cs
- DataSourceProvider.cs
- Endpoint.cs
- DocumentPage.cs
- IPAddressCollection.cs
- RequestUriProcessor.cs
- FileController.cs
- HtmlShimManager.cs
- MethodToken.cs
- EntityContainerRelationshipSet.cs
- RuntimeEnvironment.cs
- PropertyEmitter.cs
- GACIdentityPermission.cs
- XmlCharCheckingReader.cs
- SqlDataSourceRefreshSchemaForm.cs
- ellipse.cs
- DesignerView.Commands.cs
- InputLanguageProfileNotifySink.cs
- HtmlInputRadioButton.cs
- SchemaImporterExtensionsSection.cs
- AuthenticationModuleElement.cs
- NamespaceMapping.cs
- SystemResourceHost.cs
- WebPartConnectionsDisconnectVerb.cs
- ListViewDeleteEventArgs.cs
- FontStretches.cs
- ValidationSummary.cs
- RuntimeCompatibilityAttribute.cs
- Int16AnimationBase.cs
- _BaseOverlappedAsyncResult.cs
- MessageBox.cs
- ConstNode.cs
- ColumnPropertiesGroup.cs
- Config.cs
- TypeListConverter.cs
- RuleAttributes.cs
- XsltQilFactory.cs
- UInt32Storage.cs
- ModulesEntry.cs
- SynchronizationLockException.cs
- DependencyPropertyAttribute.cs
- UpdatePanelTrigger.cs
- StringDictionary.cs
- TagPrefixCollection.cs
- RepeatButtonAutomationPeer.cs
- InheritanceContextHelper.cs
- ControlPropertyNameConverter.cs
- ObjectManager.cs
- SerialStream.cs
- DateTime.cs
- ToolBar.cs
- SafeArrayRankMismatchException.cs
- Journal.cs
- EdgeProfileValidation.cs
- WindowAutomationPeer.cs
- PasswordTextNavigator.cs
- ExpressionsCollectionEditor.cs
- EditorZoneBase.cs
- Formatter.cs
- StringHelper.cs
- CriticalHandle.cs
- ResourceProviderFactory.cs
- XmlTextAttribute.cs
- DependencyProperty.cs
- PropertyInformation.cs
- datacache.cs
- SizeLimitedCache.cs
- DataSourceCacheDurationConverter.cs
- QueryOperatorEnumerator.cs
- Control.cs