ValidateExceptSame.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Collections.ObjectModel;
  5. using System.Runtime.CompilerServices;
  6. using Microsoft.VisualBasic.CompilerServices;
  7. namespace PCL
  8. {
  9. // Token: 0x02000149 RID: 329
  10. public class ValidateExceptSame : Validate
  11. {
  12. // Token: 0x06000D88 RID: 3464 RVA: 0x00008AA2 File Offset: 0x00006CA2
  13. [CompilerGenerated]
  14. public Collection<string> ComputeClient()
  15. {
  16. return this._ImporterTests;
  17. }
  18. // Token: 0x06000D89 RID: 3465 RVA: 0x00008AAA File Offset: 0x00006CAA
  19. [CompilerGenerated]
  20. public void IncludeClient(Collection<string> AutoPropertyValue)
  21. {
  22. this._ImporterTests = AutoPropertyValue;
  23. }
  24. // Token: 0x06000D8A RID: 3466 RVA: 0x00008AB3 File Offset: 0x00006CB3
  25. [CompilerGenerated]
  26. public string SortClient()
  27. {
  28. return this.m_WorkerTests;
  29. }
  30. // Token: 0x06000D8B RID: 3467 RVA: 0x00008ABB File Offset: 0x00006CBB
  31. [CompilerGenerated]
  32. public void InvokeClient(string AutoPropertyValue)
  33. {
  34. this.m_WorkerTests = AutoPropertyValue;
  35. }
  36. // Token: 0x06000D8C RID: 3468 RVA: 0x00008AC4 File Offset: 0x00006CC4
  37. [CompilerGenerated]
  38. public bool DestroyClient()
  39. {
  40. return this.connectionTests;
  41. }
  42. // Token: 0x06000D8D RID: 3469 RVA: 0x00008ACC File Offset: 0x00006CCC
  43. [CompilerGenerated]
  44. public void PrepareClient(bool AutoPropertyValue)
  45. {
  46. this.connectionTests = AutoPropertyValue;
  47. }
  48. // Token: 0x06000D8E RID: 3470 RVA: 0x00008AD5 File Offset: 0x00006CD5
  49. public ValidateExceptSame()
  50. {
  51. this.IncludeClient(new Collection<string>());
  52. this.PrepareClient(false);
  53. }
  54. // Token: 0x06000D8F RID: 3471 RVA: 0x00008AF0 File Offset: 0x00006CF0
  55. public ValidateExceptSame(Collection<string> Excepts, string ErrorMessage = "输入内容不能为 %!", bool IgnoreCase = false)
  56. {
  57. this.IncludeClient(new Collection<string>());
  58. this.PrepareClient(false);
  59. this.IncludeClient(Excepts);
  60. this.InvokeClient(ErrorMessage);
  61. this.PrepareClient(IgnoreCase);
  62. }
  63. // Token: 0x06000D90 RID: 3472 RVA: 0x0005BAD0 File Offset: 0x00059CD0
  64. public ValidateExceptSame(IEnumerable Excepts, string ErrorMessage = "输入内容不能为 %!", bool IgnoreCase = false)
  65. {
  66. this.IncludeClient(new Collection<string>());
  67. this.PrepareClient(false);
  68. this.IncludeClient(new Collection<string>());
  69. try
  70. {
  71. foreach (object value in Excepts)
  72. {
  73. string item = Conversions.ToString(value);
  74. this.ComputeClient().Add(item);
  75. }
  76. }
  77. finally
  78. {
  79. IEnumerator enumerator;
  80. if (enumerator is IDisposable)
  81. {
  82. (enumerator as IDisposable).Dispose();
  83. }
  84. }
  85. this.InvokeClient(ErrorMessage);
  86. this.PrepareClient(IgnoreCase);
  87. }
  88. // Token: 0x06000D91 RID: 3473 RVA: 0x0005BB60 File Offset: 0x00059D60
  89. public override string Validate(string Str)
  90. {
  91. string result;
  92. if (Str == null)
  93. {
  94. result = this.SortClient().Replace("%", "null");
  95. }
  96. else
  97. {
  98. try
  99. {
  100. foreach (string text in this.ComputeClient())
  101. {
  102. if (this.DestroyClient())
  103. {
  104. if (Operators.CompareString(Str.ToLower(), text.ToLower(), false) == 0)
  105. {
  106. return this.SortClient().Replace("%", text);
  107. }
  108. }
  109. else if (Str.Equals(text))
  110. {
  111. return this.SortClient().Replace("%", text);
  112. }
  113. }
  114. }
  115. finally
  116. {
  117. IEnumerator<string> enumerator;
  118. if (enumerator != null)
  119. {
  120. enumerator.Dispose();
  121. }
  122. }
  123. result = "";
  124. }
  125. return result;
  126. }
  127. // Token: 0x0400070D RID: 1805
  128. [CompilerGenerated]
  129. private Collection<string> _ImporterTests;
  130. // Token: 0x0400070E RID: 1806
  131. [CompilerGenerated]
  132. private string m_WorkerTests;
  133. // Token: 0x0400070F RID: 1807
  134. [CompilerGenerated]
  135. private bool connectionTests;
  136. }
  137. }