/// <summary> /// Sends a force build request to the remote server. /// </summary> public void ForceBuild() { client.ProcessSingleAction(p => { client.ForceBuild(p.Name); }, InnerProject); }
/// <summary> /// Initialise the server. /// </summary> /// <param name="client"></param> /// <param name="watcher"></param> /// <param name="fetchVersion">Whether the version number should be fetched or not.</param> private void InitialiseServer(CruiseServerClientBase client, IServerWatcher watcher, bool fetchVersion) { this.watcher = watcher; this.watcher.Update += OnWatcherUpdate; this.client = client; if (fetchVersion) { try { client.ProcessSingleAction(s => { version = new Version(client.GetServerVersion()); }, client); } catch { // This means there will be no version for the server } } }
/// <summary> /// Attempt to retrieve a snapshot from the remote server. /// </summary> private void RetrieveSnapshot() { // Retrieve the snapshot ServerUpdateArgs args; try { CruiseServerSnapshot snapshot = null; try { client.ProcessSingleAction <object>(o => { snapshot = client.GetCruiseServerSnapshot(); }, null); } catch (NotImplementedException) { // This is an older style server, try fudging the snapshot snapshot = new CruiseServerSnapshot { ProjectStatuses = client.GetProjectStatus() }; } args = new ServerUpdateArgs(snapshot); } catch (Exception error) { args = new ServerUpdateArgs(error); } // Fire the update if (Update != null) { Update(this, args); } }