Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / clr / src / BCL / System / Runtime / InteropServices / ArrayWithOffset.cs / 1 / ArrayWithOffset.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== namespace System.Runtime.InteropServices { using System; using System.Runtime.CompilerServices; [Serializable] [System.Runtime.InteropServices.ComVisible(true)] public struct ArrayWithOffset { //private ArrayWithOffset() //{ // throw new Exception(); //} public ArrayWithOffset(Object array, int offset) { m_array = array; m_offset = offset; m_count = 0; m_count = CalculateCount(); } public Object GetArray() { return m_array; } public int GetOffset() { return m_offset; } public override int GetHashCode() { return m_count + m_offset; } public override bool Equals(Object obj) { if (obj is ArrayWithOffset) return Equals((ArrayWithOffset)obj); else return false; } public bool Equals(ArrayWithOffset obj) { return obj.m_array == m_array && obj.m_offset == m_offset && obj.m_count == m_count; } public static bool operator ==(ArrayWithOffset a, ArrayWithOffset b) { return a.Equals(b); } public static bool operator !=(ArrayWithOffset a, ArrayWithOffset b) { return !(a == b); } [MethodImplAttribute(MethodImplOptions.InternalCall)] private extern int CalculateCount(); private Object m_array; private int m_offset; private int m_count; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== namespace System.Runtime.InteropServices { using System; using System.Runtime.CompilerServices; [Serializable] [System.Runtime.InteropServices.ComVisible(true)] public struct ArrayWithOffset { //private ArrayWithOffset() //{ // throw new Exception(); //} public ArrayWithOffset(Object array, int offset) { m_array = array; m_offset = offset; m_count = 0; m_count = CalculateCount(); } public Object GetArray() { return m_array; } public int GetOffset() { return m_offset; } public override int GetHashCode() { return m_count + m_offset; } public override bool Equals(Object obj) { if (obj is ArrayWithOffset) return Equals((ArrayWithOffset)obj); else return false; } public bool Equals(ArrayWithOffset obj) { return obj.m_array == m_array && obj.m_offset == m_offset && obj.m_count == m_count; } public static bool operator ==(ArrayWithOffset a, ArrayWithOffset b) { return a.Equals(b); } public static bool operator !=(ArrayWithOffset a, ArrayWithOffset b) { return !(a == b); } [MethodImplAttribute(MethodImplOptions.InternalCall)] private extern int CalculateCount(); private Object m_array; private int m_offset; private int m_count; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PermissionListSet.cs
- MergeLocalizationDirectives.cs
- WinEventWrap.cs
- ProxyManager.cs
- TokenFactoryFactory.cs
- XmlSchemaSet.cs
- MonitorWrapper.cs
- XmlWrappingReader.cs
- ListBoxAutomationPeer.cs
- IISMapPath.cs
- UnionQueryOperator.cs
- StrokeNodeData.cs
- SafeNativeMethods.cs
- TypeName.cs
- QueryStringParameter.cs
- SHA384Managed.cs
- RegexMatchCollection.cs
- ToolStripItemImageRenderEventArgs.cs
- PartBasedPackageProperties.cs
- TaskScheduler.cs
- ListViewDeletedEventArgs.cs
- NameValueFileSectionHandler.cs
- CodeRemoveEventStatement.cs
- ChildrenQuery.cs
- DataSourceView.cs
- ConfigXmlReader.cs
- NotImplementedException.cs
- EditableRegion.cs
- TextSelectionHighlightLayer.cs
- ScrollChrome.cs
- TypeSemantics.cs
- SecurityChannelFaultConverter.cs
- EdgeModeValidation.cs
- HttpRequestTraceRecord.cs
- ConstraintConverter.cs
- _Events.cs
- File.cs
- IdentityModelDictionary.cs
- DataGridViewButtonCell.cs
- OdbcConnectionString.cs
- WebBaseEventKeyComparer.cs
- BCLDebug.cs
- FileDialogPermission.cs
- ApplicationSecurityInfo.cs
- Duration.cs
- QuaternionAnimation.cs
- CodeDomDesignerLoader.cs
- ColumnResult.cs
- ErrorInfoXmlDocument.cs
- GeneratedView.cs
- EntityConnectionStringBuilderItem.cs
- InvokeMethodActivityDesigner.cs
- XhtmlBasicLabelAdapter.cs
- CornerRadius.cs
- GridViewColumnHeader.cs
- Inflater.cs
- BaseCodePageEncoding.cs
- SponsorHelper.cs
- PeerResolver.cs
- CultureData.cs
- PropertyPathConverter.cs
- EditorBrowsableAttribute.cs
- DbConnectionInternal.cs
- IdentifierService.cs
- HwndTarget.cs
- TypeNameParser.cs
- PrimaryKeyTypeConverter.cs
- DelegateArgumentValue.cs
- X509Utils.cs
- CngKey.cs
- Floater.cs
- SmtpNegotiateAuthenticationModule.cs
- TemplateControlParser.cs
- MissingManifestResourceException.cs
- InputLanguage.cs
- WorkflowApplicationUnhandledExceptionEventArgs.cs
- EventDriven.cs
- ExpandCollapsePattern.cs
- NewItemsContextMenuStrip.cs
- ClientScriptManagerWrapper.cs
- Int32AnimationUsingKeyFrames.cs
- SqlGenericUtil.cs
- TimeSpanValidator.cs
- TaiwanLunisolarCalendar.cs
- _LocalDataStore.cs
- DataTableReader.cs
- BmpBitmapEncoder.cs
- GroupItem.cs
- MultiBindingExpression.cs
- SoapProtocolReflector.cs
- VariableDesigner.xaml.cs
- TraceUtility.cs
- XsdValidatingReader.cs
- BindingValueChangedEventArgs.cs
- ListViewTableCell.cs
- EncodedStreamFactory.cs
- InteropAutomationProvider.cs
- SecurityState.cs
- EnumValidator.cs
- TypeReference.cs