Exemple #1
0
 public void Commit(IzFree.Project project, string rootDirectory,
                    string rootFeature)
 {
     CommitFiles(project);
     MSI.Database db = project.Database;
     CommitDirectories(db, rootDirectory);
     CommitMedia(db);
     CommitComponents(db);
     CommitFeatures(db, rootFeature);
     CommitFeatureComponents(db);
 }
Exemple #2
0
 private int FileCounter(IzFree.Project project)
 {
     try
     {
         return(project.GetIntegerIzProperty("FileCounter"));
     }
     catch (PropertyNotFoundException)
     {
         return(ScrapeFileCounter(project.Database));
     }
     catch
     {
         throw;
     }
 }
Exemple #3
0
        private void CommitFiles(IzFree.Project project)
        {
            MSI.Database db          = project.Database;
            int          fileCounter = FileCounter(project);

            using (MSI.View view = db.OpenView("INSERT INTO `File`(" +
                                               "`File`,`Component_`,`FileName`,`FileSize`,`Version`," +
                                               "`Language`,`Attributes`,`Sequence`) " +
                                               "VALUES (?,?,?,?,?,?,0,1)"))
            {
                for (int i = 0; i < m_files.Count; i++)
                {
                    File file = m_files[i] as File;
                    using (MSI.Record rec = new MSI.Record(6))
                    {
                        rec.SetString(1, DatabaseKey(file.Name) + "_f" +
                                      (fileCounter + i).ToString());
                        rec.SetString(2, file.Component.Name);
                        rec.SetString(3, (file.ShortName.Length > 0) ?
                                      file.ShortName + "|" + file.Name : file.Name);
                        rec.SetInteger(4, (int)file.Size);
                        rec.SetString(5, file.Version);
                        if (file.Version != "")
                        {
                            rec.SetInteger(6, 0);
                        }
                        else
                        {
                            rec.SetString(6, "");
                        }
                        view.Execute(rec);
                    }
                }
                view.Close();
            }

            project.SetIzProperty("FileCounter",
                                  (fileCounter + m_files.Count).ToString());
        }