private static ActionResult ParseError(Session session, PingServiceResult result) { switch (result) { case PingServiceResult.UrlIsEmpty: SetPingFailed(session, Properties.ServiceHostUrlIsEmpty); break; case PingServiceResult.BadUrl: SetPingFailed(session, Properties.BadUrl); break; case PingServiceResult.PingUnsuccessful: SetPingFailed(session, Properties.ServicePingFailed); break; case PingServiceResult.VersionMismatch: SetPingFailed(session, Properties.VersionMismatch); break; case PingServiceResult.Success: SetPingSucceeded(session); break; default: return(ActionResult.Failure); } return(ActionResult.Success); }
private static void CompareVersions (Version serviceVersion, string installerMajorVersion, string installerMinorVersion, string installerBuild) { if (!BadVersion.IsVersionBad(serviceVersion) && !VersionsAreEqual(serviceVersion, installerMajorVersion, installerMinorVersion, installerBuild)) { s_pingResult = PingServiceResult.VersionMismatch; } }
private static bool IsUriBadFormatted(string address) { if (Uri.IsWellFormedUriString(address, UriKind.RelativeOrAbsolute)) { return(false); } s_pingResult = PingServiceResult.BadUrl; return(true); }
private static bool IsUriEmpty(string address) { if (!string.IsNullOrEmpty(address)) { return(false); } s_pingResult = PingServiceResult.UrlIsEmpty; return(true); }
private static Version GetServiceVersion(Session session, IAVRFacade avrFacade) { try { return(avrFacade.GetServiceVersion()); } catch (UriFormatException ex) { session.Log(ex.Message); s_pingResult = PingServiceResult.BadUrl; } catch (Exception ex) { session.Log(ex.Message); s_pingResult = PingServiceResult.PingUnsuccessful; } return(BadVersion.GetBadVersion); }