private static void GetPluginData(out string executionId, out string hostAddress) { executionId = (string)null; hostAddress = (string)null; using (VisualStudioPerfectoLabServerProxy perfectoLabServerProxy = new VisualStudioPerfectoLabServerProxy(new EndpointAddress(string.Format(Settings.Default.PerfectoLabPluginServiceAddress, (object)ProccessService.GetVisualStudioId())))) { bool flag = false; try { executionId = perfectoLabServerProxy.GetExecutionId(); hostAddress = perfectoLabServerProxy.GetPluginCloudeAddress(); if (perfectoLabServerProxy.State == CommunicationState.Faulted) { return; } PerfectoLabUtils.CloseConnection((object)perfectoLabServerProxy); flag = true; } catch { } finally { if (!flag) { perfectoLabServerProxy.Abort(); } } } }
public static void SetPerfectoLabExecutionId(this DesiredCapabilities source, string host) { string executionId; string hostAddress; PerfectoLabUtils.GetPluginData(out executionId, out hostAddress); if (string.IsNullOrEmpty(executionId) || !host.ToLower().Contains(hostAddress.ToLower())) { return; } source.SetCapability(Settings.Default.ExecutionIdCapabilityName, (object)executionId); }