Exemplo n.º 1
0
        private string GetCacheFileName(string path)
        {
            string cacheDir     = GetCachePath();
            string hashFileName = HashCalculator.CalculateSHA1(path);

            return(Path.Combine(cacheDir, hashFileName + "." + context.Settings.LanguageId.ToLower() + ".bin"));
        }
Exemplo n.º 2
0
 private string GetCacheFileName(string path)
 {
     string pluginDir = Path.Combine(PathHelper.DataDir, "ASCompletion");
     string cacheDir = Path.Combine(pluginDir, "FileCache");
     string hashFileName = HashCalculator.CalculateSHA1(path);
     return Path.Combine(cacheDir, hashFileName + "." + context.Settings.LanguageId.ToLower());
 }
        private string GetBreakpointsFile(string path)
        {
            string pluginDir    = Path.Combine(PathHelper.DataDir, "FlexDbg");
            string cacheDir     = Path.Combine(pluginDir, "Breakpoints");
            string hashFileName = HashCalculator.CalculateSHA1(path);

            return(Path.Combine(cacheDir, hashFileName + ".xml"));
        }
Exemplo n.º 4
0
        private string GetWatchFile(string path)
        {
            String dataDir  = Path.Combine(PathHelper.DataDir, "FlashDebugger");
            String cacheDir = Path.Combine(dataDir, "Watch");

            if (!Directory.Exists(cacheDir))
            {
                Directory.CreateDirectory(cacheDir);
            }
            String hashFileName = HashCalculator.CalculateSHA1(path);

            return(Path.Combine(cacheDir, hashFileName + ".xml"));
        }
 /// <summary>
 /// Converts a path to a valid file name
 /// </summary>
 private static String ConvertToFileName(String path)
 {
     try
     {
         return(HashCalculator.CalculateSHA1(path));
     }
     catch
     {
         String filename  = Path.GetFullPath(path);
         String separator = Path.DirectorySeparatorChar.ToString();
         filename = path.Replace(separator, ".");
         filename = path.Replace(" ", "_");
         return(filename);
     }
 }
Exemplo n.º 6
0
        bool RestoreProjectSession(Project project)
        {
            if (project == null || !Settings.UseProjectSessions)
            {
                return(false);
            }
            String hash        = HashCalculator.CalculateSHA1(project.ProjectPath.ToLower());
            String sessionDir  = Path.Combine(SettingsDir, "Sessions");
            String sessionFile = Path.Combine(sessionDir, hash + ".ldb");

            if (File.Exists(sessionFile))
            {
                PluginBase.MainForm.CallCommand("RestoreSession", sessionFile);
                return(true);
            }
            return(false);
        }
Exemplo n.º 7
0
        void SaveProjectSession()
        {
            Project project = Tree.Projects.Count > 0 ? Tree.Projects[0] : null; // TODO we need a main project/solution

            if (project == null || !Settings.UseProjectSessions)
            {
                return;
            }
            String hash        = HashCalculator.CalculateSHA1(project.ProjectPath.ToLower());
            String sessionDir  = Path.Combine(SettingsDir, "Sessions");
            String sessionFile = Path.Combine(sessionDir, hash + ".ldb");

            if (!Directory.Exists(sessionDir))
            {
                Directory.CreateDirectory(sessionDir);
            }
            PluginBase.MainForm.CallCommand("SaveSession", sessionFile);
        }
Exemplo n.º 8
0
 /// <summary>
 /// Converts a path to a valid file name
 /// </summary>
 private static String ConvertToFileName(String path)
 {
     return(HashCalculator.CalculateSHA1(path));
 }