private void CheckInstallBundle(Bundle bundle) { IBundle existsBundle = bundleRepository.GetBundle(bundle.SymbolicName, null); if (existsBundle != null) { throw new BundleException("Bundle is already installed."); } }
private IBundle InstallBundleInternal(Bundle bundle) { bundleRepository.Register(bundle); if (bundle.State == BundleState.Installed) { EventManager.OnBundleChanged( new BundleEventArgs( BundleTransition.Installed, bundle) ); } return bundle; }
public IBundle InstallBundle(string location, BundleData bd) { if (!ValidExtention(location)) { location = location + BundleExtention; } string fullLocation = string.Empty; bool isPathRooted = Path.IsPathRooted(location); if (isPathRooted) { fullLocation = location; } if (!File.Exists(fullLocation)) { throw new BundleException(String.Format("Bundle {0} not found.", location), new FileNotFoundException(String.Format("file:{0} not found.", fullLocation))); } // Create the bundle object BundleData bundleData = bd; bundleData.Id = bundleRepository.Count; bundleData.Location = fullLocation; Bundle bundle = new Bundle(bundleData, this); CheckInstallBundle(bundle); InstallBundleInternal(bundle); return bundle; }