Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }