Example #1
0
        protected override void ProcessRecord()
        {
            if (!File.Exists(CcxFile))
            {
                WriteWarning("Specified CCX file does not exist");
                return;
            }

            C8Core core = new C8Core(ServerUrl);
            core.AddApplication(Workspace, CcxFile,"",false);
        }
Example #2
0
 protected override void ProcessRecord()
 {
     C8Core core = new C8Core(ServerUrl);
     if (!core.IsLoadedApplication(Workspace, Application))
     {
         WriteWarning("Application " + Application + " does not exist");
         return;
     }
     var status = core.GetApplicationStatus(Workspace, Application, false);
     var state = (from item in status.CclApplicationInfo[0].Value where item.Name == "State" select item.Value).Single();
     if (state == "Started")
     {
         WriteWarning("Application " + Application + " is running");
         return;
     }
     string CcxFile = (from item in status.CclCompilerInfo[0].Value where item.Name == "CcxFile" select item.Value).Single();
     string RepositoryPath = "";
     if (!Path.IsPathRooted(CcxFile))
     {
         RepositoryPath = (from item in status.CclCompilerInfo[0].Value where item.Name == "RepositoryPath" select item.Value).Single();
         CcxFile = Path.Combine(RepositoryPath, CcxFile);
     }
     core.AddApplication(Workspace,CcxFile, Application,true);
     WriteProgress(new ProgressRecord(0, "Started", Application));
 }