Refactoring controllers to use publicly accessible CursorLists

This commit is contained in:
Brandon Watson
2021-04-12 21:54:21 -04:00
parent 4acf091511
commit 46173f4f99
6 changed files with 47 additions and 49 deletions

View File

@ -22,7 +22,7 @@ namespace Aurora.Design.Views.Party
private ILibraryService _libraryService;
private Grpc.Core.Server _server;
private RemotePartyService.RemotePartyServiceClient _remotePartyClient;
private RemotePartyController _remotePartyController;
private Channel _channel;
private int _port = 8080;
private bool _isServerStarted = false;
@ -48,7 +48,9 @@ namespace Aurora.Design.Views.Party
this._hostname = IpUtil.GetLocalIPAddress();
this.StartServer("test", "test description");
this.StartClient();
// TODO assign members
// TODO assign songList
// Register commands
PlayCommand = new Command(OnDoubleClickCommandExecute, CanDoubleClickCommandExecute);
@ -84,7 +86,6 @@ namespace Aurora.Design.Views.Party
this._hostname = IpUtil.GetLocalIPAddress();
this.StartServer("test", "test description");
this.StartClient();
}
return Task.FromResult<object>(null);
}
@ -198,7 +199,7 @@ namespace Aurora.Design.Views.Party
};
//Construct implementations
RemotePartyController remotePartyController = new RemotePartyController(
this._remotePartyController = new RemotePartyController(
partyName,
description,
this._libraryService,
@ -206,7 +207,7 @@ namespace Aurora.Design.Views.Party
_eventManager);
// Register grpc RemoteService with singleton server service
RemotePartyService.BindService(remotePartyController);
RemotePartyService.BindService(this._remotePartyController);
_server.Start();
@ -218,15 +219,6 @@ namespace Aurora.Design.Views.Party
Console.WriteLine(string.Format("Error starting gRPC server: {0}", ex.Message));
}
}
private void StartClient()
{
_channel = new Channel(string.Format("{0}:{1}", this._hostname, this._port), ChannelCredentials.Insecure);
_remotePartyClient = new RemotePartyService.RemotePartyServiceClient(_channel);
}
#endregion Private Methods
}