Ejemplo n.º 1
0
        private void Database_Classes_FieldModified(object sender, FieldModifiedEventArgs e)
        {
            if (e.Action == ObjectAction.Delete)
            {
                IEnumerable <Folder> folders = from Folder f in Database.Data
                                               where (f.Group == e.Field)
                                               select f;

                foreach (Folder folder in folders)
                {
                    folder.Group = null;
                    Update(folder);
                }
            }
        }
Ejemplo n.º 2
0
        private void Database_Classes_FieldModified(object sender, FieldModifiedEventArgs e)
        {
            if (e.Action == ObjectAction.Delete)
            {
                Stack <FilterItem> removing = new Stack <FilterItem>();
                foreach (Filter filter in this.Collection)
                {
                    foreach (FilterItem item in filter.Items)
                    {
                        if (item.Field == e.Field)
                        {
                            removing.Push(item);
                        }
                    }

                    this.RemoveFilterItems(filter, removing);
                }
            }
        }
        private void Database_Classes_FieldTypeModified(object sender, FieldModifiedEventArgs e)
        {
            foreach (ObjectClass objClass in this.Database.Classes.GetHierarchyClasses(e.Field.ObjectClass, MoveDirection.Up))
            {
                foreach (ObjectData obj in this.GetData(objClass))
                {
                    this.RemoveValueData(e.Field, obj[e.Field]);

                    if (e.Field.IsDefaultProperty)
                    {
                        obj[e.Field] = e.Field.DefaultValue.Value;
                    }
                    else
                    {
                        obj[e.Field] = e.Field.GetStandardDefaultValue();
                    }

                    Update(obj);
                }
            }
        }
        private void Database_Classes_FieldModified(object sender, FieldModifiedEventArgs e)
        {
            switch (e.Action)
            {
            case ObjectAction.Add:
                foreach (ObjectData d in this.GetData(e.Field.ObjectClass))
                {
                    d.AddField(e.Field);
                    Update(d);
                }

                break;

            case ObjectAction.Delete:
                foreach (ObjectData d in this.GetData(e.Field.ObjectClass))
                {
                    this.RemoveValueData(e.Field, d[e.Field]);
                    d.RemoveField(e.Field);
                    Update(d);
                }

                break;
            }
        }