예제 #1
0
        public IResult ValidateComponent(DrawFileComponentType type)
        {
            //????
            string name     = @"Game\";
            string tempPath = Path.GetTempPath();
            string path     = tempPath + name;
            //????

            IResult result = new Result()
            {
                Success = true, Message = ""
            };
            GameStageConfigSection entity          = ConfigurationHolder.ApiConfiguration;
            ValidataArchive        validataArchive = new ValidataArchive(entity);

            switch (type)
            {
            case DrawFileComponentType.Stage:
                IResult resultStage = validataArchive.Stage(path);
                result.Message = resultStage.Message;
                break;

            case DrawFileComponentType.SubStage:
                IResult resultSubFiles =
                    validataArchive.SubStageFile(path);
                result.Message = resultSubFiles.Message;

                break;

            case DrawFileComponentType.Team:
                IResult resultSubItemFiles =
                    validataArchive.QuestionFile(path);
                result.Message = resultSubItemFiles.Message;
                break;

            case DrawFileComponentType.Topic:
                IResult resultQuestionFiles =
                    validataArchive.QuestionTopicFile(path);
                result.Message = resultQuestionFiles.Message;
                break;
            }

            return(result);
        }
예제 #2
0
        public IDataResult <IStageComponent> GetComponent(DrawFileComponentType type)
        {
            ComponentValidator            componentValidator = new ComponentValidator();
            IResult                       result             = componentValidator.ValidateComponent(type);
            IDataResult <IStageComponent> dataResult         =
                result as IDataResult <IStageComponent>;

            if (result.Success)
            {
                switch (type)
                {
                case DrawFileComponentType.Stage:
                    IStageComponent stage = new StageComponent();
                    stage.SubComponents = new System.Collections.Generic.List <IStageComponent>();

                    break;

                case DrawFileComponentType.SubStage:


                    break;

                case DrawFileComponentType.Team:
                    break;

                case DrawFileComponentType.Topic:
                    break;
                }
            }


            //DataResult<IStageComponent> dataResult = new DataResult<IStageComponent>();
            //IStageComponent stage = new StageComponent();
            //IFileData fileData = new FileData();
            //fileData.CurrentComponent = new MemoryStream();

            //stage.CurrentComponentFileData = fileData;


            //dataResult.Data = stage;

            return(dataResult);
        }
예제 #3
0
 public IDataResult <IStageComponent> GetComponent(DrawFileComponentType type)
 {
     throw new System.NotImplementedException();
 }
예제 #4
0
        public IResult ValidateComponent(DrawFileComponentType type)
        {
            ComponentValidator valid = new ComponentValidator();

            return(valid.ValidateComponent(type));
        }
예제 #5
0
        public IDataResult <IStageComponent> GetComponent(DrawFileComponentType type)
        {
            ComponentReader reader = new ComponentReader();

            return(reader.GetComponent(type));
        }
예제 #6
0
 public IResult ValidateComponent(DrawFileComponentType type)
 {
     throw new System.NotImplementedException();
 }