public Dependencies GetDependencyByQuestionId(Question question, Answers answers = null, string response_id = null) { Dependencies dependencies = new Dependencies(null); try { if (answers.Count > 0) { if (RecordExists("dsto_dependency", "yref_question", question.Key)) { if (!string.IsNullOrEmpty(answers.FirstOrDefault().AnswerText) && int.TryParse(answers.FirstOrDefault().AnswerText, out int n) && question.DataType.Equals(DataTypes.Numeric)) { for (int occurance = 0; occurance < int.Parse(answers.FirstOrDefault().AnswerText); occurance++) { string query = $"select * from dsto_dependency where [yref_question] = '{question.Key}' and Deleted=0"; var table = DbInfo.ExecuteSelectQuery(query); if (table.Rows.Count > 0) { foreach (DataRow row in table.Rows) { Dependency dependency = dependencies.Add(); InitDependency(dependency, row, occurance, response_id); } } } } } } else { string query = $"select * from dsto_dependency where [yref_question] = '{question.Key}' and Deleted=0"; var table = DbInfo.ExecuteSelectQuery(query); if (table.Rows.Count > 0) { foreach (DataRow row in table.Rows) { Dependency dependency = dependencies.Add(); InitDependency(dependency, row); } } } } catch (Exception ex) { throw ex; } return(dependencies); }
public Pack() { ExecutionPolicy = ExecutionPolicy.Manual; Dependencies.Add(nameof(Test)); ProcessModules = new ModuleList { new StartProcess("dotnet") .WithArgument("pack") .WithArgument("../../src/NetlifySharp/NetlifySharp.csproj", true) .WithArgument("--no-build") .WithArgument("--no-restore") .WithArgument("-o", Config.FromContext(ctx => ctx.FileSystem.GetOutputDirectory("packages").Path.FullPath), true) .WithArgument(Config.FromSetting <string>(BuildProperties)) .LogOutput(), new ReadFiles(Config.FromContext(ctx => $"{ctx.FileSystem.GetOutputDirectory("packages")}/*.nupkg")), new ExecuteIf(Config.FromContext(ctx => ctx.ContainsKey("DAVIDGLICK_CERTPASS") && ctx.FileSystem.GetRootFile("../../digicert-davidglick.pfx").Exists)) { new StartProcess("nuget") .WithArgument("sign") .WithArgument(Config.FromDocument(doc => doc.Source.FullPath), true) .WithArgument("-CertificatePath", Config.FromContext(ctx => ctx.FileSystem.GetRootFile("../../digicert-davidglick.pfx").Path.FullPath), true) .WithArgument("-CertificatePassword", Config.FromSetting <string>("DAVIDGLICK_CERTPASS"), true) .WithArgument("-Timestamper", "http://timestamp.digicert.com", true) .WithArgument("-NonInteractive") .LogOutput() } }; }
public ToolbarButton() { // HTML Id of the button AssignId = @"ExportItemList"; // Name of the Javascript Command to be fired on the button click Command = @"ExportItemList"; // Label for the button Name = Resources.ToolbarButtonName; // Tool tip for the button Title = Resources.ToolbarButtonTooltip; // Ribbon toolbar tab for the button PageId = Constants.PageIds.HomePage; // The group inside homepage tab, where we want to show the button GroupId = Constants.GroupIds.HomePage.ManageGroup; // Insert the button before "Where Used Button" InsertBefore = @"WhereUsedBtn"; // Add "ButtonGroup" resource group as a dependancy of the extension Dependencies.Add <ButtonGroup>(); // Apply the extension to Dashboard view Apply.ToView(Constants.Views.DashboardView, "DashboardToolbar"); Apply.ToView("*", "Toolbar"); }
void AddRabbitMqSources(XElement elementToUse) { if (elementToUse == null) { return; } if (Dependencies == null) { Dependencies = new List <IResourceForTree>(); } var dependenciesFromXml = from desc in elementToUse.Descendants() where (desc.Name.LocalName.Contains("DsfPublishRabbitMQActivity") || desc.Name.LocalName.Contains("DsfConsumeRabbitMQActivity")) && desc.HasAttributes select desc; var xElements = dependenciesFromXml as List <XElement> ?? dependenciesFromXml.ToList(); foreach (var element in xElements) { var resourceIdAsString = element.AttributeSafe("RabbitMQSourceResourceId"); var uniqueIdAsString = element.AttributeSafe("UniqueID"); Guid.TryParse(uniqueIdAsString, out Guid uniqueId); Guid.TryParse(resourceIdAsString, out Guid resId); var resourceForTree = Dependencies.FirstOrDefault(tree => tree.ResourceID == resId); if (resourceForTree == null) { Dependencies.Add( new ResourceForTree { ResourceID = resId, UniqueID = uniqueId, ResourceName = "", ResourceType = "RabbitMQSource" }); } } }
/// <summary> /// Registers this feature as depending on the given feature. This means that this feature won't be activated unless /// the dependant feature is active. This also causes this feature to be activated after the other feature. /// </summary> /// <param name="featureTypeName">The <see cref="Type.FullName"/> of the feature that this feature depends on.</param> protected void DependsOn(string featureTypeName) { Dependencies.Add(new List <string> { featureTypeName }); }
public PluginRibbonToolbarButton() { // The unique identifier used for the html element created. AssignId = "PublishedSummaryButton"; // The name of the command to execute when clicked Command = "PublishedSummary"; // The label of the button. Name = "Published Summary"; // The page tab to assign this extension to. See Constants.PageIds. PageId = Constants.PageIds.HomePage; // Option GroupId, put this into an existing group (not capable if using a .ascx Control) GroupId = Constants.GroupIds.HomePage.ShareGroup; // The tooltip label that will get applied. Title = "Published Summary"; // Add a dependency to the resource group that contains the files/commands that this toolbar extension will use. Dependencies.Add <PluginResourceGroup>(); // apply the extension to a specific view. Apply.ToView(Constants.Views.DashboardView, "DashboardToolbar"); }
public FeedsPipeline() { Dependencies.Add(nameof(PostsPipeline)); ProcessModules = new ModuleList( // Pull documents from other pipelines new ReplaceDocuments(Dependencies.ToArray()), // Set metadata for the feeds module new SetMetaDataItems( async(input, context) => { var post = input.AsKontent <Article>(); var html = await ParseHtml(input, context); var article = html?.GetElementsByTagName("article").FirstOrDefault()?.InnerHtml ?? ""; return(new MetadataItems { { FeedKeys.Title, post.Title }, { FeedKeys.Content, post.Description }, { FeedKeys.Description, post.Description }, { FeedKeys.Image, post.OgImage.FirstOrDefault()?.Url }, // TODO: make that a local image! { FeedKeys.Published, post.PublishDate }, { FeedKeys.Content, article } }); }), new GenerateFeeds() .WithFeedTitle("Petr Svihlik - blog") //TODO: load from Kontent .WithFeedDescription("Blog about all that matters to me - technology, life, leadership, and Developer Relations.") .WithFeedCopyright($"{DateTime.Today.Year}") ); OutputModules = new ModuleList( new WriteFiles() ); }
void IDependencyVisitor.List(ListDependency dependency) { var elements = dependency.Items.Select(instanceFor).ToArray(); var instance = new EnumerableInstance(elements); Dependencies.Add(dependency.DependencyType, instance); }
public void AddCompiledShader(ShaderCompilationTarget target, List <string> dependencyPaths, CompilationResult result) { string[] defines = new string[target.ShaderMacros.Length]; for (int i = 0; i < target.ShaderMacros.Length; ++i) { defines[i] = target.ShaderMacros[i].Name; } var sourceShader = new SourceShader { Name = target.Path + target.Stage.Extension, Defines = defines }; lock (CompiledShaders) { CompiledShaders[sourceShader] = result; TimeStamps[target.Path] = target.CurrentTimeStamp; foreach (var dependency in dependencyPaths) { TimeStamps[dependency] = File.GetLastWriteTime(dependency).Ticks; } if (!Dependencies.TryGetValue(target.Path, out HashSet <string> cacheDependencyPaths)) { cacheDependencyPaths = new HashSet <string>(); Dependencies.Add(target.Path, cacheDependencyPaths); } foreach (var dependencyPath in dependencyPaths) { cacheDependencyPaths.Add(dependencyPath); } } }
public Api() { Dependencies.Add(nameof(Code)); DependencyOf.Add(nameof(Content)); ProcessModules = new ModuleList { new ConcatDocuments(nameof(Code)), new CacheDocuments( new AnalyzeCSharp() .WhereNamespaces(ns => ns.StartsWith("Spectre.Console") && !ns.Contains("Analyzer") && !ns.Contains("Testing") && !ns.Contains("Examples")) .WherePublic(true) .WithCssClasses("code", "cs") .WithDestinationPrefix("api") .WithAssemblySymbols() .WithImplicitInheritDoc(false), new ExecuteConfig(Config.FromDocument((doc, ctx) => { // Calculate a type name to link lookup for auto linking string name = null; var kind = doc.GetString(CodeAnalysisKeys.Kind); switch (kind) { case "NamedType": name = doc.GetString(CodeAnalysisKeys.DisplayName); break; case "Method": var containingType = doc.GetDocument(CodeAnalysisKeys.ContainingType); if (containingType != null) { name = $"{containingType.GetString(CodeAnalysisKeys.DisplayName)}.{doc.GetString(CodeAnalysisKeys.DisplayName)}"; } break; } if (name != null) { var typeNameLinks = ctx.GetRequiredService <TypeNameLinks>(); typeNameLinks.Links.AddOrUpdate(WebUtility.HtmlEncode(name), ctx.GetLink(doc), (_, _) => string.Empty); } // Add metadata var metadataItems = new MetadataItems { { WebKeys.Xref, doc.GetString(CodeAnalysisKeys.CommentId) }, { WebKeys.Layout, "api/_layout.cshtml" }, { Constants.Hidden, true } }; var contentProvider = doc.ContentProvider.CloneWithMediaType(MediaTypes.Html); metadataItems.Add(WebKeys.ContentType, ContentType.Content); return(doc.Clone(metadataItems, contentProvider)); }))).WithoutSourceMapping() }; }
public ExampleSyntax() { Dependencies.Add(nameof(ExampleCode)); DependencyOf.Add(nameof(Content)); ProcessModules = new ModuleList { new ConcatDocuments(nameof(Code)), new ConcatDocuments(nameof(ExampleCode)), new CacheDocuments( new AnalyzeCSharp() .WhereNamespaces(true) .WherePublic() .WithCssClasses("code", "cs") .WithDestinationPrefix("syntax") .WithAssemblySymbols() // we need to load Spectre.Console for compiling, but we don't need to process it in Statiq .WhereNamespaces(i => !i.StartsWith("Spectre.Console")) .WithImplicitInheritDoc(false), new ExecuteConfig(Config.FromDocument((doc, _) => { // Add metadata var metadataItems = new MetadataItems { // Calculate an xref that includes a "api-" prefix to avoid collisions { WebKeys.Xref, "syntax-" + doc.GetString(CodeAnalysisKeys.CommentId) }, }; var contentProvider = doc.ContentProvider; return(doc.Clone(metadataItems, contentProvider)); }))).WithoutSourceMapping() }; }
public SerializedModuleMetadata(IModuleMetadata metadata) { Assert(metadata != null); if (metadata.Module == default || metadata.Version == default) { throw new ArgumentException("Neither the metadata's module nor its version must be the respective type's default value.", nameof(metadata)); } Module = metadata.Module; Version = metadata.Version; ReleaseDate = metadata.ReleaseDate; Name = metadata.Name; Description = metadata.Description; Author = metadata.Author; EntryAssemblyCommand = metadata.EntryAssemblyCommand; EntryAssemblyArguments = metadata.EntryAssemblyArguments; foreach (var(module, versionRange) in metadata.Dependencies) { if (Dependencies == null) { Dependencies = new Dictionary <ModuleIdentifier, ModuleVersionRange>(); } Dependencies.Add(module, versionRange); } }
public SyntaxHighlighterButton() { // The unique identifier used for the html element created. AssignId = "cm_syntaxhighlight"; // The name of the command to execute when clicked Command = "SyntaxHighlighterCommand"; // The label of the button. Name = "Enable Syntax Highlighting"; // The page tab to assign this extension to. See Constants.PageIds. PageId = Constants.PageIds.HomePage; // The tooltip label that will get applied. Title = "Enable Syntax Highlighting"; // Add a dependency to the resource group that contains the files/commands that this toolbar extension will use. Dependencies.Add <SyntaxHighlighterResourceGroup>(); // apply the extension to a specific view. Apply.ToView("TemplateBuildingBlockView", "ItemToolbar"); Apply.ToView("SchemaView", "ItemToolbar"); Apply.ToView("ComponentVew", "ItemToolbar"); Apply.ToView("ComponentTemplateView", "ItemToolbar"); Apply.ToView("PageTemplateView", "ItemToolbar"); }
public GoToLocationExtension() { // The unique identifier used for the html element created. AssignId = "RibbonToolbarGoToLocationButton"; // The name of the command to execute when clicked Command = "GoToLocationCommand"; // The label of the button. Name = "Go To Location"; // The page tab to assign this extension to. See Constants.PageIds. PageId = Constants.PageIds.HomePage; // Option GroupId, put this into an existing group GroupId = Constants.GroupIds.HomePage.ManageGroup; //GroupId = "GoToLocationGroup"; // The tooltip label that will get applied. Title = "Go To Location"; // Add a dependency to the resource group that contains the files/commands that this toolbar extension will use. Dependencies.Add <GoToLocationResouceGroup>(); // apply the extension to a specific view. Apply.ToView(Constants.Views.ComponentView); Apply.ToView(Constants.Views.PageView); Apply.ToView(Constants.Views.SchemaView); Apply.ToView(Constants.Views.ComponentTemplateView); Apply.ToView(Constants.Views.PageTemplateView); Apply.ToView("TemplateBuildingBlockView"); }
public OptionalArgumentVariable(Variable inner, ParameterInfo parameter) : base(inner.VariableType) { Inner = inner; _parameter = parameter; Dependencies.Add(Inner); }
private void PopulateDependencies(string logicalName) { var properties = TestBase.GetType(logicalName).GetProperties(); // Loop through all properties for the given entity, that define relationships foreach (var property in properties.Where(p => // Skip Properties to Ignore !PropertiesToIgnore.Contains(p.Name.ToLower()) && // Only process Properties that contain an attribute logical name, and a Relationship Schema Name p.ContainsCustomAttributeTypes(typeof(AttributeLogicalNameAttribute), typeof(RelationshipSchemaNameAttribute)))) { var attribute = property.GetAttributeLogicalName(); var propertyType = property.PropertyType.GetCustomAttribute <EntityLogicalNameAttribute>(true); if (!Dependencies.TryGetValue(propertyType.LogicalName, out EntityDependencyRelationship relationship)) { relationship = new EntityDependencyRelationship(logicalName, propertyType.LogicalName, attribute, LogicalName == propertyType.LogicalName); Dependencies.Add(propertyType.LogicalName, relationship); } else { relationship.Attributes.Add(attribute); } } PopulateHardCodedDependencies(logicalName); }
public void FindDependenciesRecursive(LayerList registryLayers) { foreach (var section in _slice.Sections.Where(s => s.SectionType == SliceSection.Type.DEP)) { foreach (var line in section.Lines) { var semName = new SemName(line); var dep = registryLayers.FindLayer(semName.NamePart); if (dep != null) { Dependencies.Add(dep); dep.FindDependenciesRecursive(registryLayers); } } } if (Dependencies.Count == 0) { foreach (var section in _slice.Sections.Where(s => s.SectionType == SliceSection.Type.OS)) { foreach (var line in section.Lines) { var semName = new SemName(line); if (semName.NamePart != Name) { var os = registryLayers.FindLayer(semName.NamePart); if (os != null) { Dependencies.Add(os); } } } } } }
public void AddDependency() { OpenFileDialog fileDialog = new OpenFileDialog(); fileDialog.InitialDirectory = System.IO.Directory.GetCurrentDirectory(); fileDialog.FileName = ""; fileDialog.RestoreDirectory = true; fileDialog.Filter = "MSI Merge Modules (*.msm)|*.msm"; fileDialog.Multiselect = true; if (fileDialog.ShowDialog() == true) { foreach (var fileName in fileDialog.FileNames) { try { var iswixDependency = new IsWiXDependency(fileName); DependencyModel dependency = new DependencyModel(); dependency.RequiredId = iswixDependency.RequiredId; dependency.RequiredLanguage = iswixDependency.RequiredLanguage; dependency.RequiredVersion = iswixDependency.RequiredVersion; _iswixDependencies.Add(iswixDependency); if (!Dependencies.Contains(dependency)) { Dependencies.Add(dependency); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } } }
public Recent() { Dependencies.Add(nameof(Issues)); ProcessModules = new ModuleList { new GenerateJson( Config.FromContext(ctx => ctx.Outputs .FromPipeline(nameof(Issues)) .SelectMany(doc => doc .GetList <Issue>("Issues") .Where(i => i.Recent) .Select(i => new { ProjectKey = doc.GetString("ProjectKey"), CreatedAt = i.CreatedAt, Link = i.Link, Title = i.Title })) .OrderByDescending(x => x.CreatedAt))) .WithCamelCase(), new MinifyJs(), new SetDestination((NormalizedPath)"data/issues/recent/all.json") }; OutputModules = new ModuleList { new WriteFiles() }; }
public override void Create() { Parts.Clear(); // Part1 if (GetPart1Dependencies() != null) { var part1 = Factory.CreateSegment(Drawing, GetPart1Dependencies()); if (part1 != null) { Parts.Add(part1); } } // Cross Part if (GetCrossPartDependencies() != null) { var crossPart = Factory.CreateCircle(Drawing, GetCrossPartDependencies()); Parts.Add(crossPart); } Dependencies.Clear(); Children.Clear(); if (Parts != null) { foreach (IFigure f in Parts) { Children.Add(f); foreach (IPoint p in f.Dependencies) { Dependencies.Add(p); } } } }
public TridionVisionRibbonToolbarButton() { // The unique identifier used for the html element created. AssignId = "TridionVisionButton"; // Using command instead of .ascx so we can position it correctly Command = "TridionVisionCommand"; // The label of the button. Name = "Auto-classify Images"; // The tooltip label that will get applied. Title = "Auto-classify Images"; // The page tab to assign this extension to. See Constants.PageIds. PageId = Constants.PageIds.HomePage; // Option GroupId, put this into an existing group GroupId = "TridionVision"; // We need to add our resource group as a dependency to this extension Dependencies.Add <TridionVisionResourceGroup>(); // apply the extension to a specific view. Apply.ToView(Constants.Views.DashboardView, "DashboardToolbar"); }
private void PopulateDependencies(IEnumerable <PropertyInfo> properties) { foreach (var property in properties.Where(p => !PropertiesToIgnore.Contains(p.Name.ToLower()))) { if (property.PropertyType == typeof(EntityReference)) { var attribute = property.GetCustomAttribute(typeof(AttributeLogicalNameAttribute)) as AttributeLogicalNameAttribute; if (attribute == null) { continue; } Dependencies.Add(attribute.LogicalName); continue; } if (!property.PropertyType.IsGenericType || property.PropertyType.GetGenericTypeDefinition() != typeof(IEnumerable <>)) { continue; } var genericTypes = property.PropertyType.GetGenericArguments(); if (genericTypes.Length != 1) { continue; } var genericType = genericTypes[0]; if (!typeof(Entity).IsAssignableFrom(genericType)) { continue; } Dependents.Add(EntityHelper.GetEntityLogicalName(genericType)); } }
private void Initialize(int currentLevel, string name, float baseValue, string iconPath, List <string> dependancies, int baseIterationCount, bool addLevelToName) { BaseValue = baseValue; Value = baseValue * currentLevel; Level = currentLevel; TmpValueKey = name; LevelKey = GetLevelKey(name); Key = TmpValueKey + currentLevel; Icon = iconPath + name + currentLevel + ".png"; if (!addLevelToName) { Icon = iconPath + name + ".png"; } IterationCount = baseIterationCount + 2 * currentLevel; if (currentLevel != 1) { Dependencies.Add(TmpValueKey + (currentLevel - 1)); } if (dependancies != null) { foreach (var dep in dependancies) { Dependencies.Add(dep); } } }
public DiscoveriesFeed() { Dependencies.Add(nameof(Discoveries)); ProcessModules = new ModuleList { new ReplaceDocuments(nameof(Discoveries)), new TakeDocuments(10), new GenerateFeeds() .WithAtomPath("feeds/discoveries.atom") .WithRssPath("feeds/discoveries.rss") .WithFeedTitle("Recent Discoveries From Discover .NET") .WithFeedDescription("A new discovery (almost) every day.") .WithItemTitle(Config.FromDocument(doc => doc.GetString("Title"))) .WithItemDescription(Config.FromDocument(doc => doc.GetString("Description"))) .WithItemPublished(Config.FromDocument(doc => (DateTime?)doc.GetDateTime("DiscoveryDate"))) .WithItemLink(Config.FromDocument((doc, ctx) => TypeHelper.Convert <Uri>(ctx.GetLink(doc.GetString("Link"), true)))) .WithItemId(Config.FromDocument((doc, ctx) => TypeHelper.Convert <Uri>(ctx.GetLink(doc.GetString("Link"), true)))) .WithItemImageLink(null) }; OutputModules = new ModuleList { new WriteFiles() }; }
public MyAssembly Add(string assemblyInfo) { var asm = new MyAssembly(assemblyInfo, this); Dependencies.Add(asm); return(asm); }
private void Read(BinaryReader br, Archive parent) { FileTableOffset = br.ReadUInt32(); FileTableSize = br.ReadUInt32(); Crc = br.ReadUInt64(); FileEntryCount = br.ReadUInt32(); FileSegmentCount = br.ReadUInt32(); ResourceDependencyCount = br.ReadUInt32(); // read tables for (int i = 0; i < FileEntryCount; i++) { var entry = new FileEntry(br, parent); if (!FileEntries.ContainsKey(entry.NameHash64)) { FileEntries.Add(entry.NameHash64, entry); } else { // TODO } } for (int i = 0; i < FileSegmentCount; i++) { FileSegments.Add(new FileSegment(br, i)); } for (int i = 0; i < ResourceDependencyCount; i++) { Dependencies.Add(new Dependency(br, i)); } }
public void CreateSkinDependency(FileItem referenceFile) { MpeCore.Classes.VersionProvider.SkinVersion skinVersion = new MpeCore.Classes.VersionProvider.SkinVersion(); DependencyItem dep; CheckSkinDependency(out dep); if (dep != null) { Dependencies.Items.Remove(dep); } dep = CreateStrictDependency(skinVersion); Version versionSkin = null; string fileName = referenceFile.LocalFileName; if (!Path.IsPathRooted(fileName)) { fileName = Path.Combine(Path.GetDirectoryName(ProjectSettings.ProjectFilename), fileName); fileName = Path.GetFullPath(fileName); } if (File.Exists(fileName)) { XmlDocument doc = new XmlDocument(); doc.Load(fileName); XmlNode node = doc.SelectSingleNode("/controls/skin/version"); if (node != null && node.InnerText != null) { versionSkin = new Version(node.InnerText); dep.MinVersion = new VersionInfo(versionSkin); dep.MaxVersion = new VersionInfo(versionSkin); } } Dependencies.Add(dep); }
public Pack() { ExecutionPolicy = ExecutionPolicy.Manual; Dependencies.Add(nameof(Build)); ProcessModules = new ModuleList { new ThrowExceptionIf(Config.ContainsSettings("DAVIDGLICK_CERTPASS").IsFalse(), "DAVIDGLICK_CERTPASS setting missing"), new ReadFiles("src/**/*.csproj"), new StartProcess("dotnet") .WithArgument("pack") .WithArgument("--no-build") .WithArgument("--no-restore") .WithArgument("-o", Config.FromContext(ctx => ctx.FileSystem.GetOutputPath().FullPath), true) .WithArgument(Config.FromDocument(doc => doc.Source.FullPath), true) .WithParallelExecution(false) .LogOutput(), new ReadFiles(Config.FromContext(ctx => ctx.FileSystem.GetOutputPath("*.nupkg").FullPath)), new StartProcess("nuget") .WithArgument("sign") .WithArgument(Config.FromDocument(doc => doc.Source.FullPath), true) .WithArgument("-CertificatePath", Config.FromContext(ctx => ctx.FileSystem.GetRootFile("davidglick.pfx").Path.FullPath), true) .WithArgument("-CertificatePassword", Config.FromSetting("DAVIDGLICK_CERTPASS"), true) .WithArgument("-Timestamper", "http://timestamp.digicert.com", true) .WithArgument("-NonInteractive") .WithParallelExecution(false) .LogOutput() }; }
protected IssuePages(TotalIssueCounts totals) { Dependencies.Add(nameof(Issues)); ProcessModules = new ModuleList { new ExecuteConfig( Config.FromContext(ctx => ctx.Outputs .FromPipeline(nameof(Issues)) .Where(doc => DocumentPredicate == null || DocumentPredicate(doc)) .SelectMany(doc => doc .GetList <Issue>("Issues") .Where(i => IssuePredicate == null || IssuePredicate(i)) .Select(i => new PagedIssue(i, doc))) .OrderByDescending(x => x.CreatedAt) .Partition(24, count => SetTotal(count, totals)) .Select(x => ctx.CreateDocument(new MetadataItems { { "Page", x.Key }, { "Issues", x.ToList() } })))), new GenerateJson(Config.FromDocument(doc => doc["Issues"])) .WithCamelCase(), new MinifyJs(), new SetDestination(Destination) }; OutputModules = new ModuleList { new WriteFiles() }; }
private void AddDotnetSources(XElement elementToUse) { if (elementToUse == null) { return; } if (Dependencies == null) { Dependencies = new List <IResourceForTree>(); } var dependenciesFromXml = from desc in elementToUse.Descendants() where (desc.Name.LocalName.Contains("DsfEnhancedDotNetDllActivity")) && desc.HasAttributes select desc; var xElements = dependenciesFromXml as List <XElement> ?? dependenciesFromXml.ToList(); foreach (var element in xElements) { var resourceIdAsString = element.AttributeSafe("SourceId"); var resourceName = element.AttributeSafe("ResourceName"); var actionTypeStr = element.AttributeSafe("Type"); var resourceType = GetResourceTypeFromString(actionTypeStr); Guid resId; Guid.TryParse(resourceIdAsString, out resId); var resourceForTree = Dependencies.FirstOrDefault(tree => tree.ResourceID == resId); if (resourceForTree == null) { Dependencies.Add(CreateResourceForTree(resId, Guid.Empty, resourceName, resourceType)); } } }