コード例 #1
0
 internal ActionConfigurationResolved( int index, IReadOnlyList<string> path, ActionConfiguration a )
 {
     _index = index;
     _path = path;
     _action = a;
     _fullName = String.Join( "/", path.Append( a.Name ) );
 }
コード例 #2
0
 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 );
 }
コード例 #3
0
 internal ActionConfigurationResolved(int index, IReadOnlyList <string> path, ActionConfiguration a)
 {
     _index    = index;
     _path     = path;
     _action   = a;
     _fullName = String.Join("/", path.Append(a.Name));
 }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
                }
            }
        }
コード例 #6
0
 private CaddyfileBuilder WithProxy(string proxyType, string path, IPEndPoint endPoint)
 {
     return(new CaddyfileBuilder(
                listenUrls.Append($"{proxyType} {path} {endPoint.Address}:{endPoint.Port}"),
                directives
                ));
 }
コード例 #7
0
 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);
 }
コード例 #8
0
        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)));
        }
コード例 #9
0
 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 ) );
     }
 }
コード例 #10
0
 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));
         }
     }
 }
コード例 #11
0
ファイル: R1_PS1_Manager.cs プロジェクト: PluMGMK/Ray1Map
            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))}";
            }
コード例 #12
0
 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);
コード例 #14
0
 public IConditionBuilder Or(IConditionBuilder condition) =>
 new OrCompositeConditionBuilder(Conditions.Append(condition).ToList());
コード例 #15
0
        public void Append()
        {
            var result1 = m_source.Append(5);

            Assert.IsTrue(result1.SequenceEqual(new[] { 0, 1, 2, 3, 4, 5 }));
        }
コード例 #16
0
 public BindingPath Append(string propertyName)
 {
     return(new BindingPath(_path.Append(propertyName).ToArray()));
 }