Exemplo n.º 1
0
        internal static unsafe ConfigurationPackage CreateFromNative(NativeRuntime.IFabricConfigurationPackage nativePackage)
        {
            ReleaseAssert.AssertIfNull(nativePackage, "nativePackage");

            string path     = NativeTypes.FromNativeString(nativePackage.get_Path());
            var    settings = ConfigurationSettings.CreateFromNative(nativePackage.get_Settings());

            var nativeDescription = *((NativeTypes.FABRIC_CONFIGURATION_PACKAGE_DESCRIPTION *)nativePackage.get_Description());
            var description       = ConfigurationPackageDescription.CreateFromNative(nativeDescription, path, settings);

            var returnValue = new ConfigurationPackage()
            {
                Description = description,
                Path        = path,
                Settings    = settings
            };

            GC.KeepAlive(nativePackage);
            return(returnValue);
        }