WmlComparerUtil.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright (c) Microsoft. All rights reserved.
  2. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  3. using System;
  4. using System.Security.Cryptography;
  5. using System.Text;
  6. namespace OpenXmlPowerTools
  7. {
  8. internal static class WmlComparerUtil
  9. {
  10. public static ComparisonUnitGroupType ComparisonUnitGroupTypeFromLocalName(string localName)
  11. {
  12. switch (localName)
  13. {
  14. case "p":
  15. return ComparisonUnitGroupType.Paragraph;
  16. case "tbl":
  17. return ComparisonUnitGroupType.Table;
  18. case "tr":
  19. return ComparisonUnitGroupType.Row;
  20. case "tc":
  21. return ComparisonUnitGroupType.Cell;
  22. case "txbxContent":
  23. return ComparisonUnitGroupType.Textbox;
  24. default:
  25. throw new ArgumentOutOfRangeException(nameof(localName),
  26. $@"Unsupported localName: '{localName}'.");
  27. }
  28. }
  29. }
  30. }