示例#1
0
        public static void QuickCleanup(this IGraphModel self)
        {
            var toRemove = self.EdgeModels.Where(e => e?.ToPort == null || e.FromPort == null).Cast <IGraphElementModel>()
                           .Concat(self.NodeModels.Where(m => m.Destroyed))
                           .ToList();

            self.DeleteElements(toRemove);
        }
示例#2
0
        public static void Repair(this IGraphModel self)
        {
            var toRemove = self.NodeModels.Where(n => n == null).Cast <IGraphElementModel>()
                           .Concat(self.StickyNoteModels.Where(s => s == null))
                           .Concat(self.PlacematModels.Where(p => p == null))
                           .Concat(self.EdgeModels.Where(e => e?.ToPort == null || e.FromPort == null))
                           .ToList();

            self.DeleteElements(toRemove);
        }