internal static unsafe ClusterHealthChunk FromNative(NativeTypes.FABRIC_CLUSTER_HEALTH_CHUNK nativeClusterHealthChunk) { var managedClusterHealthChunk = new ClusterHealthChunk(); managedClusterHealthChunk.HealthState = (HealthState)nativeClusterHealthChunk.HealthState; managedClusterHealthChunk.NodeHealthStateChunks = NodeHealthStateChunkList.CreateFromNativeList(nativeClusterHealthChunk.NodeHealthStateChunks); managedClusterHealthChunk.ApplicationHealthStateChunks = ApplicationHealthStateChunkList.CreateFromNativeList(nativeClusterHealthChunk.ApplicationHealthStateChunks); return(managedClusterHealthChunk); }
internal static unsafe ApplicationHealthStateChunkList CreateFromNativeList(IntPtr nativeListPtr) { var retval = new ApplicationHealthStateChunkList(); if (nativeListPtr != null) { var nativeList = (NativeTypes.FABRIC_APPLICATION_HEALTH_STATE_CHUNK_LIST *)nativeListPtr; var nativeItemArray = (NativeTypes.FABRIC_APPLICATION_HEALTH_STATE_CHUNK *)nativeList->Items; for (int i = 0; i < nativeList->Count; ++i) { var nativeItem = *(nativeItemArray + i); retval.Add(ApplicationHealthStateChunk.FromNative(nativeItem)); } retval.TotalCount = (long)nativeList->TotalCount; } return(retval); }