public DependentAssemblyInfo(AssemblyIdentity assmID, string codeBase)
 {
     this.assmID   = assmID;
     this.codeBase = codeBase;
 }
        void IFileOperator.ProcessFile(string startDir, string relPathDir, string fileName)
        {
            IAssemblyManifestImport currAssm = null;
            AssemblyIdentity        assmID   = null;

            DependentAssemblyInfo[] depAssmInfoArr = null;
            DependentFileInfo[]     depFileInfoArr = null;
            MGTrackerNode           tempNode;

            string   relPath = Path.Combine(relPathDir, fileName);
            string   absPath = Path.Combine(startDir, relPath);
            FileInfo fInf    = new FileInfo(absPath);

            //Console.Write("Processing " + absPath + "... ");

            try
            {
                currAssm       = DefaultAssemblyManifestImporter.GetAssemblyManifestImport(absPath);
                assmID         = currAssm.GetAssemblyIdentity();
                depAssmInfoArr = currAssm.GetDependentAssemblyInfo();
                depFileInfoArr = currAssm.GetDependentFileInfo();
            }
            catch (BadImageFormatException bife)
            {
                // This file is a module; update hash table
                tempNode = (MGTrackerNode)fileTable[relPath];
                if (tempNode == null)
                {
                    tempNode             = new MGTrackerNode();
                    fileTable[relPath]   = tempNode;
                    tempNode.hashKey     = relPath;
                    tempNode.installPath = relPath;
                    appModules.Add(tempNode);
                }
                tempNode.isConfNode   = true;
                tempNode.calcHashCode = ComputeFileHash(fInf);
                tempNode.size         = fInf.Length;
                // Finished updating module entry
            }

            if (currAssm != null)
            {
                // This file is an assembly; update hash table
                if (!IsPlatform(assmID.PublicKeyTokenString))                // completely ignore if it's part of a platform
                {
                    tempNode = (MGTrackerNode)fileTable[assmID.FullName];
                    if (tempNode == null)
                    {
                        tempNode = new MGTrackerNode();
                        fileTable[assmID.FullName] = tempNode;
                        tempNode.hashKey           = assmID.FullName;
                        tempNode.assmName          = assmID.Name;
                        tempNode.isAssm            = true;
                        tempNode.nVers             = assmID.Vers;
                        tempNode.publicKeyToken    = assmID.PublicKeyTokenString;
                        appAssms.Add(tempNode);
                    }
                    tempNode.isConfNode  = true;
                    tempNode.installPath = relPath;
                    tempNode.size        = fInf.Length;
                    // Finished updating assembly entry

                    // Now we process assembly dependencies
                    //depAssmInfoArr = currAssm.GetDependentAssemblyInfo();
                    foreach (DependentAssemblyInfo depAssmInfo in depAssmInfoArr)
                    {
                        AssemblyIdentity depAssmID = depAssmInfo.AssmID;
                        if (!IsPlatform(depAssmID.PublicKeyTokenString))                        // maybe call this "IsPlatform", "CheckPlatform"
                        {
                            tempNode = (MGTrackerNode)fileTable[depAssmID.FullName];
                            if (tempNode == null)
                            {
                                tempNode = new MGTrackerNode();
                                fileTable[depAssmID.FullName] = tempNode;
                                tempNode.hashKey        = depAssmID.FullName;
                                tempNode.assmName       = depAssmID.Name;
                                tempNode.isAssm         = true;
                                tempNode.nVers          = depAssmID.Vers;
                                tempNode.publicKeyToken = depAssmID.PublicKeyTokenString;
                                appAssms.Add(tempNode);
                            }
                            tempNode.depAssmKey  = assmID.FullName;
                            tempNode.depAssmName = assmID.Name;
                        }
                    }
                    // Done with assembly dependencies

                    // Now we process file dependencies
                    //depFileInfoArr = currAssm.GetDependentFileInfo();
                    foreach (DependentFileInfo depFileInfo in depFileInfoArr)
                    {
                        // For the hashtable, we actually need the relative path from the application root to the file,
                        // because we want this file entry's hash key to match the file entry that is obtained by discovering
                        // the actual location of the file
                        string fileHashKey = Path.Combine(relPathDir, depFileInfo.Name);
                        tempNode = (MGTrackerNode)fileTable[fileHashKey];
                        if (tempNode == null)
                        {
                            tempNode = new MGTrackerNode();
                            fileTable[fileHashKey] = tempNode;
                            tempNode.hashKey       = fileHashKey;
                            tempNode.installPath   = fileHashKey;
                            appModules.Add(tempNode);
                        }
                        tempNode.depAssmKey  = assmID.FullName;
                        tempNode.depAssmName = assmID.Name;
                    }
                    // Done with file dependencies
                }
            }
            //Console.WriteLine("done");
        }
 public DefaultAssemblyManifestImport(AssemblyIdentity assmID, DependentAssemblyInfo[] depAssmInfoArr, DependentFileInfo[] depFileInfoArr)
 {
     this.assmID         = assmID;
     this.depFileInfoArr = depFileInfoArr;
     this.depAssmInfoArr = depAssmInfoArr;
 }