示例#1
0
        private IManageFile GetManageFile(EnumType fileType)
        {
            IStudentFactory abstractFactory;

            switch (fileType)
            {
            case EnumType.TXT:
            {
                abstractFactory = new TxtFactory();
                return(abstractFactory.Create());
            }

            case EnumType.XML:
            {
                abstractFactory = new XmlFactory();
                return(abstractFactory.Create());
            }

            default:
            {
                abstractFactory = new JsonFactory();
                return(abstractFactory.Create());
            }
            }
        }