Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / Cache / SRef.cs / 1305376 / SRef.cs
using System; using System.Globalization; using System.Reflection; using System.Security.Permissions; using System.Web; namespace System.Web.Caching { internal class SRef { private static Type s_type = Type.GetType("System.SizedReference", true, false); private Object _sizedRef; internal SRef(Object target) { _sizedRef = HttpRuntime.CreateNonPublicInstance(s_type, new object[] {target}); } internal long ApproximateSize { [PermissionSet(SecurityAction.Assert, Unrestricted=true)] get { object o = s_type.InvokeMember("ApproximateSize", BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty, null, // binder _sizedRef, // target null, // args CultureInfo.InvariantCulture); return (long) o; } } [PermissionSet(SecurityAction.Assert, Unrestricted=true)] internal void Dispose() { s_type.InvokeMember("Dispose", BindingFlags.Public | BindingFlags.Instance | BindingFlags.InvokeMethod, null, // binder _sizedRef, // target null, // args CultureInfo.InvariantCulture); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Globalization; using System.Reflection; using System.Security.Permissions; using System.Web; namespace System.Web.Caching { internal class SRef { private static Type s_type = Type.GetType("System.SizedReference", true, false); private Object _sizedRef; internal SRef(Object target) { _sizedRef = HttpRuntime.CreateNonPublicInstance(s_type, new object[] {target}); } internal long ApproximateSize { [PermissionSet(SecurityAction.Assert, Unrestricted=true)] get { object o = s_type.InvokeMember("ApproximateSize", BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty, null, // binder _sizedRef, // target null, // args CultureInfo.InvariantCulture); return (long) o; } } [PermissionSet(SecurityAction.Assert, Unrestricted=true)] internal void Dispose() { s_type.InvokeMember("Dispose", BindingFlags.Public | BindingFlags.Instance | BindingFlags.InvokeMethod, null, // binder _sizedRef, // target null, // args CultureInfo.InvariantCulture); } } } // 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
- SurrogateEncoder.cs
- GregorianCalendarHelper.cs
- BindToObject.cs
- CodeTypeDeclarationCollection.cs
- TrackingProfileSerializer.cs
- TypeConverterHelper.cs
- Expression.cs
- Screen.cs
- SiteMapDataSourceView.cs
- NameTable.cs
- StorageMappingItemLoader.cs
- XmlAnyElementAttribute.cs
- KeyValueSerializer.cs
- XmlNamespaceMapping.cs
- InputScopeManager.cs
- FilterableAttribute.cs
- ToggleProviderWrapper.cs
- EncryptedData.cs
- AdPostCacheSubstitution.cs
- FacetValues.cs
- TrackingWorkflowEventArgs.cs
- _IPv6Address.cs
- Timer.cs
- BindingEntityInfo.cs
- ChooseAction.cs
- TemplateLookupAction.cs
- HTMLTextWriter.cs
- ReliableSessionElement.cs
- FactoryMaker.cs
- sapiproxy.cs
- ViewLoader.cs
- ColorAnimation.cs
- StringAnimationBase.cs
- PartialTrustValidationBehavior.cs
- WebPermission.cs
- DownloadProgressEventArgs.cs
- DiscoveryReferences.cs
- SiteMapDataSource.cs
- XmlSchemaSimpleTypeUnion.cs
- RtfToken.cs
- ConstraintStruct.cs
- LicFileLicenseProvider.cs
- ColorConvertedBitmapExtension.cs
- userdatakeys.cs
- PrintEvent.cs
- FormViewCommandEventArgs.cs
- WeakReferenceList.cs
- DesignerListAdapter.cs
- WindowsSolidBrush.cs
- ViewStateModeByIdAttribute.cs
- WebPartZone.cs
- BinaryMethodMessage.cs
- SolidColorBrush.cs
- TypePresenter.xaml.cs
- XamlFilter.cs
- Emitter.cs
- ScriptReference.cs
- EncryptedReference.cs
- EditorPartDesigner.cs
- MetafileHeaderEmf.cs
- WorkflowPageSetupDialog.cs
- EntityRecordInfo.cs
- BinaryKeyIdentifierClause.cs
- RepeatInfo.cs
- ToolStripDropDownItem.cs
- XmlNamedNodeMap.cs
- BmpBitmapEncoder.cs
- SqlHelper.cs
- AudioBase.cs
- DelimitedListTraceListener.cs
- IISMapPath.cs
- XmlTextReader.cs
- ConfigurationSettings.cs
- SoapConverter.cs
- CommandValueSerializer.cs
- ReadOnlyDictionary.cs
- BinaryFormatterWriter.cs
- MtomMessageEncodingBindingElement.cs
- Attributes.cs
- HttpHandlersSection.cs
- FormatException.cs
- CompressEmulationStream.cs
- WinFormsComponentEditor.cs
- InheritanceContextHelper.cs
- GrammarBuilder.cs
- Header.cs
- BaseUriHelper.cs
- MenuCommand.cs
- MouseOverProperty.cs
- XmlLanguageConverter.cs
- ListViewItem.cs
- XmlBinaryReader.cs
- PrintDialog.cs
- CacheMode.cs
- WebPartZone.cs
- Root.cs
- Section.cs
- InternalTypeHelper.cs
- ColumnClickEvent.cs
- MachineKeyConverter.cs