private string FormatMatrix(string firstValue, string spaceValue, IEnumerable <string> entries, int numPorts)
        {
            int maxDataPairs  = core.GetNumberOfDataPairsPerLine(numPorts);
            int maxNumColumns = (maxDataPairs * 2) + 1;

            ListFormat    format = core.GetListFormat(numPorts);
            StringBuilder sb     = new StringBuilder(firstValue);
            int           previousDestinationPort = 1;
            int           currentColumn           = 1;

            using var enumer = entries.GetEnumerator();

            ForEachParameter(numPorts, format, index =>
            {
                if (currentColumn == maxNumColumns ||
                    (numPorts > 2 && index.DestinationPort > previousDestinationPort))
                {
                    sb.AppendLine();
                    sb.Append(spaceValue);
                    currentColumn           = 1;
                    previousDestinationPort = index.DestinationPort;
                }

                enumer.MoveNext();
                sb.Append('\t');
                sb.Append(enumer.Current);
                enumer.MoveNext();
                sb.Append('\t');
                sb.Append(enumer.Current);
                currentColumn += 2;
            });
            return(sb.ToString());
        }
示例#2
0
        static void Classes <TTestCase>(
            IReadOnlyDictionary <string, List <TTestCase> > testCasesByAssembly,
            ListFormat format)
            where TTestCase : _ITestCaseMetadata
        {
            var testClasses =
                testCasesByAssembly
                .SelectMany(kvp => kvp.Value)
                .Where(tc => tc.TestClassName != null)
                .Select(tc => tc.TestClassNameWithNamespace)
                .Distinct()
                .OrderBy(x => x)
                .ToList();

            if (format == ListFormat.Json)
            {
                Console.WriteLine(JsonSerializer.Serialize(testClasses));
            }
            else
            {
                foreach (var testClass in testClasses)
                {
                    Console.WriteLine(testClass);
                }
            }
        }
示例#3
0
        private void CreateFromFlattenedList(IList <NetworkParameter> flattenedList, ListFormat format)
        {
            if (flattenedList == null)
            {
                throw new ArgumentNullException(nameof(flattenedList));
            }

            if (!flattenedList.Count.IsPerfectSquare(out int ports))
            {
                throw new ArgumentOutOfRangeException(nameof(flattenedList), "List must contain (num-ports) squared elements.");
            }

            NumPorts = ports;
            //parametersMatrix = new Dictionary<(int destPort, int sourcePort), NetworkParameter>();
            Matrix = DenseMatrix.Create(ports, ports, Complex.Zero);


            int i = 0;

            Utilities.ForEachParameter(NumPorts, format, index =>
            {
                int row             = index.DestinationPort - 1;
                int column          = index.SourcePort - 1;
                Matrix[row, column] = flattenedList[i];
                i++;
            });
        }
示例#4
0
 private void method_22(ListFormat A_0, bool A_1)
 {
     if (this.hybridDictionary_0 != null)
     {
         HybridDictionary dictionary = this.method_0()[A_0.CustomStyleName] as HybridDictionary;
         if (dictionary != null)
         {
             ICollection keys       = dictionary.Keys;
             IEnumerator enumerator = keys.GetEnumerator();
             int         count      = keys.Count;
             int[]       numArray   = new int[count];
             for (int i = 0; enumerator.MoveNext(); i++)
             {
                 numArray[i] = (int)enumerator.Current;
             }
             for (int j = 0; j < count; j++)
             {
                 if (A_1 || ((numArray[j] != 0) && !A_0.CurrentListStyle.Levels[numArray[j]].NoRestartByHigher))
                 {
                     dictionary[numArray[j]] = A_0.CurrentListStyle.Levels[numArray[j]].StartAt;
                 }
             }
         }
     }
 }
示例#5
0
 public ListFormat method_23()
 {
     if (this.listFormat_0 == null)
     {
         this.listFormat_0 = new ListFormat(base.Document, this);
     }
     return(this.listFormat_0);
 }
示例#6
0
        public static EcmaValue NumberFormat([This] EcmaValue thisValue, EcmaValue locales, EcmaValue options)
        {
            ListFormat           formatter        = thisValue.GetUnderlyingObject <ListFormat>();
            ICollection <string> requestedLocales = IntlUtility.CanonicalizeLocaleList(locales);

            formatter.Init(requestedLocales, new ListFormatOptions(options));
            return(thisValue);
        }
        private string FormatEntry(double frequency, NetworkParametersMatrix matrix)
        {
            string formatString = settings.NumericFormatString;

            if (string.IsNullOrEmpty(settings.NumericFormatString))
            {
                formatString = "0.00000000000E+00";
            }
            IFormatProvider provider = settings.NumericFormatProvider ?? CultureInfo.CurrentCulture.NumberFormat;

            string width = string.Empty, frequencyWidth = string.Empty;
            string columnPad = string.Empty;

            if (settings.UnifiedColumnWidth)
            {
                width          = "," + settings.ColumnWidth;
                frequencyWidth = "," + (-settings.ColumnWidth);
                columnPad      = string.Empty.PadRight(settings.ColumnWidth);
            }
            string compositeFormatString    = $"{{0{width}:{formatString}}}";
            string frequencyCompositeString = $"{{0{frequencyWidth}:{formatString}}}";

            int        numPorts = matrix.NumPorts;
            ListFormat format   = core.GetListFormat(numPorts);

            List <double> parameters = new List <double>();

            // Prepare frequency
            double scaledFrequency = frequency / Options.FrequencyUnit.GetMultiplier();

            foreach (var(_, parameter) in matrix.EnumerateParameters(format))
            {
                switch (Options.Format)
                {
                case FormatType.DecibelAngle:
                    parameters.Add(parameter.Magnitude_dB);
                    parameters.Add(parameter.Phase_deg);
                    break;

                case FormatType.MagnitudeAngle:
                    parameters.Add(parameter.Magnitude);
                    parameters.Add(parameter.Phase_deg);
                    break;

                case FormatType.RealImaginary:
                    parameters.Add(parameter.Real);
                    parameters.Add(parameter.Imaginary);
                    break;
                }
            }

            string frequencyString  = string.Format(settings.NumericFormatProvider, frequencyCompositeString, scaledFrequency);
            var    parametersString = parameters.Select(p => string.Format(settings.NumericFormatProvider, compositeFormatString, p));

            string formattedEntry = FormatMatrix(frequencyString, columnPad, parametersString, numPorts);

            return(formattedEntry);
        }
示例#8
0
        public static EcmaValue ResolvedOptions([This] EcmaValue thisValue)
        {
            ListFormat formatter = thisValue.GetUnderlyingObject <ListFormat>(); EcmaObject obj = new EcmaObject();

            obj.CreateDataPropertyOrThrow(PropertyKey.Locale, formatter.Locale);
            obj.CreateDataPropertyOrThrow(PropertyKey.Style, IntlProviderOptions.ToStringValue(formatter.Style));
            obj.CreateDataPropertyOrThrow(PropertyKey.Type, IntlProviderOptions.ToStringValue(formatter.Type));
            return(obj);
        }
示例#9
0
 public SymbolListFormatter(char delimiter, char escape = '\\')
 {
     DelimiterChar    = delimiter;
     EscapeChar       = escape;
     Delimiter        = delimiter.ToString();
     Escape           = escape.ToString();
     EscapedDelimiter = $"{Escape}{Delimiter}";
     EscapedEscape    = $"{Escape}{Escape}";
     ListFormat       = new ListFormat(delimiter, escape);
 }
示例#10
0
 public static string ManyToOne(IEnumerable <string> values, ListFormat listFormat)
 {
     using var f = listFormat.CreateFormatter();
     foreach (var value in values)
     {
         f.Append(value);
     }
     f.AppendEnd();
     return(f.OutputBuilder.ToString());
 }
示例#11
0
 protected override void BeginProcessing()
 {
     if (Property != null)
     {
         _formatDirective = new ListFormat(Property);
     }
     else
     {
         _formatDirective = new ListFormat();
     }
 }
        public static ArmyParser CreateParser(ListFormat listFormat, GameSystem gameSystem)
        {
            switch (listFormat)
            {
            case ListFormat.BattlesScribeHTML:
                return(new BattleScribeHTMLArmyParser(gameSystem));

            case ListFormat.BattleScribeRosz:
            case ListFormat.WarscrollBuilder:
            default:
                throw new ArgumentOutOfRangeException(nameof(ListFormat));
            }
        }
示例#13
0
 private void LoadRessourcesList(int nbElements, Byte[] ressourcesList)
 {
     for (int i = 0; i < nbElements; i++)
     {
         var element = new ListFormat();
         element.ressourceIndex = new byte[4];
         element.ressourceSize  = new byte[4];
         element.ressourceName  = new byte[16];
         Array.Copy(ressourcesList, i * CGeneric.sizeOfElementTable, element.ressourceSize, 0, 4);
         Array.Copy(ressourcesList, i * CGeneric.sizeOfElementTable + 4, element.ressourceIndex, 0, 4);
         Array.Copy(ressourcesList, i * CGeneric.sizeOfElementTable + 8, element.ressourceName, 0, 16);
         this.ressourcesList.Add(element);
     }
 }
示例#14
0
    private void method_8(Paragraph A_0)
    {
        int        num                     = 7;
        Class400   class2                  = this.class422_0.method_18();
        Paragraph  paragraph               = this.class422_0.method_89();
        Paragraph  paragraph2              = this.method_18();
        int        num2                    = this.method_14(A_0, paragraph, paragraph2);
        string     lFOStyleName            = A_0.ListFormat.LFOStyleName;
        ListFormat listFormatForApplyStyle = A_0.GetListFormatForApplyStyle();
        int        listLevelNumber         = listFormatForApplyStyle.ListLevelNumber;

        if (this.method_12(A_0))
        {
            string str3;
            class2.method_4(BookmarkStart.b("夬䨮䤰䜲༴嬶倸䠺䤼", num));
            string name = listFormatForApplyStyle.CurrentListStyle.Name;
            if (!this.class422_0.hashtable_1.ContainsKey(name))
            {
                str3 = this.class974_0.method_29();
                this.class422_0.hashtable_1.Add(name, str3);
            }
            else
            {
                str3 = (string)this.class422_0.hashtable_1[name];
            }
            class2.method_40(BookmarkStart.b("夬䨮䤰䜲༴䐶䴸䈺儼娾汀ⵂ⑄⩆ⱈ", num), str3);
            if (string.IsNullOrEmpty(lFOStyleName))
            {
                class2.method_40(BookmarkStart.b("夬䨮䤰䜲༴吶嘸唺䤼嘾⽀㙂⁄橆❈㹊⁌ⵎ㑐⅒㱔㥖㹘", num), BookmarkStart.b("夬崮䐰嘲", num));
            }
            class2.method_4(BookmarkStart.b("夬䨮䤰䜲༴嬶倸䠺䤼ሾ⡀㝂⁄⩆", num));
            int num4 = 0;
            while (listLevelNumber > num2)
            {
                class2.method_4(BookmarkStart.b("夬䨮䤰䜲༴嬶倸䠺䤼", num));
                class2.method_4(BookmarkStart.b("夬䨮䤰䜲༴嬶倸䠺䤼ሾ⡀㝂⁄⩆", num));
                if ((num4 == 0) && !string.IsNullOrEmpty(A_0.ListFormat.LFOStyleName))
                {
                    class2.method_43(BookmarkStart.b("夬䨮䤰䜲༴䐶䴸娺似䬾汀㕂⑄⭆㱈⹊", num), this.class422_0.method_15().ListOverrides.method_35(lFOStyleName).method_23().method_5(listLevelNumber).StartAt);
                }
                num4++;
                listLevelNumber--;
            }
        }
        if (this.method_13(A_0))
        {
            class2.method_4(BookmarkStart.b("夬䨮䤰䜲༴嬶倸䠺䤼ሾ⡀㝂⁄⩆", num));
        }
    }
示例#15
0
        public void TestListFormat()
        {
            var     currentProcess = Process.GetCurrentProcess();
            dynamic p = new PSObject(currentProcess);

            var properties         = new [] { "ProcessName", "MachineName", "Company" };
            var l                  = new ListFormat(ListEntries(properties));
            IEnumerable <string> r = FormatEngine.Format(p, l);
            var result             = r.ToArray();

            Assert.AreEqual(3, result.Length);
            var fmt = "{0,-" + properties.Max(prop => prop.Length) + "} : {1}";

            Assert.AreEqual(string.Format(fmt, "ProcessName", currentProcess.ProcessName), result[0]);
            Assert.AreEqual(string.Format(fmt, "MachineName", currentProcess.MachineName), result[1]);
            Assert.AreEqual(string.Format(fmt, "Company", p.Company), result[2]);
        }
示例#16
0
        /// <summary>
        /// List the contents of the test cases to the console, based on the provided option and format.
        /// </summary>
        public static void List <TTestCase>(
            IReadOnlyDictionary <string, List <TTestCase> > testCasesByAssembly,
            ListOption listOption,
            ListFormat listFormat)
            where TTestCase : _ITestCaseMetadata
        {
            Action <IReadOnlyDictionary <string, List <TTestCase> >, ListFormat>?lister = listOption switch
            {
                ListOption.Classes => Classes,
                ListOption.Full => Full,
                ListOption.Methods => Methods,
                ListOption.Tests => Tests,
                ListOption.Traits => Traits,
                _ => null
            };

            lister?.Invoke(testCasesByAssembly, listFormat);
        }
        public static bool IsSystemSupportedInFormat(ListFormat listFormat, GameSystem gameSystem)
        {
            List <GameSystem> supportedSystems;

            switch (listFormat)
            {
            case ListFormat.BattlesScribeHTML:
                supportedSystems = new BattleScribeHTMLArmyParser().SupportedSystems;
                break;

            case ListFormat.BattleScribeRosz:
            case ListFormat.WarscrollBuilder:
            default:
                throw new ArgumentOutOfRangeException(nameof(listFormat));
            }

            return(supportedSystems.Contains(gameSystem));
        }
示例#18
0
        private void method_76(IParagraph A_0, Paragraph A_1)
        {
            Paragraph      paragraph  = A_0 as Paragraph;
            ListFormat     listFormat = null;
            ParagraphStyle paraStyle  = paragraph.ParaStyle;

            if (paragraph.ListFormat.ListType != ListType.NoList)
            {
                listFormat = paragraph.ListFormat;
            }
            else if (paraStyle.ListFormat.ListType != ListType.NoList)
            {
                listFormat = paraStyle.ListFormat;
            }
            if ((listFormat != null) && (listFormat.CurrentListStyle != null))
            {
                ListStyle currentListStyle = listFormat.CurrentListStyle;
                int       levelNumber      = 0;
                if (paragraph.ListFormat.HasKey(0))
                {
                    levelNumber = paragraph.ListFormat.ListLevelNumber;
                }
                else if (paraStyle.ListFormat.HasKey(0))
                {
                    levelNumber = paraStyle.ListFormat.ListLevelNumber;
                }
                ListLevel nearLevel = currentListStyle.GetNearLevel(levelNumber);
                Class12   class2    = null;
                if ((listFormat.LFOStyleName != null) && (listFormat.LFOStyleName.Length > 0))
                {
                    class2 = base.Document.ListOverrides.method_35(listFormat.LFOStyleName);
                }
                if (((class2 != null) && class2.method_23().method_11(levelNumber)) && class2.method_23().method_5(levelNumber).OverrideFormatting)
                {
                    nearLevel = class2.method_23().method_5(levelNumber).OverrideListLevel;
                }
                string str = base.Document.method_132(paragraph, listFormat, nearLevel);
                if (str != string.Empty)
                {
                    this.method_77(A_0, A_1, str);
                }
            }
        }
示例#19
0
 private void method_73(ListFormat A_0)
 {
     if (((A_0.ListType != ListType.NoList) && !A_0.IsEmptyList) && (A_0.CurrentListStyle != null))
     {
         this.method_74(A_0);
     }
     else if (A_0.IsEmptyList)
     {
         if (A_0.HasKey(0))
         {
             base.method_8(SprmCode.PIlvl, A_0.ListLevelNumber);
         }
         base.method_16(SprmCode.PIlfo, 0);
     }
     else if (A_0.HasKey(0))
     {
         base.method_8(SprmCode.PIlvl, A_0.ListLevelNumber);
     }
 }
 private void method_30(Style A_0, int A_1, int A_2)
 {
     foreach (Paragraph paragraph in base.Document.GetChildElements(DocumentObjectType.Paragraph, true))
     {
         ListFormat listFormat = paragraph.ListFormat;
         if (((listFormat.ListType != ListType.NoList) && (listFormat.CurrentListStyle != null)) && (listFormat.CurrentListStyle.Istd == A_1))
         {
             if (A_2 == -1)
             {
                 listFormat.Remove(0x460);
                 listFormat.Remove(0x456);
             }
             else
             {
                 listFormat[0x460] = (A_0 as ListStyle).Istd;
             }
         }
     }
 }
示例#21
0
    public static string[] OneToMany(string value, ListFormat listFormat)
    {
        if (value == "")
        {
            return(Array.Empty <string>());
        }
        using var p = listFormat.CreateParser(value);
        var buffer = MemoryBuffer <string> .Lease(true);

        try {
            while (p.TryParseNext())
            {
                buffer.Add(p.Item);
            }
            return(buffer.ToArray());
        }
        finally {
            buffer.Release();
        }
    }
示例#22
0
 void Style.Close()
 {
     base.Close();
     if (base.m_ParaPr != null)
     {
         base.m_ParaPr.Close();
         base.m_ParaPr = null;
     }
     if (this.listFormat_0 != null)
     {
         this.listFormat_0.Close();
         this.listFormat_0 = null;
     }
     if (this.form3_0 != null)
     {
         this.form3_0.Close();
         this.form3_0 = null;
     }
     if (this.form1_0 != null)
     {
         this.form1_0.Close();
         this.form1_0 = null;
     }
     if (this.form2_0 != null)
     {
         this.form2_0.Close();
         this.form2_0 = null;
     }
     if (this.dictionary_2 != null)
     {
         foreach (KeyValuePair <ConditionalFormattingCode, Class10> pair in this.dictionary_2)
         {
             if (pair.Value != null)
             {
                 pair.Value.Close();
             }
         }
         this.dictionary_2.Clear();
         this.dictionary_2 = null;
     }
 }
示例#23
0
    private bool method_91(Class615 A_0)
    {
        Paragraph paragraph = A_0.method_8() as Paragraph;

        if (paragraph != null)
        {
            ParagraphStyle style      = paragraph.GetStyle();
            ListFormat     listFormat = null;
            if (((paragraph.ListFormat.CurrentListLevel == null) && (style != null)) && ((style.ListFormat.CurrentListLevel != null) && style.ListFormat.HasKey(0)))
            {
                listFormat = style.ListFormat;
            }
            else
            {
                listFormat = paragraph.ListFormat;
            }
            if (((listFormat != null) && (listFormat.ListType != ListType.NoList)) && (listFormat.CurrentListLevel != null))
            {
                int                 listLevelNumber;
                ListStyle           style2     = null;
                ListStyleCollection listStyles = paragraph.Document.ListStyles;
                if (((paragraph.ListFormat.CurrentListLevel == null) && (style != null)) && (style.ListFormat.CurrentListLevel != null))
                {
                    listLevelNumber = style.ListFormat.ListLevelNumber;
                    style2          = listStyles.FindByName(style.ListFormat.CustomStyleName);
                }
                else
                {
                    listLevelNumber = paragraph.ListFormat.ListLevelNumber;
                    style2          = listStyles.FindByName(paragraph.ListFormat.CustomStyleName);
                }
                if (style2.GetNearLevel(listLevelNumber).NumberPosition == 0f)
                {
                    return(!(paragraph.Format.FirstLineIndent == 0f));
                }
                return(true);
            }
        }
        return(false);
    }
示例#24
0
    private void method_74(ListFormat A_0)
    {
        int    num  = 15;
        string name = null;

        if (A_0.OwnerParagraph != null)
        {
            name = A_0.OwnerParagraph.StyleName;
        }
        int num2 = A_0.Document.ListStyles.method_8(A_0, true);

        if ((name != null) && !A_0.OwnerParagraph.Format.HasListReference)
        {
            Document       document = A_0.OwnerParagraph.Document;
            ParagraphStyle style    = document.Styles.FindByName(name, StyleType.ParagraphStyle) as ParagraphStyle;
            if (style.ListIndex == -1)
            {
                ListStyle style2 = A_0.OwnerParagraph.Document.ListStyles.FindByName(A_0.CustomStyleName);
                style.ListIndex = num2;
                document.Styles.method_6(style);
                if (style2.Levels.Count > 1)
                {
                    style.ListLevel = A_0.ListLevelNumber;
                }
                name = name.Replace(BookmarkStart.b("ᔴ", num), "");
                style2.Levels[A_0.ListLevelNumber].ParaStyleName = name;
            }
        }
        else
        {
            if (A_0.HasKey(0))
            {
                base.method_8(SprmCode.PIlvl, A_0.ListLevelNumber);
            }
            if (A_0.HasKey(1))
            {
                base.method_16(SprmCode.PIlfo, num2);
            }
        }
    }
示例#25
0
    protected void method_15(IParagraph A_0)
    {
        int        num = 3;
        ListFormat listFormatForApplyStyle = (A_0 as Paragraph).GetListFormatForApplyStyle();

        if (listFormatForApplyStyle.CurrentListStyle != null)
        {
            if ((listFormatForApplyStyle.CurrentListStyle.ListType == ListType.Bulleted) || ((listFormatForApplyStyle.CurrentListLevel != null) && (listFormatForApplyStyle.CurrentListLevel.PatternType == ListPatternType.Bullet)))
            {
                if (this.bool_0)
                {
                    this.string_0 = this.string_0 + BookmarkStart.b("̨ପ", num);
                }
                else
                {
                    this.textWriter_0.Write(BookmarkStart.b("̨ପ", num));
                }
            }
            else if (listFormatForApplyStyle.CurrentListStyle.ListType != ListType.NoList)
            {
                if (listFormatForApplyStyle.IsRestartNumbering)
                {
                    this.method_22(listFormatForApplyStyle, true);
                }
                else if (listFormatForApplyStyle.ListLevelNumber == 0)
                {
                    this.method_22(listFormatForApplyStyle, false);
                }
                if (this.bool_0)
                {
                    this.string_0 = this.string_0 + (A_0 as Paragraph).ListText + BookmarkStart.b("नପ", num);
                }
                else
                {
                    this.textWriter_0.Write((A_0 as Paragraph).ListText + BookmarkStart.b("नପ", num));
                }
            }
        }
    }
示例#26
0
    private int method_21(ListFormat A_0)
    {
        HybridDictionary dictionary = this.method_0()[A_0.CustomStyleName] as HybridDictionary;

        if (dictionary == null)
        {
            HybridDictionary dictionary2 = new HybridDictionary();
            this.method_0().Add(A_0.CustomStyleName, dictionary2);
            ListLevel level = A_0.CurrentListStyle.Levels[A_0.ListLevelNumber];
            dictionary2.Add(A_0.ListLevelNumber, level.StartAt + 1);
            return(level.StartAt - 1);
        }
        if (dictionary[A_0.ListLevelNumber] != null)
        {
            int num = (int)dictionary[A_0.ListLevelNumber];
            dictionary[A_0.ListLevelNumber] = num + 1;
            return(num - 1);
        }
        ListLevel level2 = A_0.CurrentListStyle.Levels[A_0.ListLevelNumber];

        dictionary.Add(A_0.ListLevelNumber, level2.StartAt + 1);
        return(level2.StartAt - 1);
    }
示例#27
0
        static void Tests <TTestCase>(
            IReadOnlyDictionary <string, List <TTestCase> > testCasesByAssembly,
            ListFormat format)
            where TTestCase : _ITestCaseMetadata
        {
            var displayNames =
                testCasesByAssembly
                .SelectMany(kvp => kvp.Value)
                .Select(tc => tc.TestCaseDisplayName)
                .OrderBy(x => x)
                .ToList();

            if (format == ListFormat.Json)
            {
                Console.WriteLine(JsonSerializer.Serialize(displayNames));
            }
            else
            {
                foreach (var displayName in displayNames)
                {
                    Console.WriteLine(displayName);
                }
            }
        }
示例#28
0
        static void Full <TTestCase>(
            IReadOnlyDictionary <string, List <TTestCase> > testCasesByAssembly,
            ListFormat format)
            where TTestCase : _ITestCaseMetadata
        {
            var fullTestCases =
                testCasesByAssembly
                .SelectMany(kvp => kvp.Value.Select(tc => new { assemblyFileName = kvp.Key, testCase = tc }))
                .Select(tuple => new
            {
                Assembly    = tuple.assemblyFileName,
                DisplayName = tuple.testCase.TestCaseDisplayName,
                Class       = tuple.testCase.TestClassNameWithNamespace,
                Method      = tuple.testCase.TestMethodName,
                Skip        = tuple.testCase.SkipReason,
                Traits      = tuple.testCase.Traits.Count > 0 ? tuple.testCase.Traits : null,
            })
                .OrderBy(x => x.Assembly)
                .ThenBy(x => x.DisplayName);

            var jsonOptions = new JsonSerializerOptions {
                WriteIndented = format == ListFormat.Text, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
            };

            if (format == ListFormat.Json)
            {
                Console.WriteLine(JsonSerializer.Serialize(fullTestCases, jsonOptions));
            }
            else
            {
                foreach (var testCase in fullTestCases)
                {
                    Console.WriteLine(JsonSerializer.Serialize(testCase, jsonOptions));
                }
            }
        }
示例#29
0
 private string GenerateList(int count, string conjunction, ListFormat format, string separator = ",")
 {
     return(Names.Take(count).ToTextList(conjunction, format, separator));
 }
示例#30
0
 private void method_110()
 {
     if (!this.paragraph_0.ListFormat.IsEmptyList && (!this.paragraph_0.SectionEndMark || !string.IsNullOrEmpty(this.paragraph_0.Text)))
     {
         ListFormat     listFormatForApplyStyle = this.paragraph_0.GetListFormatForApplyStyle();
         ParagraphStyle paraStyle = this.paragraph_0.ParaStyle;
         if ((listFormatForApplyStyle != null) && (listFormatForApplyStyle.CurrentListStyle != null))
         {
             ListStyle currentListStyle = listFormatForApplyStyle.CurrentListStyle;
             base.method_14(0);
             if (listFormatForApplyStyle.HasKey(0))
             {
                 base.method_14(listFormatForApplyStyle.ListLevelNumber);
             }
             ListLevel overrideListLevel = (currentListStyle.Levels.Count > 0) ? currentListStyle.GetNearLevel(base.method_13()) : null;
             if (overrideListLevel != null)
             {
                 Class12 class2 = null;
                 if ((listFormatForApplyStyle.LFOStyleName != null) && (listFormatForApplyStyle.LFOStyleName.Length > 0))
                 {
                     class2 = (this.method_108() as Document).ListOverrides.method_35(listFormatForApplyStyle.LFOStyleName);
                 }
                 if (((class2 != null) && class2.method_23().method_11(base.method_13())) && class2.method_23().method_5(base.method_13()).OverrideFormatting)
                 {
                     overrideListLevel = class2.method_23().method_5(base.method_13()).OverrideListLevel;
                 }
                 if ((currentListStyle.ListType == ListType.Numbered) || (currentListStyle.ListType == ListType.Bulleted))
                 {
                     if (overrideListLevel.ParagraphFormat.HasKey(0x488))
                     {
                         base.Interface22.imethod_1().method_1((double)overrideListLevel.ParagraphFormat.LeftIndent);
                     }
                     if (((this.paragraph_0.ListFormat.ListType == ListType.NoList) && !this.paragraph_0.ListFormat.HasKey(1)) && (paraStyle.ParagraphFormat.HasKey(0x488) || ((paraStyle.ParagraphFormat.LeftIndent != 0f) && (paraStyle.ParagraphFormat.LeftIndent != overrideListLevel.ParagraphFormat.LeftIndent))))
                     {
                         base.Interface22.imethod_1().method_1((double)paraStyle.ParagraphFormat.LeftIndent);
                     }
                     else if ((((this.paragraph_0.ListFormat.ListType != ListType.NoList) && !this.paragraph_0.ListFormat.HasKey(1)) && paraStyle.ListFormat.HasKey(1)) && (paraStyle.ParagraphFormat.HasKey(0x488) || !overrideListLevel.ParagraphFormat.HasKey(0x488)))
                     {
                         base.Interface22.imethod_1().method_1((double)paraStyle.ParagraphFormat.LeftIndent);
                     }
                     if (this.paragraph_0.Format.HasKey(0x488))
                     {
                         base.Interface22.imethod_1().method_1((double)this.paragraph_0.Format.LeftIndent);
                     }
                     if (overrideListLevel.ParagraphFormat.HasKey(0x492))
                     {
                         base.method_20(overrideListLevel.ParagraphFormat.FirstLineIndent);
                     }
                     if (((this.paragraph_0.ListFormat.ListType == ListType.NoList) && !this.paragraph_0.ListFormat.HasKey(1)) && (paraStyle.ParagraphFormat.HasKey(0x492) || ((paraStyle.ParagraphFormat.FirstLineIndent != 0f) && (paraStyle.ParagraphFormat.FirstLineIndent != overrideListLevel.ParagraphFormat.FirstLineIndent))))
                     {
                         base.method_20(paraStyle.ParagraphFormat.FirstLineIndent);
                     }
                     else if ((((this.paragraph_0.ListFormat.ListType != ListType.NoList) && !this.paragraph_0.ListFormat.HasKey(1)) && paraStyle.ListFormat.HasKey(1)) && (paraStyle.ParagraphFormat.HasKey(0x492) || !overrideListLevel.ParagraphFormat.HasKey(0x492)))
                     {
                         base.method_20(paraStyle.ParagraphFormat.FirstLineIndent);
                     }
                     if (this.paragraph_0.Format.HasKey(0x492))
                     {
                         base.method_20(this.paragraph_0.Format.FirstLineIndent);
                     }
                     if (((base.method_19() < 0f) && (base.Interface22.imethod_1().method_0() == 0.0)) && (!this.paragraph_0.Format.HasValue(0x488) && !paraStyle.ParagraphFormat.HasValue(0x488)))
                     {
                         base.Interface22.imethod_1().method_1((double)Math.Abs(base.method_19()));
                     }
                 }
                 base.method_72(new CharacterFormat(this.method_108()));
                 this.method_114(overrideListLevel.CharacterFormat, base.method_71());
                 base.method_71().ApplyBase(this.paragraph_0.BreakCharacterFormat);
                 base.method_66((this.method_108() as Document).method_133(this.paragraph_0, listFormatForApplyStyle, overrideListLevel, (LocaleIDs)base.method_71().LocaleIdASCII));
                 this.paragraph_0.ListText = base.method_65();
                 base.method_68(Class57.smethod_9(base.method_65()));
                 if (!overrideListLevel.IsEmptyPicture && (overrideListLevel.PicBullet != null))
                 {
                     base.method_46(true);
                     base.method_80(overrideListLevel.PicBullet);
                 }
                 if (overrideListLevel.FollowCharacter == FollowCharacterType.Tab)
                 {
                     this.method_112(overrideListLevel);
                 }
                 else
                 {
                     this.method_111(overrideListLevel);
                 }
                 base.method_76(overrideListLevel.NumberAlignment);
             }
             if ((((overrideListLevel.StartAt == 0) && (currentListStyle.ListType == ListType.Numbered)) && (string.IsNullOrEmpty(overrideListLevel.LevelText) && string.IsNullOrEmpty(overrideListLevel.NumberPrefix))) && (string.IsNullOrEmpty(overrideListLevel.NumberPrefix) && string.IsNullOrEmpty(overrideListLevel.BulletCharacter)))
             {
                 base.method_66(string.Empty);
             }
             listFormatForApplyStyle.Close();
         }
     }
 }
 private static void ApplyListTemplate(ListGallery listGallery, ListFormat listFormat, int level = 1)
 {
     listFormat.ApplyListTemplateWithLevel(
         listGallery.ListTemplates[level],
         ContinuePreviousList: true,
         ApplyTo: WdListApplyTo.wdListApplyToSelection,
         DefaultListBehavior: WdDefaultListBehavior.wdWord10ListBehavior,
         ApplyLevel: level);
 }