Exemplo n.º 1
0
        public void Initialize()
        {
            State = new Dependency.Impl.State();
            State.MetadataBuilder = new MetadataBuilder(_framework);
            var firstOrDefaultService = _framework.ServiceContainer.GetFirstOrDefaultService <IBundleInstallerService>();
            var stopwatch             = new Stopwatch();

            try
            {
                stopwatch.Start();
                if (!firstOrDefaultService.InstallBundles())
                {
                    throw new Exception(Messages.LoadBundlesFailed);
                }
            }
            finally
            {
                stopwatch.Stop();
                FileLogUtility.Verbose(string.Format(Messages.InstallBundlesTimeCounter, stopwatch.ElapsedMilliseconds));
            }
            UpdateService.Update(new List <BundleData>(firstOrDefaultService.BundleDatas.Values), firstOrDefaultService.UpdateFolder);
            LicenseService.EnsureHasAvailableBundleLicense();
            var metadataBuilder = State.MetadataBuilder;

            CreateSystemBundle();
            foreach (KeyValuePair <string, BundleData> pair in firstOrDefaultService.BundleDatas)
            {
                _framework.AddBundleData(pair.Value);
            }
        }