ExpressionFieldCollector.cs
上传用户:husern
上传日期:2022-03-24
资源大小:534k
文件大小:2k
源码类别:

编辑器/阅读器

开发平台:

C#

  1. // -- FILE ------------------------------------------------------------------
  2. // name       : LookupCollector.cs
  3. // project    : Itenso Web User Forms
  4. // created    : Jani Giannoudis - 2008.10.30
  5. // language   : c#
  6. // environment: .NET 2.0
  7. // copyright  : (c) 2008 by Itenso GmbH, Switzerland
  8. // --------------------------------------------------------------------------
  9. using System;
  10. using System.Collections.Generic;
  11. using System.Web.UI;
  12. namespace Itenso.WebUserForms.Controls
  13. {
  14. // ------------------------------------------------------------------------
  15. public class ExpressionFieldCollector : UserFormVisitor
  16. {
  17. // ----------------------------------------------------------------------
  18. public ExpressionFieldCollector( Control startControl )
  19. : base( startControl )
  20. {
  21. } // LookupCollector
  22. // ----------------------------------------------------------------------
  23. public List<IExpressionField> ExpressionFields
  24. {
  25. get { return this.expressionFields; }
  26. } // ExpressionFields
  27. // ----------------------------------------------------------------------
  28. public void Collect()
  29. {
  30. this.expressionFields.Clear();
  31. Start();
  32. } // Collect
  33. // ----------------------------------------------------------------------
  34. public static List<IExpressionField> Collect( Control startControl )
  35. {
  36. ExpressionFieldCollector lookupFieldCollector = new ExpressionFieldCollector( startControl );
  37. lookupFieldCollector.Collect();
  38. return lookupFieldCollector.ExpressionFields;
  39. } // Collect
  40. // ----------------------------------------------------------------------
  41. protected override void VisitExpresionFormField( Control control, 
  42. IExpressionField expressionField, IUserFormHeader formHeader )
  43. {
  44. this.expressionFields.Add( expressionField );
  45. } // VisitLookupFormField
  46. // ----------------------------------------------------------------------
  47. // members
  48. private readonly List<IExpressionField> expressionFields = new List<IExpressionField>();
  49. } // class LookupCollector
  50. } // namespace Itenso.WebUserForms.Controls
  51. // -- EOF -------------------------------------------------------------------