예제 #1
0
파일: Project.cs 프로젝트: rowetechinc/RTI
        /// <summary>
        /// Create a project with a given project database file.
        /// This will copy the given project database file instead
        /// of creating an new empty database file.  The database file
        /// will be renamed to the new project name, but the content within
        /// the database file will not be modified.
        /// </summary>
        /// <param name="name">Name of the project.</param>
        /// <param name="dir">Directory of the projects.</param>
        /// <param name="serialNum">Serial number of the project.</param>
        /// <param name="dbFilePath">File path to the database file.</param>
        public Project(string name, string dir, string serialNum, string dbFilePath)
        {
            // Set the initial settings
            ProjectID = Project.EmptyID;
            //SetFolders(name, dir);
            Options = new ProjectOptions(name, dir);
            DateCreated = DateTime.Now;
            LastDateModified = DateTime.Now;
            CreateSerialNumber(serialNum);

            // Create the directory if it does not exist
            Directory.CreateDirectory(Options.ProjectFolderPath);

            // Copy the database file
            CopyProjectDatabase(dbFilePath);

            // Initialize the object
            Initialize();
        }
예제 #2
0
파일: Project.cs 프로젝트: rowetechinc/RTI
        /// <summary>
        /// Constructor
        /// Set the Database ID, name and directory.
        /// </summary>
        /// <param name="id">Database ID.</param>
        /// <param name="name">Project name.</param>
        /// <param name="dir">Project directory.</param>
        /// <param name="dateCreated">Date the project is created.</param>
        /// <param name="lastDateModified">Last date the project was modified.</param>
        /// <param name="serialNum">System serial number.</param>
        public Project(int id, string name, string dir, DateTime dateCreated, DateTime lastDateModified, string serialNum)
        {
            // Set the initial settings
            //SetFolders(name, dir);
            Options = new ProjectOptions(name, dir);
            ProjectID = id;
            DateCreated = dateCreated;
            LastDateModified = lastDateModified;
            CreateSerialNumber(serialNum);

            // Create the directory if it does not exist
            Directory.CreateDirectory(Options.ProjectFolderPath);

            // Create the database file
            CreateProjectDatabase();

            // Initialize the object
            Initialize();
        }