Beispiel #1
0
 public IEnumerator <ITask> LastIndexOfHandler(LastIndexOf lastIndexOf)
 {
     lastIndexOf.ResponsePort.Post(
         LastIndexOfResponse.FromRequest(lastIndexOf.Body)
         );
     yield break;
 }
        /// <summary>
        /// FromRequest - Performs the Last Index Of function
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public static LastIndexOfResponse FromRequest(LastIndexOfRequest request)
        {
            LastIndexOfResponse response = new LastIndexOfResponse();

            if (request.StartIndex > 0)
            {
                response._lastIndexOf = request.String.LastIndexOf(request.Query, request.StartIndex);
            }
            else
            {
                response._lastIndexOf = request.String.LastIndexOf(request.Query);
            }

            return(response);
        }