Esempio n. 1
0
    public bool ShowRot(IWpfTextView atv)
    {
      Contract.Assume(atv != null);

      string testString;
      var caret = atv.Caret.Position.BufferPosition.Position;
      var tra = new TacticReplacerActor(atv.TextBuffer, caret);
      if (tra.LoadStatus != TacticReplaceStatus.Success) return Util.NotifyOfReplacement(tra.LoadStatus);
      var status = tra.ExpandSingleTacticCall(caret, out testString);
      if (status != TacticReplaceStatus.Success)
        return Util.NotifyOfReplacement(status);
      
      _pb.TriggerPeekSession(new PeekSessionCreationOptions(atv, RotPeekRelationship.SName, null, 0, false, null, false));
      return Util.NotifyOfReplacement(TacticReplaceStatus.Success);
    }
Esempio n. 2
0
 public static string GetExpandedForRot(int position, ITextBuffer tb)
 {
   Contract.Assume(tb != null);
   string fullMethod;
   var tra = new TacticReplacerActor(tb, position);
   return tra.ExpandSingleTacticCall(position, out fullMethod)==TacticReplaceStatus.Success ? fullMethod : null;
   //var splitMethod = fullMethod.Split('\n');
   //return splitMethod.Where((t, i) => i >= 2 && i <= splitMethod.Length - 3).Aggregate("", (current, t) => current + t + "\n");
 }