示例#1
0
        public static Project Create(string Profolder, string Proname, PType Protype, bool Inctemplate)
        {
            Project PObject;
            string  Profile = Profolder + @"\" + Proname + @"\" + Proname + ".mpr";

            Profolder = Profolder + @"\" + Proname;
            switch (Protype)
            {
            case PType.Csharp:
                PObject = new Csharp(Profile);
                break;

            case PType.Databse:
                PObject = new Database(Profile);
                break;

            case PType.Hydro:
                PObject = new Hydro(Profile);
                break;

            case PType.Ilasm:
                PObject = new Ilasm(Profile);
                break;

            case PType.Java:
                PObject = new Java(Profile);
                break;

            case PType.Unmanaged:
                PObject = new Unmanaged(Profile);
                break;

            case PType.Vbasic:
                PObject = new Vbasic(Profile);
                break;

            case PType.Website:
                PObject = new Website(Profile);
                break;

            case PType.Yalamof:
                PObject = new Yalamof(Profile);
                break;

            default:
                PObject = new Unmanaged();
                break;
            }
            try
            {
                Directory.CreateDirectory(Profolder);
                if (Inctemplate == true)
                {
                    PObject.CopyTemplate();
                }
                PObject.Save();
            }
            catch (Exception e)
            {
                Exceptioner.Log(e);
            }
            return(PObject);
        }