Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / Microsoft / Scripting / Actions / ConvertBinder.cs / 1305376 / ConvertBinder.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.Dynamic.Utils; namespace System.Dynamic { ////// Represents the convert dynamic operation at the call site, providing the binding semantic and the details about the operation. /// public abstract class ConvertBinder : DynamicMetaObjectBinder { private readonly Type _type; private readonly bool _explicit; ////// Initializes a new intsance of the /// The type to convert to. /// true if the conversion should consider explicit conversions; otherwise, false. protected ConvertBinder(Type type, bool @explicit) { ContractUtils.RequiresNotNull(type, "type"); _type = type; _explicit = @explicit; } ///. /// /// The type to convert to. /// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods")] public Type Type { get { return _type; } } ////// Gets the value indicating if the conversion should consider explicit conversions. /// public bool Explicit { get { return _explicit; } } ////// Performs the binding of the dynamic convert operation if the target dynamic object cannot bind. /// /// The target of the dynamic convert operation. ///The public DynamicMetaObject FallbackConvert(DynamicMetaObject target) { return FallbackConvert(target, null); } ///representing the result of the binding. /// When overridden in the derived class, performs the binding of the dynamic convert operation if the target dynamic object cannot bind. /// /// The target of the dynamic convert operation. /// The binding result to use if binding fails, or null. ///The public abstract DynamicMetaObject FallbackConvert(DynamicMetaObject target, DynamicMetaObject errorSuggestion); ///representing the result of the binding. /// Performs the binding of the dynamic convert operation. /// /// The target of the dynamic convert operation. /// An array of arguments of the dynamic convert operation. ///The public sealed override DynamicMetaObject Bind(DynamicMetaObject target, DynamicMetaObject[] args) { ContractUtils.RequiresNotNull(target, "target"); ContractUtils.Requires(args == null || args.Length == 0, "args"); return target.BindConvert(this); } // this is a standard DynamicMetaObjectBinder internal override sealed bool IsStandardBinder { get { return true; } } ///representing the result of the binding. /// The result type of the operation. /// public override sealed Type ReturnType { get { return _type; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ApplicationServicesHostFactory.cs
- DbConnectionFactory.cs
- Rect3DValueSerializer.cs
- PassportIdentity.cs
- CookieParameter.cs
- KeyInfo.cs
- DebugHandleTracker.cs
- MobileControl.cs
- BitHelper.cs
- WebPermission.cs
- ComplexBindingPropertiesAttribute.cs
- DataSourceConverter.cs
- RemotingAttributes.cs
- DataGridViewCellCancelEventArgs.cs
- ZoneButton.cs
- SelectionHighlightInfo.cs
- MeshGeometry3D.cs
- CodeTypeMemberCollection.cs
- UnmanagedMemoryStreamWrapper.cs
- TextHintingModeValidation.cs
- XPathDocumentNavigator.cs
- DesignerAutoFormat.cs
- CacheAxisQuery.cs
- CommonXSendMessage.cs
- XsdCachingReader.cs
- OLEDB_Enum.cs
- ManipulationDeltaEventArgs.cs
- WebPartEditVerb.cs
- SQLChars.cs
- XamlReader.cs
- WeakEventManager.cs
- LicFileLicenseProvider.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- Image.cs
- WS2007HttpBindingElement.cs
- SQLChars.cs
- categoryentry.cs
- PartialList.cs
- HandoffBehavior.cs
- SchemaConstraints.cs
- UrlParameterReader.cs
- Header.cs
- XmlQueryRuntime.cs
- DbConnectionStringBuilder.cs
- HatchBrush.cs
- Point3DCollection.cs
- ImageListStreamer.cs
- SystemIcmpV6Statistics.cs
- XmlSchemaInferenceException.cs
- Calendar.cs
- CompilationRelaxations.cs
- TypeProvider.cs
- Rules.cs
- StoreItemCollection.Loader.cs
- UpdateRecord.cs
- SingleSelectRootGridEntry.cs
- nulltextnavigator.cs
- XmlAttributeAttribute.cs
- SecurityIdentifierElementCollection.cs
- PathGeometry.cs
- AsyncOperationManager.cs
- MediaContext.cs
- EventWaitHandle.cs
- Util.cs
- AssemblyResourceLoader.cs
- DataGridLinkButton.cs
- WebConfigManager.cs
- TextServicesDisplayAttribute.cs
- BrowsableAttribute.cs
- objectquery_tresulttype.cs
- TemplateParser.cs
- NavigationPropertySingletonExpression.cs
- Directory.cs
- HScrollBar.cs
- __Error.cs
- SrgsElementList.cs
- DockingAttribute.cs
- SqlNotificationEventArgs.cs
- RotateTransform.cs
- SecurityManager.cs
- RoleManagerModule.cs
- NullReferenceException.cs
- CompilerErrorCollection.cs
- SmtpFailedRecipientsException.cs
- Dictionary.cs
- WorkflowExecutor.cs
- DoubleStorage.cs
- RuntimeCompatibilityAttribute.cs
- SevenBitStream.cs
- _TransmitFileOverlappedAsyncResult.cs
- ExpandSegmentCollection.cs
- DateTimeFormatInfo.cs
- DeferredTextReference.cs
- ImageField.cs
- Connector.cs
- WebPartTransformerCollection.cs
- HideDisabledControlAdapter.cs
- DependencyPropertyKey.cs
- PropertyTab.cs
- SemaphoreSecurity.cs