internal static unsafe IList <NodeHealthState> FromNativeList(IntPtr nativeListPtr) { if (nativeListPtr != IntPtr.Zero) { var nativeList = (NativeTypes.FABRIC_NODE_HEALTH_STATE_LIST *)nativeListPtr; return(NodeHealthStateList.FromNativeList(nativeList)); } else { return(new NodeHealthStateList()); } }
internal static unsafe NodeHealthStateList FromNativeList( NativeTypes.FABRIC_NODE_HEALTH_STATE_LIST *nativeList) { var retval = new NodeHealthStateList(); var nativeItemArray = (NativeTypes.FABRIC_NODE_HEALTH_STATE *)nativeList->Items; for (int i = 0; i < nativeList->Count; ++i) { var nativeItem = *(nativeItemArray + i); var item = NodeHealthState.FromNative(nativeItem); if (item != null) { retval.Add(item); } } return(retval); }