Summary description for Bundle.
Inheritance: IBundle
Beispiel #1
0
 private void CheckInstallBundle(Bundle bundle)
 {
     IBundle existsBundle = bundleRepository.GetBundle(bundle.SymbolicName, null);
     if (existsBundle != null)
     {
         throw new BundleException("Bundle is already installed.");
     }
 }
Beispiel #2
0
        private IBundle InstallBundleInternal(Bundle bundle)
        {
            bundleRepository.Register(bundle);

            if (bundle.State == BundleState.Installed)
            {
                EventManager.OnBundleChanged(
                    new BundleEventArgs(
                        BundleTransition.Installed, bundle)
                        );
            }

            return bundle;
        }
Beispiel #3
0
        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;
        }