private void CommitChanges(object param) { var newpaths = CommitRootLocations(); IEnumerable <string> additionalPaths = new List <string>(); //if paths are modified, reload packages and update prefs. if (!PreferenceSettings.CustomPackageFolders.SequenceEqual(newpaths)) { additionalPaths = newpaths.Except(PreferenceSettings.CustomPackageFolders); PreferenceSettings.CustomPackageFolders = newpaths; if (packageLoader != null) { packageLoader.LoadNewCustomNodesAndPackages(additionalPaths, customNodeManager); } } // Load packages from paths enabled by disable-path toggles if they are not already loaded. if (packageLoader != null && packagePathsEnabled.Any()) { var newPaths = packagePathsEnabled.Except(additionalPaths); packageLoader.LoadNewCustomNodesAndPackages(newPaths, customNodeManager); } packagePathsEnabled.Clear(); }