Example #1
0
        protected override object SetItems(object editValue, object[] value)
        {
            bool dirty = false;

            if (_form.DialogResult == DialogResult.Cancel)
            {
                value = _orig;
            }

            if (editValue != null)
            {
                if (!(editValue is IList))
                {
                    return(editValue);
                }
                IList list = (IList)editValue;
                list.Clear();
                for (int i = 0; i < value.Length; i++)
                {
                    Trigger trig = value[i] as Trigger;

                    if (trig != null && String.IsNullOrEmpty(trig.SQL) == false)
                    {
                        if (trig.IsDirty)
                        {
                            dirty = true;
                        }
                        trig.Name = trig.Name;
                        list.Add(trig);
                    }
                }

                if ((dirty == true || list.Count != _count) && _form.DialogResult == DialogResult.OK)
                {
                    _table.MakeDirty();
                }
            }

            return(editValue);
        }