예제 #1
0
 public async Task Install()
 {
     if (this.State != ApplicationStates.Installable)
     {
         throw new InvalidOperationException("Invalid Application State");
     }
     await DialRestService.InstallApplication(this.InstallUrl);
 }
예제 #2
0
        public async Task Stop()
        {
            if (this.State != ApplicationStates.Running)
            {
                throw new InvalidOperationException("Invalid Application State");
            }
            await DialRestService.StopApplication(this.InstanceUrl);

            this.State = ApplicationStates.Stopped;
            this.RunningResourceName = null;
        }
예제 #3
0
        public async Task Run(string parameters = null)
        {
            if (this.State != ApplicationStates.Stopped)
            {
                throw new InvalidOperationException("Invalid Application State");
            }
            var instanceUrl = await DialRestService.RunApplication(new Uri(this.DeviceInfo.ApplicationUrlBase + this.Code), parameters);

            this.State = ApplicationStates.Running;
            this.RunningResourceName = instanceUrl.AbsolutePath.Split('/').Last();
        }
예제 #4
0
 public async Task <IApplicationInfo> GetApplicationInfo <T>(string applicationCode) where T : ApplicationInfo
 {
     return(await DialRestService.GetApplicationInfo <T>(this, applicationCode));
 }