public bool TryCreateFromDetails(IReadOnlyDictionary <string, string> details, out IInstallUnitDescriptor descriptor)
        {
            if (!details.TryGetValue(nameof(NupkgInstallUnitDescriptor.MountPointId), out string mountPointValue) ||
                string.IsNullOrEmpty(mountPointValue) ||
                !Guid.TryParse(mountPointValue, out Guid mountPointId))
            {
                descriptor = null;
                return(false);
            }

            if (!details.TryGetValue(nameof(NupkgInstallUnitDescriptor.PackageName), out string packageName) ||
                string.IsNullOrEmpty(packageName))
            {
                descriptor = null;
                return(false);
            }

            if (!details.TryGetValue(nameof(NupkgInstallUnitDescriptor.Version), out string version) ||
                string.IsNullOrEmpty(version))
            {
                descriptor = null;
                return(false);
            }

            descriptor = new NupkgInstallUnitDescriptor(mountPointId, packageName, version);
            return(true);
        }
        public bool TryCreateFromDetails(Guid descriptorId, string identifier, Guid mountPointId, IReadOnlyDictionary <string, string> details, out IInstallUnitDescriptor descriptor)
        {
            if (string.IsNullOrEmpty(identifier) || mountPointId == Guid.Empty)
            {
                descriptor = null;
                return(false);
            }

            if (!details.TryGetValue(nameof(NupkgInstallUnitDescriptor.Version), out string version) ||
                string.IsNullOrEmpty(version))
            {
                descriptor = null;
                return(false);
            }

            if (!details.TryGetValue(nameof(NupkgInstallUnitDescriptor.Author), out string author) ||
                string.IsNullOrEmpty(author))
            {
                descriptor = null;
                return(false);
            }

            descriptor = new NupkgInstallUnitDescriptor(descriptorId, mountPointId, identifier, version, author);
            return(true);
        }
        public bool TryCreateFromMountPoint(IMountPoint mountPoint, out IReadOnlyList <IInstallUnitDescriptor> descriptorList)
        {
            List <IInstallUnitDescriptor> allDescriptors = new List <IInstallUnitDescriptor>();

            descriptorList = allDescriptors;

            if (mountPoint.Info.Place != null && File.Exists(mountPoint.Info.Place) && TryGetPackageInfoFromNuspec(mountPoint, out string packageName, out string version))
            {
                IInstallUnitDescriptor descriptor = new NupkgInstallUnitDescriptor(mountPoint.Info.MountPointId, packageName, version);
                allDescriptors.Add(descriptor);
                return(true);
            }

            return(false);
        }
        public bool TryCreateFromMountPoint(IMountPoint mountPoint, out IReadOnlyList <IInstallUnitDescriptor> descriptorList)
        {
            List <IInstallUnitDescriptor> allDescriptors = new List <IInstallUnitDescriptor>();

            descriptorList = allDescriptors;

            if (mountPoint.Info.Place != null &&
                mountPoint.EnvironmentSettings.Host.FileSystem.FileExists(mountPoint.Info.Place) &&
                TryGetPackageInfoFromNuspec(mountPoint, out string packageName, out string version, out string author))
            {
                Guid descriptorId = Guid.NewGuid();
                IInstallUnitDescriptor descriptor = new NupkgInstallUnitDescriptor(descriptorId, mountPoint.Info.MountPointId, packageName, version, author);
                allDescriptors.Add(descriptor);
                return(true);
            }

            return(false);
        }