internal ActionConfigurationResolved( int index, IReadOnlyList<string> path, ActionConfiguration a ) { _index = index; _path = path; _action = a; _fullName = String.Join( "/", path.Append( a.Name ) ); }
internal ActionCompositeConfigurationResolved( IActivityMonitor monitor, int index, IReadOnlyList<string> path, ActionCompositeConfiguration a, bool flattenUselessComposite ) : base( index, path, a ) { _isParallel = a.IsParallel; _children = new List<ActionConfigurationResolved>(); AppendChildren( monitor, a, path.Append( a.Name ).ToArray(), flattenUselessComposite ); }
internal ActionConfigurationResolved(int index, IReadOnlyList <string> path, ActionConfiguration a) { _index = index; _path = path; _action = a; _fullName = String.Join("/", path.Append(a.Name)); }
public void RunIteratorTests(IReadOnlyList <int> source) { var a = source.Append(1000); var b = a.Prepend(1001); var c = b.Append(1002); var d = c.Append(1003); var e = d.Prepend(1004); var f = e.Prepend(1005); Assert.Equal(a.Count, source.Count + 1); Assert.Equal(b.Count, source.Count + 2); Assert.Equal(c.Count, source.Count + 3); Assert.Equal(d.Count, source.Count + 4); Assert.Equal(e.Count, source.Count + 5); Assert.Equal(f.Count, source.Count + 6); var runner = new IteratorTests(); runner.RunTests(a); runner.RunTests(b); runner.RunTests(c); runner.RunTests(d); runner.RunTests(e); runner.RunTests(f); }
public IEnumerable <(IReadOnlyList <string> Segments, T Data)> Enumerate(IReadOnlyList <string> segments) { foreach (var kvp in datas) { yield return(segments.Append(kvp.Key), kvp.Value); } foreach (var kvp in children) { var childPrefix = segments.Append(kvp.Key); foreach (var element in kvp.Value.Enumerate(childPrefix)) { yield return(element); } } }
private CaddyfileBuilder WithProxy(string proxyType, string path, IPEndPoint endPoint) { return(new CaddyfileBuilder( listenUrls.Append($"{proxyType} {path} {endPoint.Address}:{endPoint.Port}"), directives )); }
internal ActionCompositeConfigurationResolved(IActivityMonitor monitor, int index, IReadOnlyList <string> path, ActionCompositeConfiguration a, bool flattenUselessComposite) : base(index, path, a) { _isParallel = a.IsParallel; _children = new List <ActionConfigurationResolved>(); AppendChildren(monitor, a, path.Append(a.Name).ToArray(), flattenUselessComposite); }
private IParser <UntranslatedStatParserParameter> CreateUntranslatedStatParser( IReadOnlyList <string> translationFileNames) { var translators = translationFileNames .Append(StatTranslationFileNames.Custom) .Select(s => _statTranslators[s]) .ToList(); var composite = new CompositeStatTranslator(translators); return(Caching(new UntranslatedStatParser(composite, _coreParser))); }
void AppendChildren( IActivityMonitor monitor, ActionCompositeConfiguration a, IReadOnlyList<string> childPath, bool flattenUselessComposite ) { foreach( var child in a.Children ) { ActionCompositeConfiguration composite = child as ActionCompositeConfiguration; if( flattenUselessComposite && composite != null && composite.IsParallel == a.IsParallel ) { AppendChildren( monitor, composite, childPath = childPath.Append( composite.Name ).ToArray(), true ); } else _children.Add( ActionConfigurationResolved.Create( monitor, child, flattenUselessComposite, _children.Count, childPath ) ); } }
void AppendChildren(IActivityMonitor monitor, ActionCompositeConfiguration a, IReadOnlyList <string> childPath, bool flattenUselessComposite) { foreach (var child in a.Children) { ActionCompositeConfiguration composite = child as ActionCompositeConfiguration; if (flattenUselessComposite && composite != null && composite.IsParallel == a.IsParallel) { AppendChildren(monitor, composite, childPath = childPath.Append(composite.Name).ToArray(), true); } else { _children.Add(ActionConfigurationResolved.Create(monitor, child, flattenUselessComposite, _children.Count, childPath)); } } }
public LBALogEntry(IReadOnlyList <string> words, IReadOnlyList <string> dirs) { EntryType = (Type)Enum.Parse(typeof(Type), words[0], true); Name = words[1]; if (EntryType == Type.End) { return; } Length = Int32.Parse(words[2]); LBA = Int32.Parse(words[3]); TimeCode = words[4]; Bytes = Int32.Parse(words[5]); if (EntryType != Type.Dir) { SourceFile = words[6]; } FullPath = $"\\{String.Join("\\", dirs.Append(Name))}"; }
public MailBuilder AddCopyTo(string receiver) => new MailBuilder(Subject, CopyTo.Append(receiver));
protected override IReadOnlyDictionary <Skill, ValueBuilder> Parse(Skill activeSkill, IReadOnlyList <Skill> supportingSkills) => supportingSkills.Append(activeSkill).ToDictionary(s => s, Parse);
public IConditionBuilder Or(IConditionBuilder condition) => new OrCompositeConditionBuilder(Conditions.Append(condition).ToList());
public void Append() { var result1 = m_source.Append(5); Assert.IsTrue(result1.SequenceEqual(new[] { 0, 1, 2, 3, 4, 5 })); }
public BindingPath Append(string propertyName) { return(new BindingPath(_path.Append(propertyName).ToArray())); }