private string ApplyFileContentsToMatchedImport(Match match) { var file = FileSystem.ResolveAppRelativePathToFileSystem(match.Groups[2].Value); DependentFiles.Add(file); return(ReadFile(file)); }
private string ProcessImport(string file, string outputFile, string css) { var sourcePath = FileSystem.ResolveFileSystemPathToAppRelative(Path.GetDirectoryName(file)) + "/"; return(IMPORT_PATTERN.Replace(css, match => { var importPath = match.Groups[2].Value; string import; if (importPath.StartsWith("/")) { import = FileSystem.ResolveAppRelativePathToFileSystem(importPath); } else { import = FileSystem.ResolveAppRelativePathToFileSystem(sourcePath + importPath); } DependentFiles.Add(import); return ProcessCssFile(import, outputFile, true); })); }
private static void Main() { var mutex = new Mutex(true, Application.ProductName, out var flag); if (flag) { // 全局异常注册 var appEvents = new ApplicationEventHandlerClass(); Application.ThreadException += appEvents.OnThreadException; Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.DoEvents(); DependentFiles.LoadResourceDll(); // 载入资源dll文件 Application.Run(new LocationBase()); mutex.ReleaseMutex(); } else { Application.Exit(); } }