Ejemplo n.º 1
0
        private void SaveState()
        {
            var fragment = GeProfile.Fragment;

            GeProfile.Fragment = GeProfile.Profile;
            GeProfile.GetNodeProfileText();
            NodeFragmentPosition = GeProfile.ProfileTextPostionList.GetFragmentPosition(fragment);
        }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
 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();
 }
Ejemplo n.º 4
0
        private void RestoreState()
        {
            GeProfile.Fragment = GeProfile.Profile;
            GeProfile.GetNodeProfileText();
            Fragment after;
            Fragment before;

            GeProfile.GetFragmentsAt(out before, out after, NodeFragmentPosition.Position.Offset);
            GeProfile.Fragment = after;
            GeProfile.GetNodeProfileText();
        }
Ejemplo n.º 5
0
 public ModifyProfile(GeProfile geProfile)
 {
     GeProfile = geProfile;
 }
Ejemplo n.º 6
0
 public ReplaceSelectionWithPlaceholderCommand(Text text, int selectionStart, int selectionEnd, GenDataId id, GeProfile geProfile) : base(geProfile)
 {
     Text           = text;
     SelectionStart = selectionStart;
     SelectionEnd   = selectionEnd;
     Id             = id;
     Body           = (FragmentBody)Text.Parent;
     FragmentIndex  = Body.FragmentList.IndexOf(Text) + 1;
     Prefix         = Text.TextValue.Substring(0, SelectionStart);
     Suffix         = Text.TextValue.Substring(SelectionEnd);
 }
Ejemplo n.º 7
0
 public InsertSelectionCommand(GeProfile geProfile, int position, FragmentSelection fragments)
     : base(geProfile)
 {
     Position  = position;
     Fragments = fragments;
 }
Ejemplo n.º 8
0
 public CutSelectionCommand(GeProfile geProfile, FragmentSelection fragments)
     : base(geProfile)
 {
     Fragments = fragments;
 }
Ejemplo n.º 9
0
 protected ProfileCommandBase(GeProfile geProfile)
 {
     GeProfile = geProfile;
 }
Ejemplo n.º 10
0
 public ReplacePlaceholderWithTextCommand(Placeholder placeholder, string substitutedText, GeProfile geProfile) : base(geProfile)
 {
     Placeholder     = placeholder;
     SubstitutedText = substitutedText;
     SelectionStart  = 0;
     SelectionEnd    = SubstitutedText.Length;
     Id = new GenDataId {
         ClassName = Placeholder.Class, PropertyName = Placeholder.Property
     };
 }