Skip to content

Commit

Permalink
Update to Core 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sboulema committed Aug 24, 2016
1 parent e58654b commit 2fe42af
Show file tree
Hide file tree
Showing 43 changed files with 9,341 additions and 100 deletions.
5 changes: 2 additions & 3 deletions WebVRPano.sln
@@ -1,16 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24627.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D0D10A03-B8C8-4A0A-B4EB-B5B7A481B950}"
ProjectSection(SolutionItems) = preProject
global.json = global.json
NuGet.Config = NuGet.Config
README.md = README.md
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebVRPano", "src\AndroidPano\WebVRPano.xproj", "{F19CD54D-B837-4679-B4D3-F359C702F49C}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebVRPano", "src\WebVRPano\WebVRPano.xproj", "{F19CD54D-B837-4679-B4D3-F359C702F49C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
2 changes: 1 addition & 1 deletion global.json
@@ -1,6 +1,6 @@
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-rc1-update1"
"version": "1.0.0-preview2-003121"
}
}
9 changes: 0 additions & 9 deletions src/AndroidPano/Dockerfile

This file was deleted.

3 changes: 0 additions & 3 deletions src/AndroidPano/Views/_ViewImports.cshtml

This file was deleted.

32 changes: 0 additions & 32 deletions src/AndroidPano/project.json

This file was deleted.

@@ -1,17 +1,16 @@
using Microsoft.AspNet.Mvc;
using AndroidPano.Services;
using Microsoft.AspNet.Diagnostics;
using Microsoft.AspNet.Http.Features;
using Microsoft.AspNetCore.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using WebVRPano.Services;

namespace AndroidPano.Controllers
namespace WebVRPano.Controllers
{
public class HomeController : Controller
{
private readonly IPanoService panoService;
private readonly IPanoService _panoService;

public HomeController(IPanoService panoService)
{
this.panoService = panoService;
_panoService = panoService;
}

public IActionResult Index()
Expand All @@ -22,7 +21,7 @@ public IActionResult Index()
[Route("{tinyId}")]
public IActionResult Pano(string tinyId)
{
panoService.LoadPano(tinyId);
_panoService.LoadPano(tinyId);

ViewData["Pano"] = $"androidpano/{tinyId}/tour.xml";

Expand Down
9 changes: 9 additions & 0 deletions src/WebVRPano/Dockerfile
@@ -0,0 +1,9 @@
FROM microsoft/dotnet

COPY . /dotnetapp
WORKDIR /dotnetapp

RUN dotnet restore

EXPOSE 5000/tcp
ENTRYPOINT dotnet run --server.urls http://0.0.0.0:5000
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions src/WebVRPano/Program.cs
@@ -0,0 +1,26 @@
using System.IO;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;

namespace WebVRPano
{
public class Program
{
public static void Main(string[] args)
{
var config = new ConfigurationBuilder()
.AddCommandLine(args)
.Build();

var host = new WebHostBuilder()
.UseConfiguration(config)
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.Build();

host.Run();
}
}
}
File renamed without changes.
@@ -1,7 +1,7 @@
using Microsoft.Extensions.Configuration;
using System;
using Microsoft.Extensions.Configuration;

namespace AndroidPano.Services
namespace WebVRPano.Services
{
public class ConfigurationService : IConfigurationService
{
Expand Down
@@ -1,4 +1,4 @@
namespace AndroidPano.Services
namespace WebVRPano.Services
{
public interface IConfigurationService
{
Expand Down
@@ -1,6 +1,4 @@
using System.Threading.Tasks;

namespace AndroidPano.Services
namespace WebVRPano.Services
{
public interface IPanoService
{
Expand Down
@@ -1,8 +1,8 @@
using AndroidPano.Models;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Xml.Linq;
using AndroidPano.Models;

namespace AndroidPano.Services
namespace WebVRPano.Services
{
public interface IXMLService
{
Expand Down
@@ -1,6 +1,4 @@
using AndroidPano.Models;
using Newtonsoft.Json;
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand All @@ -9,9 +7,11 @@
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using Microsoft.AspNet.Hosting;
using AndroidPano.Models;
using Microsoft.AspNetCore.Hosting;
using Newtonsoft.Json;

namespace AndroidPano.Services
namespace WebVRPano.Services
{
public class PanoService : IPanoService
{
Expand Down
@@ -1,28 +1,32 @@
using AndroidPano.Models;
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using System.Xml.Linq;
using AndroidPano.Models;

namespace AndroidPano.Services
namespace WebVRPano.Services
{
public class XMLService : IXMLService
public class XmlService : IXMLService
{
XElement tourXml;
XElement _tourXml;

public void Init()
{
tourXml = new XElement("krpano");
_tourXml = new XElement("krpano");

var include = new XElement("include");
var includeUrl = new XAttribute("url", "../../xml/krpano_vr.xml");
include.Add(includeUrl);
tourXml.Add(include);
_tourXml.Add(include);
}

public void WriteToFile(string dir)
{
tourXml.Save(Path.Combine(dir, "tour.xml"));
tourXml = null;
using (var fs = new FileStream(Path.Combine(dir, "tour.xml"), FileMode.Create))
{
_tourXml.Save(fs);
}

_tourXml = null;
}

public void AddScene(Pano pano, IEnumerable<XElement> hotspots, string imageUrl)
Expand All @@ -45,7 +49,7 @@ public void AddScene(Pano pano, IEnumerable<XElement> hotspots, string imageUrl)
scene.Add(spot);
}

tourXml.Add(scene);
_tourXml.Add(scene);
}
}
}
25 changes: 6 additions & 19 deletions src/AndroidPano/Startup.cs → src/WebVRPano/Startup.cs
@@ -1,41 +1,28 @@
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Hosting;
using AndroidPano.Services;
using Microsoft.Extensions.PlatformAbstractions;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using WebVRPano.Services;

namespace AndroidPano
namespace WebVRPano
{
public class Startup
{
public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv)
{
// Setup configuration sources.
var builder = new ConfigurationBuilder()
.SetBasePath(appEnv.ApplicationBasePath)
.AddJsonFile("appsettings.json");
Configuration = builder.Build();
}

public IConfigurationRoot Configuration { get; set; }

// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
// Add MVC services to the services container.
services.AddMvc();

// Register application services.
services.AddTransient<IConfigurationService>(r => new ConfigurationService(Configuration));
services.AddTransient<IPanoService, PanoService>();
services.AddTransient<IXMLService, XMLService>();
services.AddTransient<IXMLService, XmlService>();
}

// Configure is called after ConfigureServices is called.
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
// Configure the HTTP request pipeline.
app.UseStaticFiles();

if (env.IsDevelopment())
Expand Down
File renamed without changes.
Expand Up @@ -26,7 +26,7 @@

<script>
function loadPano() {
window.location = document.getElementById('tinyIdInput').value
window.location = document.getElementById('tinyIdInput').value;
}
function handle(e) {
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions src/WebVRPano/Views/_ViewImports.cshtml
@@ -0,0 +1,2 @@
@using AndroidPano
@using AndroidPano.Models
File renamed without changes.
6 changes: 6 additions & 0 deletions src/WebVRPano/WebVRPano.xproj.user
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ActiveDebugProfile>IIS Express</ActiveDebugProfile>
</PropertyGroup>
</Project>
46 changes: 46 additions & 0 deletions src/WebVRPano/project.json
@@ -0,0 +1,46 @@
{
"dependencies": {
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNetCore.Hosting": "1.0.0",
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0",
"Microsoft.Extensions.Configuration.CommandLine": "1.0.0",
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
"Microsoft.NETCore.App": {
"version": "1.0.0",
"type": "platform"
}
},

"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"portable-net45+win8"
]
}
},

"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},

"runtimeOptions": {
"configProperties": {
"System.GC.Server": true
}
},

"publishOptions": {
"include": [
"wwwroot",
"Views",
"Areas/**/Views",
"appsettings.json",
"web.config"
]
}
}

0 comments on commit 2fe42af

Please sign in to comment.