Mono.CSharp.TypeContainer.AddTypeContainer C# (CSharp) Method

AddTypeContainer() public method

public AddTypeContainer ( TypeContainer tc ) : TypeContainer
tc TypeContainer
return TypeContainer
		public TypeContainer AddTypeContainer (TypeContainer tc)
		{
			if (!AddMemberType (tc))
				return tc;

			if (types == null)
				types = new List<TypeContainer> ();

			types.Add (tc);
			return tc;
		}

Usage Example

Example #1
0
        public void AddTypeContainer(TypeContainer current_container, TypeDefinition tc)
        {
            if (current_container == tc)
            {
                Console.Error.WriteLine("Internal error: inserting container into itself");
                return;
            }

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

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

            undo_actions.Add(() => current_container.RemoveContainer(tc));
        }
All Usage Examples Of Mono.CSharp.TypeContainer::AddTypeContainer