Exemplo n.º 1
0
        private BuildSession ReadFile(string file)
        {
            var buildSession = File.Exists(file) ? JsonConvert.DeserializeObject <BuildSession>(File.ReadAllText(file)) : null;

            if (buildSession == null)
            {
                buildSession = new BuildSession
                {
                    StartTime   = DateTime.Now,
                    MachineName = Environment.MachineName,
                    UserName    = Environment.UserName
                };
            }
            return(buildSession);
        }