コード例 #1
0
        public void RemoveEnum(EnumDescription @enum)
        {
            Contract.Requires(@enum != null);

            var refrences = GetEnumReferences(@enum).ToList();

            if (refrences.Any())
            {
                throw new EnumReferencedException(@enum, refrences.Select(e => e.GetParentClass()).Distinct());
            }

            if (enums.Remove(@enum))
            {
                EnumRemoved?.Invoke(@enum);
            }
        }
コード例 #2
0
        public void Clear()
        {
            var temp = classes.ToList();

            classes.Clear();

            foreach (var node in temp)
            {
                node.NodesChanged -= NodesChanged_Handler;

                ClassRemoved?.Invoke(node);
            }

            var temp2 = enums.ToList();

            enums.Clear();

            foreach (var @enum in temp2)
            {
                EnumRemoved?.Invoke(@enum);
            }
        }