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
- AdjustableArrowCap.cs
- TextServicesDisplayAttribute.cs
- CqlParserHelpers.cs
- XamlWriter.cs
- RepeaterCommandEventArgs.cs
- SafeProcessHandle.cs
- PersistenceMetadataNamespace.cs
- DiscoveryDocumentSerializer.cs
- TrustLevel.cs
- HotSpotCollection.cs
- ApplicationFileParser.cs
- MachineKeyConverter.cs
- CapabilitiesPattern.cs
- DataObjectMethodAttribute.cs
- KeyInfo.cs
- Version.cs
- CommonObjectSecurity.cs
- DateTimeSerializationSection.cs
- SeverityFilter.cs
- TemplateBindingExpressionConverter.cs
- ChtmlTextWriter.cs
- TypeUnloadedException.cs
- NameValuePair.cs
- BooleanFacetDescriptionElement.cs
- OleDbException.cs
- DataGridViewCellEventArgs.cs
- XappLauncher.cs
- SelectedDatesCollection.cs
- RegexBoyerMoore.cs
- WhileDesigner.xaml.cs
- FontDialog.cs
- WebScriptMetadataMessage.cs
- IntegerCollectionEditor.cs
- AddInControllerImpl.cs
- IDQuery.cs
- WasAdminWrapper.cs
- ServerValidateEventArgs.cs
- Exceptions.cs
- RelatedPropertyManager.cs
- Annotation.cs
- DataSourceView.cs
- PartialList.cs
- ContentElementCollection.cs
- SecurityCredentialsManager.cs
- SafeBuffer.cs
- FragmentNavigationEventArgs.cs
- ObjectListCommandsPage.cs
- LinqDataSourceUpdateEventArgs.cs
- HttpContextWrapper.cs
- WebPartZoneCollection.cs
- LocatorPart.cs
- DataAdapter.cs
- NameValuePermission.cs
- Timer.cs
- XmlNodeList.cs
- ReachBasicContext.cs
- BypassElement.cs
- ZoneMembershipCondition.cs
- SettingsSection.cs
- UnionCqlBlock.cs
- CommonRemoteMemoryBlock.cs
- Metadata.cs
- EmbeddedObject.cs
- WebException.cs
- DataMemberAttribute.cs
- FormsIdentity.cs
- HelpKeywordAttribute.cs
- ParseChildrenAsPropertiesAttribute.cs
- ZipIOExtraFieldZip64Element.cs
- TabletDevice.cs
- BasicHttpMessageSecurityElement.cs
- DataBoundControlHelper.cs
- ToolbarAUtomationPeer.cs
- TdsParserSafeHandles.cs
- ProxyElement.cs
- TextParaClient.cs
- ConsoleCancelEventArgs.cs
- MemoryStream.cs
- Pkcs9Attribute.cs
- SingleStorage.cs
- SqlConnectionHelper.cs
- UnsafeNetInfoNativeMethods.cs
- ValidationHelper.cs
- DeploymentExceptionMapper.cs
- MimeParameter.cs
- ProxyGenerator.cs
- SafeCertificateStore.cs
- CodeDOMUtility.cs
- RecognizedAudio.cs
- IList.cs
- CompModSwitches.cs
- shaper.cs
- ContentPlaceHolder.cs
- ByteStack.cs
- MouseActionValueSerializer.cs
- IntPtr.cs
- PipeConnection.cs
- SystemIcons.cs
- Timer.cs
- XmlILAnnotation.cs