Ejemplo n.º 1
0
        private void SetProject(ProjectData.Project project)
        {
            if (project != null)
            {
                try
                {
                    this.openDialog.InitialDirectory = project.InstallPath;
                    this.saveKnownFileListDialog.InitialDirectory = project.ListsPath;
                }
                catch (Exception e)
                {
                    MessageBox.Show(
                        "There was an error while loading project data." +
                        Environment.NewLine + Environment.NewLine +
                        e +
                        Environment.NewLine + Environment.NewLine +
                        "(You can press Ctrl+C to copy the contents of this dialog)",
                        "Error",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                    project = null;
                }

                this._Hashes = project.LoadListsFileNames();
            }

            // ReSharper disable RedundantCheckBeforeAssignment
            if (project != this._Manager.ActiveProject) // ReSharper restore RedundantCheckBeforeAssignment
            {
                this._Manager.ActiveProject = project;
            }

            this.projectComboBox.SelectedItem = project;
        }
Ejemplo n.º 2
0
        private void SetProject(ProjectData.Project project)
        {
            if (project != null)
            {
                try
                {
                    this.FileHashLookup = project.LoadListsFileNames();
                    this.TypeHashLookup = project.LoadListsTypeNames();

                    this.openDialog.InitialDirectory = project.InstallPath;
                    this.saveKnownFileListDialog.InitialDirectory = project.ListsPath;
                }
                catch (Exception e)
                {
                    MessageBox.Show(
                        "There was an error while loading project data." +
                        Environment.NewLine + Environment.NewLine +
                        e.ToString() +
                        Environment.NewLine + Environment.NewLine +
                        "(You can press Ctrl+C to copy the contents of this dialog)",
                        "Error",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error);
                    project = null;
                }
            }

            if (project != this.Manager.ActiveProject)
            {
                this.Manager.ActiveProject = project;
            }

            this.projectComboBox.SelectedItem = project;
        }
Ejemplo n.º 3
0
 public static ProjectData.HashList <uint> LoadListsTypeNames(
     this ProjectData.Project project)
 {
     return(project.LoadLists(
                "*.typelist",
                s => s.HashFNV32(),
                s => s.ToLowerInvariant()));
 }
Ejemplo n.º 4
0
 public static ProjectData.HashList <ulong> LoadListsFileNames(
     this ProjectData.Project project)
 {
     return(project.LoadLists(
                "*.filelist",
                s => s.HashFNV64(),
                s => s.ToLowerInvariant()));
 }
Ejemplo n.º 5
0
 public static ProjectData.HashList <uint> LoadListsColumnNames(
     this ProjectData.Project project)
 {
     return(project.LoadLists(
                "*.columnlist",
                s => s.HashCRC32(),
                s => s.ToLowerInvariant()));
 }
Ejemplo n.º 6
0
 public static ProjectData.HashList <uint> LoadFileLists(
     this ProjectData.Project project)
 {
     return(project.LoadLists(
                "*.filelist",
                FileHasher,
                FileModifier));
 }
Ejemplo n.º 7
0
 public static ProjectData.HashList <uint> LoadListsFileNames(
     this ProjectData.Project project)
 {
     return(project.LoadLists(
                "*.filelist",
                s => s.HashFileName(),
                s => s.Replace('\\', '/')));
 }
Ejemplo n.º 8
0
 public static ProjectData.HashList <uint> LoadListsFileNames(
     this ProjectData.Project project)
 {
     return(project.LoadLists(
                "*.filelist",
                s => Path.GetFileName(s).HashJenkins(),
                s => s.ToLowerInvariant()));
 }
Ejemplo n.º 9
0
 public static ProjectData.HashList <uint> LoadListsPropertyNames(
     this ProjectData.Project project)
 {
     return(project.LoadLists(
                "*.namelist",
                s => s.HashJenkins(),
                s => s));
 }
Ejemplo n.º 10
0
 public static ProjectData.HashList <uint> LoadFileLists(
     this ProjectData.Project project,
     Action <uint, string, string> extra)
 {
     return(project.LoadLists(
                "*.filelist",
                FileHasher,
                FileModifier,
                extra));
 }
Ejemplo n.º 11
0
        public static ProjectData.HashList <ulong> LoadListsSubFatNames(this ProjectData.Project project,
                                                                        int bigVersion)
        {
            if (bigVersion >= 9) // TODO: check if this is right...
            {
                return(project.LoadLists("*.subfatlist",
                                         a => CRC64.Hash(a.ToLowerInvariant()),
                                         s => s.Replace("/", "\\")));
            }

            return(project.LoadLists("*.subfatlist",
                                     a => (ulong)CRC32.Hash(a.ToLowerInvariant()),
                                     s => s.Replace("\\", "/")));
        }
Ejemplo n.º 12
0
 public static ProjectData.HashList <uint> LoadListsFileNames(this ProjectData.Project project,
                                                              int bigVersion)
 {
     return(project.LoadLists("*.filelist", Hasher, Modifier));
 }
Ejemplo n.º 13
0
 public static ProjectData.HashList <uint> LoadListsAnimationNames(this ProjectData.Project project)
 {
     return(project.LoadLists("*.animlist", AnimationCacheBinaryFile.ComputeNameHash, Modifier));
 }
Ejemplo n.º 14
0
 public static ProjectData.HashList <ulong> LoadListsFileNames(this ProjectData.Project project)
 {
     return(project.LoadLists("*.filelist", ArchiveFile.ComputeNameHash, Modifier));
 }
Ejemplo n.º 15
0
 public static ProjectData.HashList <ulong> LoadListsInstance64Names(this ProjectData.Project project)
 {
     return(project.LoadLists("*.instancelist64", a => a.HashFNV64(), a => a.ToLowerInvariant()));
 }
Ejemplo n.º 16
0
 public static ProjectData.HashList <uint> LoadListsPropertySetNames(this ProjectData.Project project)
 {
     return(project.LoadLists("*.propsetlist", s => s.HashFileName(), s => s.Replace('/', '\\')));
 }
Ejemplo n.º 17
0
 public static ProjectData.HashList <uint> LoadListsPropertySetSymbolNames(this ProjectData.Project project)
 {
     return(project.LoadLists("*.symbollist", s => s.HashSymbol(), s => s.Replace('/', '\\')));
 }