Пример #1
0
        // Constructs an backup path string for the given assembly
        // An optional directory can be provided where the assembly file will be stored. The resulting path
        // will be next to the original file if no path is given.
        public static string GetPathBackup(this AssemblyStore.LIB_TYPE lib, string directory = null)
        {
            if (directory != null && !Directory.Exists(directory))
            {
                throw new ArgumentException("Argument path '{0}' does not exist!", directory);
            }

            string fullPath = AssemblyStore.GetAssemblyPath(lib);
            // Construct a new filename for the manipulated assembly
            string file = Path.GetFileNameWithoutExtension(fullPath);
            // We know for sure that the extension is .dll
            string newFileName = file + AssemblyStore.AssemblyBackupAffix + ".dll";
            string dir         = (directory != null) ? directory : Path.GetDirectoryName(fullPath);
            // Construct a new full path for the manipulated assembly
            string newFullPath = Path.Combine(dir, newFileName);

            return(newFullPath);
        }
Пример #2
0
 // Fetch the original location of the given library
 public static string GetPath(this AssemblyStore.LIB_TYPE lib)
 {
     return(AssemblyStore.GetAssemblyPath(lib));
 }