private static unsafe DeployedServicePackageHealth FromNative(NativeTypes.FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH *nativeHealth) { var managedHealth = new DeployedServicePackageHealth(); managedHealth.AggregatedHealthState = (HealthState)nativeHealth->AggregatedHealthState; managedHealth.HealthEvents = HealthEvent.FromNativeList(nativeHealth->HealthEvents); managedHealth.ApplicationName = NativeTypes.FromNativeUri(nativeHealth->ApplicationName); managedHealth.ServiceManifestName = NativeTypes.FromNativeString(nativeHealth->ServiceManifestName); managedHealth.NodeName = NativeTypes.FromNativeString(nativeHealth->NodeName); if (nativeHealth->Reserved == IntPtr.Zero) { return(managedHealth); } var nativeHealthEx1 = (NativeTypes.FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_EX1 *)nativeHealth->Reserved; managedHealth.UnhealthyEvaluations = HealthEvaluation.FromNativeList(nativeHealthEx1->UnhealthyEvaluations); if (nativeHealthEx1->Reserved == IntPtr.Zero) { return(managedHealth); } var nativeHealthEx2 = (NativeTypes.FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_EX2 *)nativeHealthEx1->Reserved; managedHealth.ServicePackageActivationId = NativeTypes.FromNativeString(nativeHealthEx2->ServicePackageActivationId); return(managedHealth); }
internal DeployedServicePackageHealth( System.Fabric.Health.DeployedServicePackageHealth health) : base(health) { this.ApplicationName = health.ApplicationName.OriginalString; this.ServiceManifestName = health.ServiceManifestName; this.NodeName = health.NodeName; }