static void ValidateExpression(VisualBasicEditor etb) { string errorMessage; if (etb.DoValidation(new ExpressionValidationContext(etb), out errorMessage)) { etb.UpdateValidationError(errorMessage); } }
internal ExpressionValidationContext(VisualBasicEditor etb) { Update(etb); }
internal void Update(VisualBasicEditor etb) { Fx.Assert(etb.OwnerActivity != null, "Owner Activity is null"); this.EditingContext = etb.OwnerActivity.GetEditingContext(); //setup ParserContext this.ParserContext = new ParserContext(etb.OwnerActivity) { //callee is a ExpressionTextBox Instance = etb, //pass property descriptor belonging to epression's model property (if one exists) PropertyDescriptor = (null != etb.expressionModelProperty ? ((ModelPropertyImpl)etb.expressionModelProperty).PropertyDescriptor : null), }; this.ExpressionType = etb.ExpressionType; this.ValidatedExpressionText = this.ExpressionText; if (etb.expressionEditorInstance != null) { this.ExpressionText = etb.expressionEditorInstance.Text; } else if (etb.editingTextBox != null) { this.ExpressionText = etb.editingTextBox.Text; } else { this.ExpressionText = etb.Text; } this.UseLocationExpression = etb.UseLocationExpression; }
public VisualBasicEditorAutomationPeer(VisualBasicEditor owner) : base(owner) { }