Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / 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
- ClassHandlersStore.cs
- ProfileSection.cs
- HttpCachePolicy.cs
- Label.cs
- XMLSyntaxException.cs
- CustomError.cs
- Clock.cs
- UserUseLicenseDictionaryLoader.cs
- AttachedPropertyMethodSelector.cs
- PatternMatcher.cs
- ControlPersister.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ListenerPerfCounters.cs
- TdsParserSafeHandles.cs
- WindowsFormsSectionHandler.cs
- HttpMethodConstraint.cs
- FormsAuthenticationEventArgs.cs
- EditCommandColumn.cs
- ReadOnlyPermissionSet.cs
- SchemaMerger.cs
- SQLResource.cs
- SBCSCodePageEncoding.cs
- HtmlElementEventArgs.cs
- BufferBuilder.cs
- InternalConfigEventArgs.cs
- WorkerProcess.cs
- FixedLineResult.cs
- BooleanAnimationUsingKeyFrames.cs
- RSAPKCS1SignatureFormatter.cs
- XmlDigitalSignatureProcessor.cs
- UpdateExpressionVisitor.cs
- PageBreakRecord.cs
- XmlReaderSettings.cs
- StandardCommands.cs
- XmlWriterDelegator.cs
- SecurityPermission.cs
- SerializationHelper.cs
- Typography.cs
- EventRoute.cs
- DataReceivedEventArgs.cs
- ModulesEntry.cs
- TraceContextRecord.cs
- ViewStateModeByIdAttribute.cs
- _BasicClient.cs
- FlowLayoutPanel.cs
- PropertyConverter.cs
- KeySpline.cs
- RightsManagementInformation.cs
- RegexParser.cs
- SystemIPv6InterfaceProperties.cs
- SerializationInfo.cs
- XmlNodeChangedEventManager.cs
- ResolveDuplex11AsyncResult.cs
- OneOfElement.cs
- VoiceSynthesis.cs
- OdbcEnvironmentHandle.cs
- AttributeQuery.cs
- NameTable.cs
- SemanticTag.cs
- EditBehavior.cs
- ExtensionQuery.cs
- WebSysDescriptionAttribute.cs
- SqlUDTStorage.cs
- HorizontalAlignConverter.cs
- ComponentResourceKeyConverter.cs
- Helpers.cs
- SafeNativeMemoryHandle.cs
- SecurityPolicySection.cs
- SwitchExpression.cs
- MetadataUtilsSmi.cs
- sqlstateclientmanager.cs
- DataRowChangeEvent.cs
- FixedBufferAttribute.cs
- GenericTextProperties.cs
- ModelPerspective.cs
- SpecularMaterial.cs
- DataGridViewHeaderCell.cs
- CharacterBufferReference.cs
- XmlDataSource.cs
- LocationEnvironment.cs
- XPathExpr.cs
- SponsorHelper.cs
- DetailsViewDesigner.cs
- XmlSchemaNotation.cs
- HostingEnvironmentSection.cs
- OledbConnectionStringbuilder.cs
- ListSourceHelper.cs
- DrawListViewSubItemEventArgs.cs
- WindowsListViewSubItem.cs
- SafeViewOfFileHandle.cs
- VisualTreeHelper.cs
- AcceptorSessionSymmetricTransportSecurityProtocol.cs
- NavigationExpr.cs
- GlyphCache.cs
- VirtualPathUtility.cs
- PipelineModuleStepContainer.cs
- UpdateTranslator.cs
- PropertyGridEditorPart.cs
- HtmlDocument.cs
- GrammarBuilderWildcard.cs