コード例 #1
0
        public ActionResult Check()
        {
            Connect();

            bool isAlive = proxy.AreYouAlive();

            if (isAlive)
            {
                ViewBag.Alive = "BROTHER IS ALIVE.";
            }
            else
            {
                ViewBag.Alive = "BROTHER IS NOT ALIVE";
            }

            return(View("Index"));
        }
コード例 #2
0
        private string ConnectToBrother()
        {
            TableHelper table = new TableHelper();

            try
            {
                IBrotherConnection proxy = Connect();
                proxy.AreYouAlive();

                response = "Instance 0 is alive.";


                table.AddEvidence(new EvidenceEntity(response));
            }
            catch (Exception e)
            {
                response = "Instance 0 is not alive.";
                table.AddEvidence(new EvidenceEntity(response, e.Message));
            }

            return(response);
        }