Example #1
0
        private void AllCustomFieldDefs_ListChanged(object sender,
                                                    ListChangedEventArgs e)
        {
            // If we have dirty custom fields we'll need to preserve those values.
            RobotList <OrgCustomField> mydefs = OrgCustomField.GetOrgCustomFields(this);

            foreach (OrgCustomField new_cf in mydefs)
            {
                OrgCustomField old_cf = m_customFields.Find(
                    delegate(OrgCustomField checkObj, int id)
                {
                    return(checkObj.Def.Id == id);
                }, new_cf.Def.Id);

                if (old_cf == null)
                {
                    continue;
                }

                new_cf.Value = old_cf.Value;
            }

            m_customFields = mydefs;
            NotifyPropertyChanged("CustomFields");
        }