Exemple #1
0
        internal override void DeleteLinkedObjects(bool isChildOfDeleted)
        {
            // Remove any relationships this column participates in:
            UsedInRelationships.ToList().ForEach(r => r.Delete());

            if (!isChildOfDeleted)
            {
                if (Handler.CompatibilityLevel >= 1400)
                {
                    ObjectLevelSecurity.Clear();
                }

                // Remove any hierarchy levels this column is used in:
                UsedInLevels.ToList().ForEach(l => l.Delete());

                // Make sure the column is no longer used as a Sort By column:
                UsedInSortBy.ToList().ForEach(c => c.SortByColumn = null);

                // Make sure the column is no longer used in any Calculated Tables:
                foreach (var ctc in OriginForCalculatedTableColumns.ToList())
                {
                    ctc.InternalDelete();
                }
            }

            // Make sure the column is no longer used in any Variations:
            if (Handler.CompatibilityLevel >= 1400)
            {
                UsedInVariations.ToList().ForEach(v => v.Delete());
            }

            base.DeleteLinkedObjects(isChildOfDeleted);
        }
 protected override void OnPropertyChanging(string propertyName, object newValue, ref bool undoable, ref bool cancel)
 {
     if (propertyName == Properties.NAME)
     {
         // When formula fixup is enabled, we need to begin a new batch of undo operations, as this
         // name change could result in expression changes on multiple objects. We also need to
         // start a new batch, in case this column is used as an origin for a calculated table column,
         // as SourceColumn properties on CalculatedTableColumns could change.
         _originForCalculatedTableColumnsCache = OriginForCalculatedTableColumns.ToList();
         if (Handler.Settings.AutoFixup || _originForCalculatedTableColumnsCache.Count > 0)
         {
             Handler.BeginUpdate("Set Property 'Name'");
         }
     }
     base.OnPropertyChanging(propertyName, newValue, ref undoable, ref cancel);
 }