public HDEHost() { FUseAppdata = Environment.GetCommandLineArgs().Contains("/appdata"); // Set vvvv.exe path ExePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName((typeof(HDEHost).Assembly.Location)), @"..\..")); //add repository paths from commandline //from commandline var repoArg = "/package-repositories"; var packageRepositories = ExtractPaths(repoArg); AssemblyLoader.AddPackageRepositories(packageRepositories); //the built-in one if (Directory.Exists(PacksPath)) { AssemblyLoader.AddPackageRepository(PacksPath); } //the one where the user is supposed to install packages to share it between vvvversions if (FUseAppdata) { if (Directory.Exists(UserPacksPath)) { AssemblyLoader.AddPackageRepository(UserPacksPath); } } //the legacy path if (Directory.Exists(UserPacksPathLegacy)) { AssemblyLoader.AddPackageRepository(UserPacksPathLegacy); } // Set name to vvvv thread for easier debugging. Thread.CurrentThread.Name = "vvvv"; // Create a windows forms sync context (FileSystemWatcher runs asynchronously). SynchronizationContext.SetSynchronizationContext(new MySynchronizationContext()); // Register at least one ICommandHistory for top level element ISolution var mappingRegistry = new MappingRegistry(); mappingRegistry.RegisterMapping <ISolution, ICommandHistory, CommandHistory>(MapInstantiation.PerInstanceAndItsChilds); var location = Shell.CallerPath.ConcatPath(@"..\..\lib\nodes\plugins").ConcatPath("Solution.sln"); Solution = new Solution(location, mappingRegistry); EnumManager.SetHDEHost(this); Logger = new DefaultLogger(); IORegistry = new IORegistry(); // Will tell Windows Forms that a message loop is indeed running Application.RegisterMessageLoop(IsSendingMessages); }
static void Main(string[] args) { var repoPath = Path.GetFullPath(Path.Combine( Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "..", "..", "..", "..")); AssemblyLoader.AddPackageRepository(repoPath); foreach (var package in AssemblyLoader.Repository.GetPackages().OfType <SrcPackageWithNuspec>()) { Console.WriteLine($"Found {package} in {package.NuspecFile}"); } Console.ReadLine(); }
public HDEHost() { // Set vvvv.exe path ExePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName((typeof(HDEHost).Assembly.Location)), @"..\..")); //add repository paths from commandline //from commandline var repoArg = "/package-repositories"; var packageRepositories = AssemblyLoader.ParseCommandLine(repoArg); //from args.txt var argsFile = Path.Combine(ExePath, "args.txt"); if (File.Exists(argsFile)) { var args = File.ReadAllText(argsFile).Trim('\r', '\n', ' ').Split(' '); var sourcesIndex = Array.IndexOf(args, repoArg); if (sourcesIndex >= 0 && args.Length > sourcesIndex + 1) { var sourcesString = args[sourcesIndex + 1].Trim('"'); var repoPaths = sourcesString.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < repoPaths.Length; i++) { repoPaths[i] = repoPaths[i].Trim('"', '\\'); } packageRepositories = packageRepositories.Union(repoPaths).ToArray(); } } //make relative paths absolute for (int i = 0; i < packageRepositories.Length; i++) { if (Path.IsPathRooted(packageRepositories[i])) { packageRepositories[i] = Path.Combine(ExePath, packageRepositories[i]); } } AssemblyLoader.AddPackageRepositories(packageRepositories); //the built-in one if (Directory.Exists(PacksPath)) { AssemblyLoader.AddPackageRepository(PacksPath); } //the one where the user is supposed to install packages if (Directory.Exists(UserPacksPatch)) { AssemblyLoader.AddPackageRepository(UserPacksPatch); } // Set name to vvvv thread for easier debugging. Thread.CurrentThread.Name = "vvvv"; // Create a windows forms sync context (FileSystemWatcher runs asynchronously). SynchronizationContext.SetSynchronizationContext(new MySynchronizationContext()); // Register at least one ICommandHistory for top level element ISolution var mappingRegistry = new MappingRegistry(); mappingRegistry.RegisterMapping <ISolution, ICommandHistory, CommandHistory>(MapInstantiation.PerInstanceAndItsChilds); var location = Shell.CallerPath.ConcatPath(@"..\..\lib\nodes\plugins").ConcatPath("Solution.sln"); Solution = new Solution(location, mappingRegistry); EnumManager.SetHDEHost(this); Logger = new DefaultLogger(); IORegistry = new IORegistry(); // Will tell Windows Forms that a message loop is indeed running Application.RegisterMessageLoop(IsSendingMessages); }
public HDEHost() { // Set vvvv.exe path ExePath = Path.GetFullPath(Path.Combine(Path.GetDirectoryName((typeof(HDEHost).Assembly.Location)), @"..\..")); //add repository paths from commandline //from commandline var repoArg = "/package-repositories"; var packageRepositories = AssemblyLoader.ParseCommandLine(repoArg); //from args.txt var argsFile = Path.Combine(ExePath, "args.txt"); if (File.Exists(argsFile)) { var args = File.ReadAllText(argsFile); var repoPaths = args.Split(new string[] { "\r", "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries) .Where(l => l.StartsWith(repoArg)) .SelectMany(r => r.Substring(repoArg.Length + 1).Trim('"').Split(';')); packageRepositories = packageRepositories.Union(repoPaths).ToArray(); } AssemblyLoader.AddPackageRepositories(packageRepositories); //the built-in one if (Directory.Exists(PacksPath)) { AssemblyLoader.AddPackageRepository(PacksPath); } //the one where the user is supposed to install packages if (Directory.Exists(UserPacksPatch)) { AssemblyLoader.AddPackageRepository(UserPacksPatch); } // Set name to vvvv thread for easier debugging. Thread.CurrentThread.Name = "vvvv"; // Create a windows forms sync context (FileSystemWatcher runs asynchronously). SynchronizationContext.SetSynchronizationContext(new MySynchronizationContext()); // Register at least one ICommandHistory for top level element ISolution var mappingRegistry = new MappingRegistry(); mappingRegistry.RegisterMapping <ISolution, ICommandHistory, CommandHistory>(MapInstantiation.PerInstanceAndItsChilds); var location = Shell.CallerPath.ConcatPath(@"..\..\lib\nodes\plugins").ConcatPath("Solution.sln"); Solution = new Solution(location, mappingRegistry); EnumManager.SetHDEHost(this); Logger = new DefaultLogger(); IORegistry = new IORegistry(); // Will tell Windows Forms that a message loop is indeed running Application.RegisterMessageLoop(IsSendingMessages); }