InsertObject() public method

public InsertObject ( int index, ObjectType type ) : void
index int
type ObjectType
return void
示例#1
0
        protected void OnAddButtonClicked(object sender, EventArgs e)
        {
            if (ObjectGroup == null)
            {
                return;
            }

            AddObjectDialog d = new AddObjectDialog();

            d.Run();
            if (d.ObjectTypeToAdd != ObjectType.End)
            {
                if (ObjectGroup == null)
                {
                    return;
                }

                ObjectGroup.InsertObject(indexSpinButton.ValueAsInt + 1, d.ObjectTypeToAdd);
                UpdateBoundaries();
                indexSpinButton.Value = indexSpinButton.ValueAsInt + 1;
            }
        }