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

编辑器/阅读器

开发平台:

C#

  1. // -- FILE ------------------------------------------------------------------
  2. // name       : ExpressionFieldDesigner.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.Drawing;
  11. namespace Itenso.WebUserForms.Controls
  12. {
  13. // ------------------------------------------------------------------------
  14. public class ExpressionFieldDesigner : UserFormFieldDesigner
  15. {
  16. // ----------------------------------------------------------------------
  17. public ExpressionFieldDesigner()
  18. {
  19. } // ExpressionFieldDesigner
  20. // ----------------------------------------------------------------------
  21. protected Color MissingFieldExpressionColor
  22. {
  23. get { return this.missingFieldExpressionColor; }
  24. set { this.missingFieldExpressionColor = value; }
  25. } // MissingFieldExpressionColor
  26. // ----------------------------------------------------------------------
  27. protected string FieldExpression
  28. {
  29. get
  30. {
  31. IExpressionField expressionField = base.Component as IExpressionField;
  32. if ( expressionField == null )
  33. {
  34. throw new InvalidOperationException( "IExpressionField required" );
  35. }
  36. return expressionField.FieldExpression;
  37. }
  38. } // FieldExpression
  39. // ----------------------------------------------------------------------
  40. protected bool HasFieldExpression
  41. {
  42. get { return !string.IsNullOrEmpty( FieldExpression ); }
  43. } // HasFieldExpression
  44. // ----------------------------------------------------------------------
  45. protected override Color GetStatusColor()
  46. {
  47. if ( !HasFieldExpression )
  48. {
  49. return MissingFieldExpressionColor;
  50. }
  51. return base.GetStatusColor();
  52. } // GetStatusColor
  53. // ----------------------------------------------------------------------
  54. // members
  55. private Color missingFieldExpressionColor = Color.LightCyan;
  56. } // class ExpressionFieldDesigner
  57. } // namespace Itenso.WebUserForms.Controls
  58. // -- EOF -------------------------------------------------------------------