RemoveTypeContainer() public méthode

public RemoveTypeContainer ( TypeContainer next_part ) : void
next_part TypeContainer
Résultat void
        public void ExecuteUndo()
        {
            if (undo_types == null)
            {
                return;
            }

            foreach (var p in undo_types)
            {
                TypeContainer current_container = p.Key;

                current_container.RemoveTypeContainer(p.Value);
            }
            undo_types = null;
        }
Exemple #2
0
        public void AddTypeContainer(TypeContainer current_container, TypeContainer tc)
        {
            if (current_container == tc)
            {
                Console.Error.WriteLine("Internal error: inserting container into itself");
                return;
            }

            if (undo_actions == null)
            {
                undo_actions = new List <Action> ();
            }

            var existing = current_container.Types.FirstOrDefault(l => l.MemberName.Basename == tc.MemberName.Basename);

            if (existing != null)
            {
                current_container.RemoveTypeContainer(existing);
                existing.NamespaceEntry.SlaveDeclSpace.RemoveTypeContainer(existing);
                undo_actions.Add(() => current_container.AddTypeContainer(existing));
            }

            undo_actions.Add(() => current_container.RemoveTypeContainer(tc));
        }
Exemple #3
0
        public void ExecuteUndo()
        {
            if (undo_types == null)
            {
                return;
            }

            foreach (Pair p in undo_types)
            {
                TypeContainer current_container = (TypeContainer)p.First;

                current_container.RemoveTypeContainer((TypeContainer)p.Second);
            }
            undo_types = null;
        }
Exemple #4
0
		public void AddTypeContainer (TypeContainer current_container, TypeContainer tc)
		{
			if (current_container == tc){
				Console.Error.WriteLine ("Internal error: inserting container into itself");
				return;
			}

			if (undo_actions == null)
				undo_actions = new List<Action> ();

			var existing = current_container.Types.FirstOrDefault (l => l.MemberName.Basename == tc.MemberName.Basename);
			if (existing != null) {
				current_container.RemoveTypeContainer (existing);
				undo_actions.Add (() => current_container.AddTypeContainer (existing));
			}

			undo_actions.Add (() => current_container.RemoveTypeContainer (tc));
		}