Esempio n. 1
0
        internal static unsafe DeployedServicePackageHealthStateChunkList CreateFromNativeList(IntPtr nativeListPtr)
        {
            var retval = new DeployedServicePackageHealthStateChunkList();

            if (nativeListPtr != null)
            {
                var nativeList = (NativeTypes.FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_STATE_CHUNK_LIST *)nativeListPtr;

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

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

            return(retval);
        }
Esempio n. 2
0
        internal static unsafe DeployedApplicationHealthStateChunk FromNative(NativeTypes.FABRIC_DEPLOYED_APPLICATION_HEALTH_STATE_CHUNK nativeDeployedApplicationHealthStateChunk)
        {
            var managedDeployedApplicationHealthStateChunk = new DeployedApplicationHealthStateChunk();

            managedDeployedApplicationHealthStateChunk.NodeName    = NativeTypes.FromNativeString(nativeDeployedApplicationHealthStateChunk.NodeName);
            managedDeployedApplicationHealthStateChunk.HealthState = (HealthState)nativeDeployedApplicationHealthStateChunk.HealthState;
            managedDeployedApplicationHealthStateChunk.DeployedServicePackageHealthStateChunks = DeployedServicePackageHealthStateChunkList.CreateFromNativeList(nativeDeployedApplicationHealthStateChunk.DeployedServicePackageHealthStateChunks);

            return(managedDeployedApplicationHealthStateChunk);
        }