private void CloseTest() { try { if ((_test != null) && (_test.State != CommunicationState.Closed)) { if (_test.State == CommunicationState.Faulted) { _test.Abort(); } else { _test.Close(); } } } catch (Exception ex) { DiagnosticsHelper.LogException(DiagSeverity.ComponentFatal, "ServiceProxy: Failed to close Test interface", ex); } finally { _test = null; } }
private void codeActivity2_ExecuteCode(object sender, EventArgs e) { TestContractClient cc = new TestContractClient(); Console.WriteLine(cc.Add(3, 4)); Console.WriteLine("press any key"); Console.ReadLine(); }