Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / Microsoft / Scripting / Utils / StrongBox.cs / 1305376 / StrongBox.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. * * * ***************************************************************************/ namespace System.Runtime.CompilerServices { ////// Holds a reference to a value. /// ///The type of the value that the public class StrongBoxreferences. : IStrongBox { /// /// Gets the strongly typed value associated with the [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")] public T Value; ////// This is explicitly exposed as a field instead of a property to enable loading the address of the field. ////// Initializes a new StrongBox which can receive a value when used in a reference call. /// public StrongBox() { } ////// Initializes a new /// A value that thewith the specified value. /// will reference. public StrongBox(T value) { Value = value; } object IStrongBox.Value { get { return Value; } set { Value = (T)value; } } } /// /// Defines a property for accessing the value that an object references. /// public interface IStrongBox { ////// Gets or sets the value the object references. /// object Value { get; set; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. /* **************************************************************************** * * 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. * * * ***************************************************************************/ namespace System.Runtime.CompilerServices { ////// Holds a reference to a value. /// ///The type of the value that the public class StrongBoxreferences. : IStrongBox { /// /// Gets the strongly typed value associated with the [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")] public T Value; ////// This is explicitly exposed as a field instead of a property to enable loading the address of the field. ////// Initializes a new StrongBox which can receive a value when used in a reference call. /// public StrongBox() { } ////// Initializes a new /// A value that thewith the specified value. /// will reference. public StrongBox(T value) { Value = value; } object IStrongBox.Value { get { return Value; } set { Value = (T)value; } } } /// /// Defines a property for accessing the value that an object references. /// public interface IStrongBox { ////// Gets or sets the value the object references. /// object Value { get; set; } } } // 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
- PersistenceIOParticipant.cs
- mediaclock.cs
- CompositeActivityTypeDescriptor.cs
- TextServicesContext.cs
- DisplayInformation.cs
- TransactionScope.cs
- Soap.cs
- LinqDataSourceContextEventArgs.cs
- FormsAuthenticationUser.cs
- TableRow.cs
- ConfigurationFileMap.cs
- TripleDESCryptoServiceProvider.cs
- sqlinternaltransaction.cs
- XDRSchema.cs
- PointHitTestParameters.cs
- OleDbCommandBuilder.cs
- BrowsableAttribute.cs
- Item.cs
- XmlQueryRuntime.cs
- SafeEventLogWriteHandle.cs
- FacetValues.cs
- NavigatorInvalidBodyAccessException.cs
- MetafileHeader.cs
- filewebresponse.cs
- XmlSerializerNamespaces.cs
- DataListItemEventArgs.cs
- RichTextBox.cs
- CryptoConfig.cs
- SyndicationPerson.cs
- PanelContainerDesigner.cs
- KeysConverter.cs
- StrokeCollectionConverter.cs
- IndicCharClassifier.cs
- RemoteTokenFactory.cs
- WinInetCache.cs
- ToolStripArrowRenderEventArgs.cs
- CapabilitiesUse.cs
- DataFormats.cs
- PenThreadWorker.cs
- Delegate.cs
- MultiDataTrigger.cs
- XmlQueryContext.cs
- ProxyManager.cs
- DataObject.cs
- AssemblyResourceLoader.cs
- ConvertBinder.cs
- HandledMouseEvent.cs
- Oid.cs
- EmptyEnumerator.cs
- SHA1CryptoServiceProvider.cs
- ObjRef.cs
- SetUserPreferenceRequest.cs
- cryptoapiTransform.cs
- NameValueConfigurationElement.cs
- Activator.cs
- XmlNodeComparer.cs
- Visitors.cs
- ClonableStack.cs
- ServiceParser.cs
- CqlLexerHelpers.cs
- CqlParser.cs
- WebPartUtil.cs
- ScriptingWebServicesSectionGroup.cs
- FamilyMap.cs
- TcpWorkerProcess.cs
- DrawingBrush.cs
- DesignerForm.cs
- NullableDecimalSumAggregationOperator.cs
- NativeMethods.cs
- SQLMembershipProvider.cs
- PartialArray.cs
- brushes.cs
- GeneralTransform.cs
- wgx_render.cs
- RawStylusActions.cs
- RadioButtonAutomationPeer.cs
- DeobfuscatingStream.cs
- NameValueSectionHandler.cs
- PartialList.cs
- ListViewGroup.cs
- StylusOverProperty.cs
- SQLConvert.cs
- GestureRecognitionResult.cs
- PropertyGrid.cs
- FloaterParaClient.cs
- MimeFormatter.cs
- LinearKeyFrames.cs
- PageSettings.cs
- TimeSpanMinutesConverter.cs
- ResourceKey.cs
- FrameworkPropertyMetadata.cs
- MessagingDescriptionAttribute.cs
- COM2PropertyDescriptor.cs
- Pipe.cs
- _Semaphore.cs
- TriggerActionCollection.cs
- RegexInterpreter.cs
- HuffCodec.cs
- BinaryObjectWriter.cs
- StorageAssociationSetMapping.cs