Beispiel #1
0
        internal static void Update_NodeSummaryContainer_NodeSourceTextContent(NodeSummaryContainer nodeSummaryContainer, TextContentCollection localCollection, TextContentCollection masterCollection)
        {
            var nodes = nodeSummaryContainer.Nodes;

            nodes.CollectionContent.RemoveAll(node => node.TechnicalSource == NodeSourceTypeTextContent);
            var textContentNodes = masterCollection.CollectionContent.Select(getNodeFromTextContent).ToArray();

            nodes.CollectionContent.AddRange(textContentNodes);

            /*
             * nodes.CollectionContent.ForEach(node =>
             * {
             *  if (node.Authors.CollectionContent.Count == 0)
             *      node.Authors.CollectionContent.Add(getShortTextObject(DefaultAuthorValue));
             *  else
             *  {
             *      var firstAuthorObject = node.Authors.CollectionContent[0];
             *      if (String.IsNullOrWhiteSpace(firstAuthorObject.Content))
             *      {
             *          firstAuthorObject.Content = DefaultAuthorValue;
             *      }
             *  }
             * });*/
            cleanUpRenderedNodes(nodes);
        }
Beispiel #2
0
        internal static void Update_NodeSummaryContainer_NodeSourceActivities(NodeSummaryContainer nodeSummaryContainer, ActivityCollection localCollection, ActivityCollection masterCollection)
        {
            const string DefaultAuthorValue = "Aalto Global Impact";
            var          nodes = nodeSummaryContainer.Nodes;

            nodes.CollectionContent.RemoveAll(node => node.TechnicalSource == NodeSourceTypeActivity);
            var activityNodes = masterCollection.CollectionContent.Select(getNodeFromActivity).ToArray();

            nodes.CollectionContent.AddRange(activityNodes);
            nodes.CollectionContent.ForEach(node =>
            {
                if (node.Authors.CollectionContent.Count == 0)
                {
                    node.Authors.CollectionContent.Add(getShortTextObject(DefaultAuthorValue));
                }
                else
                {
                    var firstAuthorObject = node.Authors.CollectionContent[0];
                    if (String.IsNullOrWhiteSpace(firstAuthorObject.Content))
                    {
                        firstAuthorObject.Content = DefaultAuthorValue;
                    }
                }
            });
            cleanUpRenderedNodes(nodes);
        }
Beispiel #3
0
        internal static void Update_NodeSummaryContainer_NodeSourceBlogs(NodeSummaryContainer nodeSummaryContainer, BlogCollection localCollection, BlogCollection masterCollection)
        {
            var nodes = nodeSummaryContainer.Nodes;

            nodes.CollectionContent.RemoveAll(node => node.TechnicalSource == NodeSourceTypeBlog);
            var blogNodes = masterCollection.CollectionContent.Select(getNodeFromBlog).ToArray();

            nodes.CollectionContent.AddRange(blogNodes);
            cleanUpRenderedNodes(nodes);
        }
Beispiel #4
0
        internal static void Update_NodeSummaryContainer_NodeSourceCategories(NodeSummaryContainer nodeSummaryContainer, CategoryCollection localCollection, CategoryCollection masterCollection)
        {
            var nodes = nodeSummaryContainer.Nodes;

            nodes.CollectionContent.RemoveAll(node => node.TechnicalSource == NodeSourceTypeCategory);

            /*
             * var usedParentCategoryIDs =
             *  masterCollection.CollectionContent.Where(cat => cat.ParentCategory != null)
             *                  .Select(cat => cat.ParentCategory.ID)
             *                  .ToArray();
             * var nodeCategories =
             *  masterCollection.CollectionContent.Where(cat => usedParentCategoryIDs.Contains(cat.ID)).ToArray();
             * */
            var nodeCategories = masterCollection.CollectionContent.Where(cat => cat.ImageData != null).ToArray();
            var categoryNodes  = nodeCategories.Select(getNodeFromCategory).ToArray();

            //var categoryNodes = masterCollection.CollectionContent.Select(getNodeFromCategory).ToArray();
            nodes.CollectionContent.AddRange(categoryNodes);
            cleanUpRenderedNodes(nodes);
        }