public void CutSelection(FragmentSelection fragments)
 {
     Contract.Requires(GeProfile.IsSelectable(fragments.Start, fragments.End, false));
     Contract.Ensures(GeProfile.IsInputable(fragments.Start));
     SaveState();
     NewProfile = GeProfile.ProfileText.Substring(0, fragments.Start) + GeProfile.ProfileText.Substring(fragments.End);
     ChangeProfile();
     RestoreState();
 }
 public void InsertSelection(int position, FragmentSelection fragments)
 {
     Contract.Requires(GeProfile.IsInputable(position));
     Contract.Ensures(GeProfile.IsSelectable(position, position + fragments.ProfileText.Length, false));
     SaveState();
     NewProfile = GeProfile.ProfileText.Insert(NodeFragmentPosition.Position.Offset + position,
                                               fragments.ProfileText);
     ChangeProfile();
     RestoreState();
 }