Skip to content

Commit

Permalink
ASP website
Browse files Browse the repository at this point in the history
  • Loading branch information
Samir L. Boulema committed Nov 13, 2015
1 parent bbc1698 commit 0e2f9e3
Show file tree
Hide file tree
Showing 43 changed files with 746 additions and 44 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/src/AndroidPano/AndroidPano.xproj.csdat
/src/AndroidPano/project.lock.json
/.vs
/artifacts
/src/AndroidPano/*.user
/src/AndroidPano/wwwroot/androidpano/48969534/tour.xml
33 changes: 33 additions & 0 deletions AndroidPano.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24627.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{20AA32C2-DE17-44B3-A9A8-180AAF5F7B90}"
EndProject
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
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "AndroidPano", "src\AndroidPano\AndroidPano.xproj", "{F19CD54D-B837-4679-B4D3-F359C702F49C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F19CD54D-B837-4679-B4D3-F359C702F49C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F19CD54D-B837-4679-B4D3-F359C702F49C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F19CD54D-B837-4679-B4D3-F359C702F49C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F19CD54D-B837-4679-B4D3-F359C702F49C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F19CD54D-B837-4679-B4D3-F359C702F49C} = {20AA32C2-DE17-44B3-A9A8-180AAF5F7B90}
EndGlobalSection
EndGlobal
8 changes: 8 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"projects": [ "src", "test" ],
"sdk": {
"version": "1.0.0-beta8"
}
}
Binary file removed img/texts.png
Binary file not shown.
38 changes: 0 additions & 38 deletions index.html

This file was deleted.

Binary file removed panos/woonkamer/tablet_b.jpg
Binary file not shown.
Binary file removed panos/woonkamer/tablet_d.jpg
Binary file not shown.
Binary file removed panos/woonkamer/tablet_f.jpg
Binary file not shown.
Binary file removed panos/woonkamer/tablet_l.jpg
Binary file not shown.
Binary file removed panos/woonkamer/tablet_r.jpg
Binary file not shown.
Binary file removed panos/woonkamer/tablet_u.jpg
Binary file not shown.
22 changes: 22 additions & 0 deletions src/AndroidPano/AndroidPano.xproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>f19cd54d-b837-4679-b4d3-f359c702f49c</ProjectGuid>
<RootNamespace>AndroidPano</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">..\..\artifacts\obj\$(MSBuildProjectName)</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
<DevelopmentServerPort>15012</DevelopmentServerPort>
</PropertyGroup>
<ItemGroup>
<DnxInvisibleContent Include="AndroidPano.xproj.csdat" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DNX\Microsoft.DNX.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
30 changes: 30 additions & 0 deletions src/AndroidPano/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Microsoft.AspNet.Mvc;
using AndroidPano.Services;

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

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

public IActionResult Index()
{
return View();
}

[Route("{tinyId}")]
public IActionResult Pano(string tinyId)
{
panoService.LoadPano(tinyId);

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

return View();
}
}
}
8 changes: 8 additions & 0 deletions src/AndroidPano/Models/MediaItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace AndroidPano.Models
{
public class MediaItem
{
public int Category;
public string Url;
}
}
84 changes: 84 additions & 0 deletions src/AndroidPano/Models/PanoModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
using System.Collections.Generic;
using System.Linq;

namespace AndroidPano.Models
{
public class PanoModel
{
private List<RootObject> Items { get; set; }

public List<Pano> Panos { get; set; }
public string GlobalId { get; set; }
public string SoortAanbod { get; set; }

public PanoModel(List<RootObject> items, string globalId, string soortAanbod)
{
Items = items;
GlobalId = globalId;
SoortAanbod = soortAanbod;

Panos = new List<Pano>();
foreach (var item in items)
{
var pano = new Pano();

pano.Omschrijving = item.Omschrijving;
if (Panos.Any(p => p.Omschrijving.Equals(item.Omschrijving)))
{
pano.Omschrijving += item.IndexNumber;
}

pano.Id = item.Id;
pano.Url = item.MediaItems.Where(mi => mi.Category == 23).Select(mi => mi.Url).FirstOrDefault();
Panos.Add(pano);
}
}

public PanoModel(List<RootObject> items)
{
Items = items;

Panos = new List<Pano>();
foreach (var item in items)
{
var pano = new Pano();

pano.Omschrijving = item.Omschrijving;
pano.Url = "http://www.funda.nl";
Panos.Add(pano);
}
}

public int GetIndex(Pano pano)
{
for (int i = 0; i < Panos.Count; i++)
{
if (Panos[i] == pano) return i;
}
return -1;
}

public string GetWebsite()
{
switch (SoortAanbod.ToLower())
{
case "kantoor":
case "bedrijfshal":
case "winkel":
case "horeca":
case "bouwgrond":
case "overig":
return "fundainbusiness";
default:
return "funda";
}
}
}

public class Pano
{
public string Omschrijving { get; set; }
public string Url { get; set; }
public string Id { get; set; }
}
}
12 changes: 12 additions & 0 deletions src/AndroidPano/Models/RootObject.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Collections.Generic;

namespace AndroidPano.Models
{
public class RootObject
{
public string Id;
public int IndexNumber;
public List<MediaItem> MediaItems;
public string Omschrijving;
}
}
12 changes: 12 additions & 0 deletions src/AndroidPano/Models/Sides.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace AndroidPano.Models
{
public enum Sides
{
l = 0,
f = 1,
r = 2,
b = 3,
u = 4,
d = 5
}
}
23 changes: 23 additions & 0 deletions src/AndroidPano/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("AndroidPano")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AndroidPano")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f19cd54d-b837-4679-b4d3-f359c702f49c")]
25 changes: 25 additions & 0 deletions src/AndroidPano/Services/ConfigurationService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Microsoft.Framework.Configuration;
using System;

namespace AndroidPano.Services
{
public class ConfigurationService : IConfigurationService
{
private readonly IConfiguration configuration;

public ConfigurationService(IConfiguration configuration)
{
this.configuration = configuration;
}

public string Get(string key)
{
string envValue = Environment.GetEnvironmentVariable(key);
if (!string.IsNullOrEmpty(envValue))
{
return envValue;
}
return configuration[key];
}
}
}
7 changes: 7 additions & 0 deletions src/AndroidPano/Services/IConfigurationService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace AndroidPano.Services
{
public interface IConfigurationService
{
string Get(string key);
}
}
9 changes: 9 additions & 0 deletions src/AndroidPano/Services/IPanoService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System.Threading.Tasks;

namespace AndroidPano.Services
{
public interface IPanoService
{
void LoadPano(string tinyId);
}
}
13 changes: 13 additions & 0 deletions src/AndroidPano/Services/IXMLservice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using AndroidPano.Models;
using System.Collections.Generic;
using System.Xml.Linq;

namespace AndroidPano.Services
{
public interface IXMLService
{
void Init();
void WriteToFile(string dir);
void AddScene(Pano pano, IEnumerable<XElement> hotspots, string imageUrl);
}
}
Loading

0 comments on commit 0e2f9e3

Please sign in to comment.