コード例 #1
0
        public int AddPackageContent(PackageContent packageContent)
        {
            this._unitOfWork.PackageContentRepository.Add(packageContent);

            this._unitOfWork.Save();
            return(packageContent.Id);
        }
コード例 #2
0
        public void Handle(UpdatePackageCommand command)
        {
            var package = _packageWithContentsQueryHandler.Handle(command.Id.Value);

            foreach (var content in package.Contents)
            {
                if (command.Items.Any(i => content.Locale == i.Locale))
                {
                    var item = command.Items.FirstOrDefault(i => content.Locale == i.Locale);
                    content.IsUpdated   = true;
                    content.Description = item.Description;
                }
                else
                {
                    content.IsUpdated = false;
                }
            }

            foreach (var item in command.Items)
            {
                if (package.Contents.Any(p => p.Locale == item.Locale))
                {
                    continue;
                }

                var content = new PackageContent();
                content.Id          = package.Id;
                content.IsUpdated   = true;
                content.Locale      = item.Locale;
                content.Description = item.Description;
                content.Package     = package;

                _packageContentRepository.Add(content);
            }
        }
コード例 #3
0
        public void Handle(AddPackageTranslationCommand command)
        {
            var package = _packageWithContents.Handle(command.Id.Value);

            foreach (var item in command.Items)
            {
                var content = package.Contents.FirstOrDefault(c => c.Locale == item.Locale);

                if (content != null && content.IsUpdated)
                {
                    continue;
                }

                if (content == null)
                {
                    content         = new PackageContent();
                    content.Package = package;
                    content.Locale  = item.Locale;
                    content.Id      = package.Id;
                    _packageContentRepository.Add(content);
                }

                content.IsUpdated   = true;
                content.Description = item.Description;
            }
        }
コード例 #4
0
 /// <summary>
 /// Gets the <see cref="Boilerplate.Web.Mvc.OpenGraph.OpenGraphCurrency"/> list for the <param name="packageContent"></param>.
 /// </summary>
 /// <param name="packageContent">Content of the package.</param>
 /// <returns>The <see cref="Boilerplate.Web.Mvc.OpenGraph.OpenGraphCurrency"/> list for the <param name="packageContent"></param>.</returns>
 private static IEnumerable <OpenGraphCurrency> GetOpenGraphCurrencies(this PackageContent packageContent)
 {
     return(PriceService.Value.GetPrices(
                market: CurrentMarket.Value.GetCurrentMarket().MarketId,
                validOn: DateTime.Now,
                new CatalogKey(catalogEntryCode: packageContent.Code),
                new PriceFilter()).GetOpenGraphCurrencies());
 }
コード例 #5
0
 private IEnumerable <FashionVariant> GetVariants(PackageContent currentContent)
 {
     return(_contentLoader
            .GetItems(currentContent.GetEntries(_relationRepository), _languageResolver.GetPreferredCulture())
            .OfType <FashionVariant>()
            .Where(v => v.IsAvailableInCurrentMarket(_currentMarket) && !_filterPublished.ShouldFilter(v))
            .ToArray());
 }
コード例 #6
0
        /// <summary>
        /// Renders the OpenGraph header tags for <see cref="PackageContent"/>
        /// </summary>
        /// <param name="htmlHelper">The HTML helper.</param>
        /// <param name="content">The content.</param>
        /// <returns>The <see cref="IHtmlString"/>.</returns>
        /// <exception cref="T:System.Web.HttpException">The Web application is running under IIS 7 in Integrated mode.</exception>
        /// <exception cref="T:System.InvalidOperationException">The current <see cref="T:System.Uri" /> instance is not an absolute instance.</exception>
        /// <exception cref="T:System.ArgumentException">The specified <see cref="UriPartial.Authority"/> is not valid.</exception>
        /// <exception cref="T:System.ArgumentNullException">Parent products are <see langword="null" />.</exception>
        /// <exception cref="T:System.NotSupportedException">The query collection is read-only.</exception>
        /// <exception cref="T:System.MemberAccessException">The <see cref="T:System.Lazy`1" /> instance is initialized to use the default constructor of the type that is being lazily initialized, and permissions to access the constructor are missing.</exception>
        /// <exception cref="T:System.MissingMemberException">The <see cref="T:System.Lazy`1" /> instance is initialized to use the default constructor of the type that is being lazily initialized, and that type does not have a public, parameterless constructor.</exception>
        public static IHtmlString OpenGraphProductItem(this HtmlHelper htmlHelper, PackageContent content)
        {
            OpenGraphProductItem openGraphContent = content.ToOpenGraphProductItem();

            return(openGraphContent == null
                       ? MvcHtmlString.Empty
                       : htmlHelper.OpenGraph(openGraphMetadata: openGraphContent));
        }
コード例 #7
0
 internal static PackageContentViewModel FromModel(PackageContent model)
 {
     return(new PackageContentViewModel
     {
         Description = model.Description,
         Locale = model.Locale,
         Id = model.Id,
         IsUpdated = model.IsUpdated
     });
 }
コード例 #8
0
        /// <summary>
        /// Check in or check out the file.
        /// </summary>
        public override void Execute()
        {
            Project project = App.Instance.SalesForceApp.CurrentProject;

            if (project != null)
            {
                if (project.IsDownloadingSymbols)
                {
                    throw new Exception("The search index is currently being updated by the Reload symbols process.  Please wait for this to complete and then try again.");
                }

                SourceFileNode[] nodes = GetSelectedNodes();
                if (nodes.Length > 0)
                {
                    List <SourceFile> files = new List <SourceFile>();
                    foreach (SourceFileNode node in nodes)
                    {
                        files.Add(node.SourceFile);
                    }

                    using (App.Wait("Updating search index."))
                    {
                        byte[] package = project.Client.Meta.GetSourceFileContentAsPackage(files);
                        using (SearchIndex searchIndex = new SearchIndex(project.SearchFolder, true))
                        {
                            using (PackageContent packageContent = new PackageContent(package))
                            {
                                foreach (SourceFile file in files)
                                {
                                    string content = packageContent.GetContent(file);
                                    if (content != null)
                                    {
                                        searchIndex.Add(
                                            file.Id,
                                            file.FileName,
                                            file.FileType.Name,
                                            file.Name,
                                            content);
                                    }
                                }
                            }
                        }
                    }

                    App.MessageUser(
                        "The search index has been updated.",
                        "Search Index",
                        System.Windows.MessageBoxImage.Information,
                        new string[] { "OK" });
                }
            }
        }
コード例 #9
0
 /// <summary>
 /// Converts the <param name="content"></param> to an <see cref="Boilerplate.Web.Mvc.OpenGraph.OpenGraphProductItem"/>.
 /// </summary>
 /// <param name="content">The content.</param>
 /// <param name="openGraphCondition">The open graph condition.</param>
 /// <returns>The <see cref="Boilerplate.Web.Mvc.OpenGraph.OpenGraphProductItem"/> for the <param name="content"></param>.</returns>
 /// <exception cref="T:System.Web.HttpException">The Web application is running under IIS 7 in Integrated mode.</exception>
 /// <exception cref="T:System.InvalidOperationException">The current <see cref="T:System.Uri" /> instance is not an absolute instance.</exception>
 /// <exception cref="T:System.ArgumentException">The specified <see cref="UriPartial.Authority"/> is not valid.</exception>
 /// <exception cref="T:System.ArgumentNullException">Parent products are <see langword="null" />.</exception>
 /// <exception cref="T:System.NotSupportedException">The query collection is read-only.</exception>
 /// <exception cref="T:System.MemberAccessException">The <see cref="T:System.Lazy`1" /> instance is initialized to use the default constructor of the type that is being lazily initialized, and permissions to access the constructor are missing.</exception>
 /// <exception cref="T:System.MissingMemberException">The <see cref="T:System.Lazy`1" /> instance is initialized to use the default constructor of the type that is being lazily initialized, and that type does not have a public, parameterless constructor.</exception>
 public static OpenGraphProductItem ToOpenGraphProductItem(
     this PackageContent content,
     OpenGraphCondition openGraphCondition)
 {
     return(new OpenGraphProductItem(
                title: content.DisplayName,
                new OpenGraphImage(content.GetDefaultAsset <IContentMedia>()),
                content.GetOpenGraphAvailability(),
                condition: openGraphCondition,
                content.GetOpenGraphCurrencies(),
                retailerItemId: content.Code,
                content.GetUrl()));
 }
コード例 #10
0
        public void AddToCart_WhenItemIsBundleAndContainsPackage_ShouldAddContainedPackageToCart()
        {
            var bundle = new BundleContent
            {
                ContentLink = new ContentReference(1),
                Code        = "bundlecode"
            };

            var bundleEntry1 = new BundleEntry
            {
                Parent   = new ContentReference(2),
                Quantity = 1
            };

            var variant1 = new VariationContent
            {
                Code        = "variant1code",
                ContentLink = bundleEntry1.Parent
            };

            var bundleEntry2 = new BundleEntry
            {
                Parent   = new ContentReference(3),
                Quantity = 2
            };

            var package = new PackageContent
            {
                Code        = "packagecode",
                ContentLink = bundleEntry2.Parent
            };

            _referenceConverterMock.Setup(x => x.GetContentLink(variant1.Code)).Returns(variant1.ContentLink);
            _referenceConverterMock.Setup(x => x.GetContentLink(package.Code)).Returns(package.ContentLink);
            _referenceConverterMock.Setup(x => x.GetContentLink(bundle.Code)).Returns(bundle.ContentLink);

            _relationRepositoryMock.Setup(x => x.GetChildren <BundleEntry>(bundle.ContentLink))
            .Returns(() => new List <BundleEntry> {
                bundleEntry1, bundleEntry2
            });

            _contentLoaderMock.Setup(x => x.Get <EntryContentBase>(bundle.ContentLink)).Returns(bundle);
            _contentLoaderMock.Setup(x => x.Get <EntryContentBase>(variant1.ContentLink)).Returns(variant1);
            _contentLoaderMock.Setup(x => x.Get <EntryContentBase>(package.ContentLink)).Returns(package);

            _subject.AddToCart(_cart, bundle.Code, 1);

            Assert.Equal(bundleEntry1.Quantity + bundleEntry2.Quantity, _cart.GetAllLineItems().Sum(x => x.Quantity));
        }
コード例 #11
0
        public PackageContent ExtractPackageInfo(Core.Package package)
        {
            string tempPath = Path.Combine(this.TempFolder, Guid.NewGuid().ToString("N").ToUpper());

            package.Extract(tempPath);
            AppDomain tempDomain = ReflectionHelper.LoadAppDomain(tempPath, new Uri(this.GetType().Assembly.CodeBase).LocalPath);

            try {
                object handle;
                try {
                    handle = tempDomain.CreateInstanceAndUnwrap(typeof(PackageScanner).Assembly.GetName().Name, typeof(PackageScanner).FullName);
                } catch (FileNotFoundException) {
                    throw new AppServerException("Package does not contain required assembly " + typeof(PackageScanner).Assembly.Name());
                }
                PackageScanner scanner = handle as PackageScanner;
                if (scanner == null)
                {
                    throw new Exception("Could not load package scanner");
                }
                PackageContent info = scanner.Run();
                Logger.Info(this, "Scanner found " + info.Bootstrappers.Count + " bootstrapper(s) and " + info.Updaters.Count + " updater(s)");
                string manifestFile = Path.Combine(tempPath, "manifest.xml");
                if (File.Exists(manifestFile))
                {
                    Logger.Debug(this, "Loading package manifest " + manifestFile + "...");
                    try {
                        using (FileStream stream = File.Open(manifestFile, FileMode.Open, FileAccess.Read)) {
                            info.Manifest = XmlSerializer.Deserialize <Manifest>(stream);
                            Logger.Debug(this, "Manifest loaded");
                        }
                    } catch (Exception ex) {
                        Logger.Error("Failed to load manifest: " + ex.Message);
                    }
                }
                else
                {
                    Logger.Debug(this, "Package contains no manifest");
                }
                return(info);
            } finally {
                AppDomain.Unload(tempDomain);
                try {
                    Directory.Delete(tempPath, true);
                } catch (Exception ex) {
                    Logger.Warn(this, "Failed to remove temp folder " + tempPath + ": " + ex.Message);
                }
            }
        }
コード例 #12
0
        public PackageContent ExtractPackageInfo(Package package)
        {
            PackageContent packageContent = null;
            string         tempPath       = Path.Combine(this._tempFolder, Guid.NewGuid().ToString("N").ToUpper());

            try {
                package.Extract(tempPath);
                packageContent = this.ExtractPackageInfo(tempPath);
            } finally {
                try {
                    Directory.Delete(tempPath, true);
                } catch (Exception ex) {
                    Logger.Warn(this, "Failed to remove temp folder " + tempPath + ": " + ex.Message);
                }
            }
            return(packageContent);
        }
コード例 #13
0
        public static IEnumerable <PackageContent> Content(Stream nuGetPackage)
        {
            PackageContent content       = null;
            string         temporaryFile = null;

            try
            {
                if (!nuGetPackage.CanSeek)
                {
                    temporaryFile = Path.GetTempFileName();
                    using (var temporaryFileStream = File.OpenWrite(temporaryFile))
                        nuGetPackage.CopyTo(temporaryFileStream);

                    nuGetPackage = File.OpenRead(temporaryFile);
                }
                using (var inputZip = new ZipFile(nuGetPackage))
                {
                    foreach (var entry in inputZip.Cast <ZipEntry>().Where(x => x.IsFile))
                    {
                        var segments = entry.Name.Split('/');
                        if (segments.Length == 1 && Path.GetExtension(entry.Name).EqualsNoCase(".nuspec"))
                        {
                            yield return(ConvertSpecification(inputZip, entry));
                        }
                        else if (segments.Length >= 2 && segments[0].EqualsNoCase("lib"))
                        {
                            if ((content = ConvertAssembly(segments, inputZip, entry)) != null)
                            {
                                yield return(content);
                            }
                        }
                    }
                }
            }
            finally
            {
                if (temporaryFile != null)
                {
                    nuGetPackage.Close();
                    File.Delete(temporaryFile);
                }
            }
        }
コード例 #14
0
        public void Handle(SavePackageCommand command)
        {
            var package = new Package();

            package.Id = Guid.NewGuid();

            foreach (var item in command.Items)
            {
                var content = new PackageContent();
                content.Id          = package.Id;
                content.Locale      = item.Locale;
                content.Description = item.Description;
                content.Package     = package;
                content.IsUpdated   = true;
                _packageContentRepository.Add(content);
            }

            var currentUser = _currentUserRetriever.Get();

            package.CreatorId = currentUser.Id;


            var currentProjectId = _currentProjectContextId.Get();

            if (currentProjectId == null)
            {
                throw new Exception(Sentences.noProjectInContext);
            }

            var project = _projectRepository.Get(currentProjectId.Value);

            package.Project = project;
            package.Active  = true;

            var nextId = _packageNextIdQueryHandler.Handle(project.Id);

            package.Identifier = nextId;

            _packageRepository.Add(package);
        }
コード例 #15
0
 /// <summary>
 /// Converts the <param name="content"></param> to an <see cref="Boilerplate.Web.Mvc.OpenGraph.OpenGraphProductItem"/>.
 /// </summary>
 /// <param name="content">The content.</param>
 /// <returns>The <see cref="Boilerplate.Web.Mvc.OpenGraph.OpenGraphProductItem"/> for the <param name="content"></param>.</returns>
 /// <exception cref="T:System.Web.HttpException">The Web application is running under IIS 7 in Integrated mode.</exception>
 /// <exception cref="T:System.InvalidOperationException">The current <see cref="T:System.Uri" /> instance is not an absolute instance.</exception>
 /// <exception cref="T:System.ArgumentException">The specified <see cref="UriPartial.Authority"/> is not valid.</exception>
 /// <exception cref="T:System.ArgumentNullException">Parent products are <see langword="null" />.</exception>
 /// <exception cref="T:System.NotSupportedException">The query collection is read-only.</exception>
 /// <exception cref="T:System.MemberAccessException">The <see cref="T:System.Lazy`1" /> instance is initialized to use the default constructor of the type that is being lazily initialized, and permissions to access the constructor are missing.</exception>
 /// <exception cref="T:System.MissingMemberException">The <see cref="T:System.Lazy`1" /> instance is initialized to use the default constructor of the type that is being lazily initialized, and that type does not have a public, parameterless constructor.</exception>
 public static OpenGraphProductItem ToOpenGraphProductItem(this PackageContent content)
 {
     return(content.ToOpenGraphProductItem(openGraphCondition: OpenGraphCondition.New));
 }
コード例 #16
0
        internal static void DoInstallation(Package.InstallationStateData installationStateData, BackgroundWorker _wrkr, DoWorkEventArgs e, FileInfo packageContentLocation)
        {
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                if (_wrkr.CancellationPending)
                {
                    e.Cancel = true;
                    e.Result = false;
                    return;
                }
                try
                {
                    string _format = "Trying to create or reuse the site collection at {0}, configured site template {1}, LCID {2}.";
                    _wrkr.ReportProgress(1, String.Format(_format, installationStateData.SiteCollectionURL, installationStateData.SiteTemplate, installationStateData.LCID));
                    using (SiteCollectionHelper m_SiteCollectionHelper = SiteCollectionHelper.GetSPSite(
                               FarmHelpers.WebApplication,
                               installationStateData.SiteCollectionURL,
                               installationStateData.Title,
                               installationStateData.Description,
                               installationStateData.LCID,
                               null,
                               installationStateData.OwnerLogin,
                               installationStateData.OwnerName,
                               installationStateData.OwnerEmail))
                    {
                        installationStateData.SiteCollectionCreated = true;
                        _wrkr.ReportProgress(1, "Site collection is created");
                        if (m_SiteCollectionHelper.NewTemplateRequired)
                        {
                            _wrkr.ReportProgress(1, "Applying new template - select required from dialog.");
                            s_EndOFUIAction.Reset();
                            SPWebTemplateCollection _cllctn = m_SiteCollectionHelper.GetWebTemplates(installationStateData.LCID);
                            _wrkr.ReportProgress(1, new SPWebTeplateEventArgs(_cllctn, GetTemplate, 1, "Getting Site template")); //GetTemplate( FarmHelpers.WebApplication.Sites[ _urlSite ], installationStateData );
                            s_EndOFUIAction.WaitOne();
                            _wrkr.ReportProgress(1, String.Format("Applying new template {0}", WebTemplateDialog.SPWebTemplateToString(installationStateData.SPWebTemplate)));
                            m_SiteCollectionHelper.ApplayTemplate(installationStateData.SPWebTemplate);
                        }
                        _format = "The site template is configured to Name: {0}/ Id: {1}.";
                        _wrkr.ReportProgress(1, String.Format(_format, m_SiteCollectionHelper.SiteTemplate, m_SiteCollectionHelper.SiteTemplateID));
                        using (PackageContent _PackageContent = new PackageContent(packageContentLocation))
                        {
                            foreach (Solution _sltn in installationStateData.SolutionsToInstall.Values)
                            {
                                FileInfo _fi = _sltn.SolutionFileInfo(_PackageContent.ContentLocation);
                                _wrkr.ReportProgress(1, String.Format("Deploying solution: {0}", _fi.Name));
                                switch (_sltn.FeatureDefinitionScope)
                                {
                                case FeatureDefinitionScope.Farm:
                                    TimeSpan _timeout            = new TimeSpan(0, 0, Properties.Settings.Default.SolutionDeploymentTimeOut);
                                    string _waitingForCompletion = String.Format("Waiting for completion .... It could take up to {0} s. ", _timeout);
                                    _wrkr.ReportProgress(1, _waitingForCompletion);
                                    SPSolution _sol = null;
                                    if (_sltn.Global)
                                    {
                                        _sol = FarmHelpers.DeploySolution(_fi, _timeout);
                                    }
                                    else
                                    {
                                        _sol = FarmHelpers.DeploySolution(_fi, FarmHelpers.WebApplication, _timeout);
                                    }
                                    _sltn.SolutionGuid = _sol.Id;
                                    _wrkr.ReportProgress(1, String.Format("Solution deployed Name={0}, Deployed={1}, DeploymentState={2}, DisplayName={3} Status={4}", _sol.Name, _sol.Deployed, _sol.DeploymentState, _sol.DisplayName, _sol.Status));
                                    break;

                                case FeatureDefinitionScope.Site:
                                    SPUserSolution _solution = null;
                                    _solution          = m_SiteCollectionHelper.DeploySolution(_fi);
                                    _sltn.SolutionGuid = _solution.SolutionId;
                                    _wrkr.ReportProgress(1, String.Format("Solution deployed: {0}", _solution.Name));
                                    break;

                                case FeatureDefinitionScope.None:
                                default:
                                    throw new ApplicationException("Wrong FeatureDefinitionScope in the configuration file");
                                }
                                _sltn.Deployed = true;
                                foreach (Feature _fix in _sltn.Fetures)
                                {
                                    bool _repeat;
                                    do
                                    {
                                        _repeat = false;
                                        try
                                        {
                                            if (!_fix.AutoActivate)
                                            {
                                                _wrkr.ReportProgress(1, String.Format("Skipping activation of the feature: {0} at: {1} because tha activation is set false", _fix.FetureGuid, m_SiteCollectionHelper.SiteCollection.Url));
                                                break;
                                            }
                                            _wrkr.ReportProgress(1, String.Format("Activating Feature: {0} at: {1}", _fix.FetureGuid, m_SiteCollectionHelper.SiteCollection.Url));
                                            SPFeature _ffeature = m_SiteCollectionHelper.ActivateFeature(_fix.FetureGuid, _sltn.SPFeatureDefinitionScope);
                                            _wrkr.ReportProgress(1, String.Format("Feature activated : {0}", _ffeature.Definition.DisplayName));
                                            _fix.DisplayName = _ffeature.Definition.DisplayName;
                                            _fix.Version     = _ffeature.Version.ToString();
                                            _fix.SPScope     = _ffeature.Definition.Scope;
                                        }
                                        catch (Exception ex)
                                        {
                                            string _msg = String.Format(Properties.Resources.FeatureActivationFailureMBox, ex.Message);
                                            Tracing.TraceEvent.TraceError(516, "SetUpData.Install", _msg);
                                            switch (MessageBox.Show(_msg, "Install ActivateFeature", MessageBoxButton.YesNoCancel, MessageBoxImage.Error, MessageBoxResult.No))
                                            {
                                            case MessageBoxResult.Cancel:
                                                throw ex;

                                            case MessageBoxResult.Yes:
                                                _repeat = true;
                                                break;

                                            default:
                                                break;
                                            }
                                        }
                                    } while (_repeat);
                                }//foreach (Feature _fix in _sltn.Fetures)
                                _sltn.Activated = true;
                            }
                        } //foreach (Solution _sltn
                        //TODO installationStateData.Save();
                        _wrkr.ReportProgress(1, "Product installation successfully completed");
                    }
                }
                catch (Exception ex)
                {
                    //TODO
                    //try
                    //{
                    //  installationStateData.Save();
                    //}
                    //catch ( Exception _SaveEx )
                    //{
                    //  InstallationListBox.AddMessage( _SaveEx.Message );
                    //}
                    string _msg = String.Format(Properties.Resources.LastOperationFailedWithError, ex.Message);
                    _wrkr.ReportProgress(1, _msg);
                    throw ex;
                }
            });
        }
コード例 #17
0
 public virtual IEnumerable <T> GetVariants <T>(PackageContent currentContent) where T : VariationContent
 {
     return(GetVariants <T>(currentContent.GetEntries(_relationRepository), _languageResolver.GetPreferredCulture()));
 }
コード例 #18
0
ファイル: DataPackage.cs プロジェクト: Hooterr/Testinator2
 /// <summary>
 /// Creates a data package from the given data
 /// </summary>
 /// <param name="Type">The type of this package</param>
 /// <param name="Content">The content of this package</param>
 public DataPackage(PackageType Type, PackageContent Content)
 {
     PackageType  = Type;
     this.Content = Content;
 }
コード例 #19
0
 /// <summary>
 /// Gets the <see cref="Boilerplate.Web.Mvc.OpenGraph.OpenGraphAvailability"/> for the <param name="packageContent"></param>.
 /// </summary>
 /// <param name="packageContent">Content of the package.</param>
 /// <returns>The <see cref="Boilerplate.Web.Mvc.OpenGraph.OpenGraphAvailability"/> for the <param name="packageContent"></param>.</returns>
 private static OpenGraphAvailability GetOpenGraphAvailability(this PackageContent packageContent)
 {
     return(packageContent.GetDefaultPrice() != null
                ? OpenGraphAvailability.InStock
                : OpenGraphAvailability.OutOfStock);
 }
コード例 #20
0
 /// <summary>
 /// Gets package entries for a package
 /// </summary>
 /// <param name="packageContent">The package content</param>
 /// <returns>Collection of package entry references</returns>
 public static IEnumerable <ContentReference> GetPackageEntries(this PackageContent packageContent)
 {
     return(packageContent.GetPackageEntries(_relationRepository.Service));
 }
コード例 #21
0
 public void UpdatePackages(List <Package> packages)
 {
     PackageContent.AddPackages(packages);
 }
コード例 #22
0
        #pragma warning restore 649

        /// <summary>
        /// Gets package entries for a package
        /// </summary>
        /// <param name="packageContent">The package content</param>
        /// <param name="relationRepository">The relation repository</param>
        /// <returns>Collection of package entry references</returns>
        public static IEnumerable <ContentReference> GetPackageEntries(this PackageContent packageContent, IRelationRepository relationRepository)
        {
            return(relationRepository.GetChildren <PackageEntry>(packageContent.ContentLink).Select(r => r.Child));
        }
コード例 #23
0
ファイル: DataPackage.cs プロジェクト: Hooterr/Testinator2
 /// <summary>
 /// Creates a data package with the given type,
 /// Content is set to null by default
 /// </summary>
 /// <param name="Type">The type of this package</param>
 public DataPackage(PackageType Type)
 {
     PackageType = Type;
     Content     = null;
 }