Beispiel #1
0
 protected override void SetValue(object value, bool validated)
 {
     if ((base.m_Value != value) && ((base.m_Value == null) || !base.m_Value.Equals(value)))
     {
         if (!validated)
         {
             ValidatingEventArgs e = new ValidatingEventArgs(this, value, this.FormatValue(value), false);
             this.OnValidating(this, e);
             if (!e.Cancel)
             {
                 base.m_Value = e.NewValue;
                 this.UpdatePosition(base.m_Value, this.ValueMember);
                 if (this.SelectedIndex == -1)
                 {
                     base.m_Text = e.NewText;
                 }
                 if (base.Parent != null)
                 {
                     base.Parent.UpdateData(this);
                 }
                 if (((base.Parent != null) && !base.DisableRefresh) && base.Parent.AutoRefresh)
                 {
                     base.Parent.Invalidate();
                 }
                 this.OnChanged(this, new ItemEventArgs());
             }
         }
         if (((this.EditControl != null) && (this.SelectedIndex == -1)) && (this.EditControl.Text != base.m_Text))
         {
             this.EditControl.Text = base.m_Text;
         }
     }
 }
Beispiel #2
0
 protected override void SetText(string text, bool validated)
 {
     if (base.m_Text != text)
     {
         if (!validated)
         {
             ValidatingEventArgs e = new ValidatingEventArgs(this, this.Parse(text), text, false);
             this.OnValidating(this, e);
             if (!e.Cancel)
             {
                 base.m_Text = e.NewText;
                 this.UpdatePosition(base.m_Text, this.DisplayMember);
                 if (this.SelectedIndex == -1)
                 {
                     base.m_Value = e.NewValue;
                 }
                 if (base.Parent != null)
                 {
                     base.Parent.UpdateData(this);
                 }
                 if (((base.Parent != null) && !base.DisableRefresh) && base.Parent.AutoRefresh)
                 {
                     base.Parent.Invalidate();
                 }
                 this.OnChanged(this, new ItemEventArgs());
             }
         }
         if (((this.EditControl != null) && (this.SelectedIndex == -1)) && (this.EditControl.Text != base.m_Text))
         {
             this.EditControl.Text = base.m_Text;
         }
     }
 }
Beispiel #3
0
 protected virtual void OnItemValidating(object sender, ValidatingEventArgs e)
 {
     IsEventRunning = true;
     if (this.ItemValidating != null)
     {
         this.ItemValidating(this, e);
     }
     IsEventRunning = false;
 }
 protected override void SetValue(object value, bool validated)
 {
     if ((base.m_Value != value) && ((base.m_Value == null) || !base.m_Value.Equals(value)))
     {
         if (!validated)
         {
             ValidatingEventArgs e = new ValidatingEventArgs(this, value, this.FormatValue(value), false);
             this.OnValidating(this, e);
             if (!e.Cancel)
             {
                 base.m_Value = e.NewValue;
                 this.UpdatePosition(base.m_Value, this.ValueMember);
                 if (this.SelectedIndex == -1)
                 {
                     base.m_Text = e.NewText;
                 }
                 if (base.Parent != null)
                 {
                     base.Parent.UpdateData(this);
                 }
                 if (((base.Parent != null) && !base.DisableRefresh) && base.Parent.AutoRefresh)
                 {
                     base.Parent.Invalidate();
                 }
                 this.OnChanged(this, new ItemEventArgs());
             }
         }
         if (((this.EditControl != null) && (this.SelectedIndex == -1)) && (this.EditControl.Text != base.m_Text))
         {
             this.EditControl.Text = base.m_Text;
         }
     }
 }
 protected override void SetText(string text, bool validated)
 {
     if (base.m_Text != text)
     {
         if (!validated)
         {
             ValidatingEventArgs e = new ValidatingEventArgs(this, this.Parse(text), text, false);
             this.OnValidating(this, e);
             if (!e.Cancel)
             {
                 base.m_Text = e.NewText;
                 this.UpdatePosition(base.m_Text, this.DisplayMember);
                 if (this.SelectedIndex == -1)
                 {
                     base.m_Value = e.NewValue;
                 }
                 if (base.Parent != null)
                 {
                     base.Parent.UpdateData(this);
                 }
                 if (((base.Parent != null) && !base.DisableRefresh) && base.Parent.AutoRefresh)
                 {
                     base.Parent.Invalidate();
                 }
                 this.OnChanged(this, new ItemEventArgs());
             }
         }
         if (((this.EditControl != null) && (this.SelectedIndex == -1)) && (this.EditControl.Text != base.m_Text))
         {
             this.EditControl.Text = base.m_Text;
         }
     }
 }
Beispiel #6
0
 protected virtual void SetValue(object value, bool validated)
 {
     if ((this.m_Value != value) && ((this.m_Value == null) || !this.m_Value.Equals(value)))
     {
         if (!validated)
         {
             ValidatingEventArgs e = new ValidatingEventArgs(this, value, this.FormatValue(value), false);
             this.OnValidating(this, e);
             if (e.Cancel)
             {
                 this.UpdateControl(this.EditValue);
                 return;
             }
             this.m_Value = e.NewValue;
             this.SetText(e.NewText, true);
         }
         else
         {
             this.m_Value = value;
         }
         this.UpdateControl(this.EditValue);
         if (this.Parent != null)
         {
             this.Parent.UpdateData(this);
             if (!this.DisableRefresh && this.Parent.AutoRefresh)
             {
                 this.Parent.Invalidate();
             }
         }
         this.OnPropertyChanged();
         this.OnChanged(this, new ItemEventArgs());
     }
 }
Beispiel #7
0
 protected virtual void SetText(string text, bool validated)
 {
     if (this.m_Text != text)
     {
         if (!validated)
         {
             ValidatingEventArgs e = new ValidatingEventArgs(this, this.Parse(text), text, true);
             this.OnValidating(this, e);
             if (e.Cancel)
             {
                 this.UpdateControl(this.EditValue);
                 return;
             }
             this.m_Text = e.NewText;
             this.SetValue(e.NewValue, true);
         }
         else
         {
             this.m_Text = text;
         }
         this.OnPropertyChanged();
     }
 }
Beispiel #8
0
 protected virtual void OnValidating(object sender, ValidatingEventArgs e)
 {
     if (!this.DisableEvents)
     {
         this.m_bValidating = true;
         if (this.Validating != null)
         {
             this.Validating(sender, e);
         }
         this.m_bValidating = false;
     }
 }