Removed quit end-point. Not used.

This commit is contained in:
Lukasz 2015-12-18 10:00:49 +01:00
Родитель ac376c1928
Коммит ec42faea4f
4 изменённых файлов: 4 добавлений и 32 удалений

Просмотреть файл

@ -55,7 +55,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="OpenFileRequest.cs" />
<Compile Include="UnityProjectState.cs" />
<Compile Include="QuitApplicationRequest.cs" />
<Compile Include="UnityRestServiceSettings.cs" />
<Compile Include="UnityProjectSettings.cs" />
<Compile Include="UnityAssetDatabase.cs" />

Просмотреть файл

@ -1,11 +0,0 @@
using ServiceStack.ServiceHost;
namespace MonoDevelop.UnityMode.RestServiceModel
{
[Route("/quit")]
public class QuitApplicationRequest
{
public string UnityProject { get; set; }
}
}

Просмотреть файл

@ -13,14 +13,13 @@ namespace MonoDevelop.UnityMode
public string Url { get; set; }
public delegate void OpenFileCallback(OpenFileRequest openFileRequest);
public delegate void QuitApplicationCallBack(QuitApplicationRequest quitRequest);
public RestService (OpenFileCallback openFileCallback, QuitApplicationCallBack quitCallback)
public RestService (OpenFileCallback openFileCallback)
{
int port = 40000 + (Process.GetCurrentProcess().Id % 1000);
Url = "http://localhost:" + port + "/";
var appHost = new AppHost (openFileCallback, quitCallback);
var appHost = new AppHost (openFileCallback);
appHost.Init ();
try
@ -44,34 +43,20 @@ namespace MonoDevelop.UnityMode
}
}
public class QuitApplicationService : IService
{
public QuitApplicationCallBack Callback { get; set; }
public object Post(QuitApplicationRequest quitRequest)
{
Callback (quitRequest);
return new HttpResult () { StatusCode = HttpStatusCode.OK };
}
}
//Define the Web Services AppHost
public class AppHost : AppHostHttpListenerBase
{
readonly OpenFileCallback openFileCallback;
readonly QuitApplicationCallBack quitCallback;
public AppHost(OpenFileCallback openFileCallback, QuitApplicationCallBack quitCallback)
public AppHost(OpenFileCallback openFileCallback)
: base("UnityMode Rest Service", typeof(RestService).Assembly)
{
this.openFileCallback = openFileCallback;
this.quitCallback = quitCallback;
}
public override void Configure(Funq.Container container)
{
container.Register (openFileCallback);
container.Register (quitCallback);
}
}
}

Просмотреть файл

@ -24,8 +24,7 @@ namespace MonoDevelop.UnityMode
{
restService = new RestService
(
fileOpenRequest => UnityRestHelpers.OpenFile(fileOpenRequest.File, fileOpenRequest.Line, OpenDocumentOptions.BringToFront),
quitRequest => UnityRestHelpers.QuitApplication(quitRequest.UnityProject)
fileOpenRequest => UnityRestHelpers.OpenFile(fileOpenRequest.File, fileOpenRequest.Line, OpenDocumentOptions.BringToFront)
);
UnityProjectStateChanged += (sender, e) => {