Пример #1
0
        private Dictionary <string, string> GetDistroProperties(WslQueryDistroModel model)
        {
            var properties = new Dictionary <string, string>();

            if (model == null)
            {
                return(properties);
            }

            var distroName = model.DistroName;

            properties.Add(
                nameof(DistroProperties.DistroName),
                distroName);

            properties.Add(
                nameof(DistroProperties.DistroStatus),
                model.DistroStatus);

            properties.Add(
                nameof(DistroProperties.BasePath),
                NormalizePath(model.BasePath));

            properties.Add(
                nameof(DistroProperties.Version),
                model.WslVersion.ToString());

            return(properties);
        }
Пример #2
0
 public DistroProperties(int order, WslQueryDistroModel model)
 {
     Order         = order;
     WslDistroInfo = model ?? throw new ArgumentNullException(nameof(model));
     Properties    = GetDistroProperties(model);
     ImageKey      = SharedRoutines.GetImageKey(model?.DistroName);
 }