BitCollectors.QfgCharacterEditor.WebUI.Controllers.CharacterController.Load C# (CSharp) Method

Load() private method

private Load ( System.Web.HttpPostedFileBase file ) : System.Web.Mvc.ActionResult
file System.Web.HttpPostedFileBase
return System.Web.Mvc.ActionResult
        public ActionResult Load(HttpPostedFileBase file)
        {
            QfgCharacter qfgCharacter = new QfgCharacter();

            if (file.ContentLength > 0)
            {
                using (var reader = new StreamReader(file.InputStream))
                {
                    string characterFileString = reader.ReadToEnd();

                    string[] filePieces = characterFileString.Split('\n');

                    if (filePieces.Length > 1)
                    {
                        qfgCharacter.LoadCharacter(filePieces[0].Trim(), filePieces[1]);
                    }
                }
            }

            return View("General", qfgCharacter);
        }