Exemple #1
0
        internal static unsafe ServiceHealthStateChunk FromNative(NativeTypes.FABRIC_SERVICE_HEALTH_STATE_CHUNK nativeServiceHealthStateChunk)
        {
            var managedServiceHealthStateChunk = new ServiceHealthStateChunk();

            managedServiceHealthStateChunk.ServiceName = NativeTypes.FromNativeUri(nativeServiceHealthStateChunk.ServiceName);
            managedServiceHealthStateChunk.HealthState = (HealthState)nativeServiceHealthStateChunk.HealthState;
            managedServiceHealthStateChunk.PartitionHealthStateChunks = PartitionHealthStateChunkList.CreateFromNativeList(nativeServiceHealthStateChunk.PartitionHealthStateChunks);

            return(managedServiceHealthStateChunk);
        }
Exemple #2
0
        internal static unsafe PartitionHealthStateChunkList CreateFromNativeList(IntPtr nativeListPtr)
        {
            var retval = new PartitionHealthStateChunkList();

            if (nativeListPtr != IntPtr.Zero)
            {
                var nativeList = (NativeTypes.FABRIC_PARTITION_HEALTH_STATE_CHUNK_LIST *)nativeListPtr;

                var nativeItemArray = (NativeTypes.FABRIC_PARTITION_HEALTH_STATE_CHUNK *)nativeList->Items;
                for (int i = 0; i < nativeList->Count; ++i)
                {
                    var nativeItem = *(nativeItemArray + i);
                    retval.Add(PartitionHealthStateChunk.FromNative(nativeItem));
                }

                retval.TotalCount = (long)nativeList->TotalCount;
            }

            return(retval);
        }