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);
        }
 protected override void ProcessRecord()
 {
     if (ShouldProcess(Application, VerbsLifecycle.Stop))
     {
         C8Core core = new C8Core(ServerUrl);
         core.StopApplication(Workspace, Application);
         WriteProgress(new ProgressRecord(0, "Stopping", Application));
     }
 }
 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));
 }
 protected override void ProcessRecord()
 {
     C8Core core = new C8Core(ServerUrl);
     core.RemoveApplication(Workspace, Application);
 }
        protected override void BeginProcessing()
        {
            C8Core core = new C8Core(ServerUrl);
            if (Workspace != "")
            {
                var wsstatus = core.GetWorkspaceStatus(Workspace, false);

                var apps = from ap in wsstatus.CclApplicationInfo
                           from itm in ap.Value
                           select new { Application = ap.Name, itm.Name,itm.Value};
                WriteObject(apps, true);
            }
            else
            {
                var mgstatus = core.GetManagerStatus();
                foreach (var item in mgstatus.ManagerInfo.Object.Value)
                {
                    WriteObject(item);
                }
            }
        }
        protected override void ProcessRecord()
        {
            C8Core core = new C8Core(ServerUrl);
            if (string.IsNullOrEmpty(Application))
            {
                foreach (var item in core.GetApplications(Workspace))
                {
                    var apps = from stat in core.GetApplicationStatus(Workspace, item, false).CclApplicationInfo[0].Value
                               where stat.Name == "State"
                               select new { Application = item, State = stat.Value };
                    WriteObject(apps, true);
                }
                return;
            }

            if (!core.IsLoadedApplication(Workspace,Application))
            {
                WriteWarning("Application " + Application + " does not exist");
                return;
            }
            var res = core.GetApplicationStatus(Workspace, Application, false);

            WriteObject((from stat in res.CclApplicationInfo[0].Value
                         select new { stat.Name, stat.Value }), true);

            WriteObject((from stat in res.CclCompilerInfo[0].Value
                         select new { stat.Name, stat.Value }), true);
        }
 private void Init()
 {
     C8core = new C8Core(this.Root);
     ManagerUri = C8core.ManagerUri;
 }