/// <summary>
 /// Create the response object based on the response string.
 /// </summary>
 /// <param name="responseStr"></param>
 /// <returns></returns>
 public static IResponse CreateResponse(string responseStr) {
     IResponse response;
     switch (responseStr) {
         case "M":
             response = new MessageResponse();
             break;
         case "E":
             // NOTE: The error message response is overloaded from the server
             //  so there is some complexity hidden in this class...responses
             //  are basically being delegated to other responses in here.
             response = new ErrorMessageResponse();
             break;
         case "MT":
             response = new MessageTaggedResponse();
             break;
         case "Checked-in":
             response = new CheckedInResponse();
             break;
         case "New-entry":
             response = new NewEntryResponse();
             break;
         case "Mod-time":
             response = new ModTimeResponse();
             break;
         case "ok":
             ResetErrorResponseHandlers();
             response = new OkResponse();
             break;
         case "error":
             response = new ErrorResponse();
             break;
         case "Merged":
             response = new MergedResponse();
             break;
         case "Updated":
             response = new UpdatedResponse();
             break;
         case "Created":
             response = new CreatedResponse();
             break;
         case "Module-expansion":
             response = new ModuleExpansionResponse();
             break;
         case "Clear-sticky":
             response = new ClearStickyResponse();
             break;
         case "Set-static-directory":
             response = new SetStaticDirectoryResponse();
             break;
         case "Clear-static-directory":
             response = new ClearStaticDirectoryResponse();
             break;
         case "Valid-requests":
             response = new ValidRequestsResponse();
             break;
         case "Set-sticky":
             response = new SetStickyResponse ();
             break;
         case "Removed":
             response = new RemovedResponse();
             break;
         default:
             response = null;
             break;
     }
     return response;
 }
示例#2
0
        /// <summary>
        /// Create the response object based on the response string.
        /// </summary>
        /// <param name="responseStr"></param>
        /// <returns></returns>
        public static IResponse CreateResponse(string responseStr)
        {
            IResponse response;

            switch (responseStr)
            {
            case "M":
                response = new MessageResponse();
                break;

            case "E":
                // NOTE: The error message response is overloaded from the server
                //  so there is some complexity hidden in this class...responses
                //  are basically being delegated to other responses in here.
                response = new ErrorMessageResponse();
                break;

            case "MT":
                response = new MessageTaggedResponse();
                break;

            case "Checked-in":
                response = new CheckedInResponse();
                break;

            case "New-entry":
                response = new NewEntryResponse();
                break;

            case "Mod-time":
                response = new ModTimeResponse();
                break;

            case "ok":
                ResetErrorResponseHandlers();
                response = new OkResponse();
                break;

            case "error":
                response = new ErrorResponse();
                break;

            case "Merged":
                response = new MergedResponse();
                break;

            case "Updated":
                response = new UpdatedResponse();
                break;

            case "Created":
                response = new CreatedResponse();
                break;

            case "Module-expansion":
                response = new ModuleExpansionResponse();
                break;

            case "Clear-sticky":
                response = new ClearStickyResponse();
                break;

            case "Set-static-directory":
                response = new SetStaticDirectoryResponse();
                break;

            case "Clear-static-directory":
                response = new ClearStaticDirectoryResponse();
                break;

            case "Valid-requests":
                response = new ValidRequestsResponse();
                break;

            case "Set-sticky":
                response = new SetStickyResponse();
                break;

            case "Removed":
                response = new RemovedResponse();
                break;

            default:
                response = null;
                break;
            }
            return(response);
        }