コード例 #1
0
        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);
        }
コード例 #2
0
 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;
     }
 }
コード例 #3
0
 private static bool IsUriBadFormatted(string address)
 {
     if (Uri.IsWellFormedUriString(address, UriKind.RelativeOrAbsolute))
     {
         return(false);
     }
     s_pingResult = PingServiceResult.BadUrl;
     return(true);
 }
コード例 #4
0
 private static bool IsUriEmpty(string address)
 {
     if (!string.IsNullOrEmpty(address))
     {
         return(false);
     }
     s_pingResult = PingServiceResult.UrlIsEmpty;
     return(true);
 }
コード例 #5
0
 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);
 }