Пример #1
0
        public void Delete()
        {
            var fullFileName = $"./services/{this.Id}.json";

            ServiceProgramVersion.Delete(this.Id);

            if (System.IO.File.Exists(fullFileName))
            {
                System.IO.File.Delete(fullFileName);
            }
        }
Пример #2
0
        public ServiceProgramVersion FindUpdate()
        {
            foreach (var version in ServiceProgramVersion.FindLocalVersions(this.ServiceId))
            {
                if (version.IsNewer(this.CurrentVersion, this.AutoUpdate))
                {
                    return(ServiceProgramVersion.LoadFromDisk(this.ServiceId, version.Version));
                }
            }

            return(null);
        }
Пример #3
0
        public static ServicesInformation ServiceInformation()
        {
            List <ServiceInformation> servicesinfo = new List <ServiceInformation>();
            var services = Monosoft.ServiceStore.DTO.Service.FindServices();

            foreach (var service in services)
            {
                var versions = ServiceProgramVersion.FindLocalVersions(service.Id);

                ServiceInformation si = new ServiceInformation();
                si.Service  = service;
                si.Versions = versions.ToArray();
                servicesinfo.Add(si);
            }

            ServicesInformation res = new ServicesInformation();

            res.Services = servicesinfo.ToArray();
            return(res);
        }