Exemple #1
0
 internal static unsafe IList <ApplicationHealthState> FromNativeList(IntPtr nativeListPtr)
 {
     if (nativeListPtr != IntPtr.Zero)
     {
         var nativeList = (NativeTypes.FABRIC_APPLICATION_HEALTH_STATE_LIST *)nativeListPtr;
         return(ApplicationHealthStateList.FromNativeList(nativeList));
     }
     else
     {
         return(new ApplicationHealthStateList());
     }
 }
Exemple #2
0
        internal static unsafe ApplicationHealthStateList FromNativeList(
            NativeTypes.FABRIC_APPLICATION_HEALTH_STATE_LIST *nativeList)
        {
            var retval = new ApplicationHealthStateList();

            var nativeItemArray = (NativeTypes.FABRIC_APPLICATION_HEALTH_STATE *)nativeList->Items;

            for (int i = 0; i < nativeList->Count; ++i)
            {
                var nativeItem = *(nativeItemArray + i);
                var item       = ApplicationHealthState.FromNative(nativeItem);
                if (item != null)
                {
                    retval.Add(item);
                }
            }

            return(retval);
        }