public void SubstitutePlaceholder(TextBlock textBlock, string substitutedText, GenDataId id) { GenMultiUndoRedo multi = null; var body = textBlock.Body(); var n = body.FragmentList.Count; for (var i = n - 1; i >= 0; i--) { var text = body.FragmentList[i] as Text; if (text == null) { continue; } var t = text.TextValue; var k = t.IndexOf(substitutedText, StringComparison.Ordinal); while (k != -1 && text != null) { var command = new ReplaceSelectionWithPlaceholderCommand(text, k, k + substitutedText.Length, id, this); command.Execute(); var undoCommand = new ReplacePlaceholderWithTextCommand(command.Placeholder, substitutedText, this); (multi = multi ?? new GenMultiUndoRedo()).Add(new GenUndoRedo(undoCommand, command)); text = command.Text; t = command.Suffix; k = t.IndexOf(substitutedText, StringComparison.Ordinal); } } if (multi != null) { GeData.AddRedoUndo(multi); } GetNodeProfileText(); }
public static GeData GetDefaultGeData(bool isInDesignMode = false) { var geData = new GeData(); geData.Settings = isInDesignMode ? geData.GetDesignTimeSettings() : geData.GetDefaultSettings(); geData.ComboServer = isInDesignMode ? GetDesignTimeComboServer() : geData.GetDefaultComboServer(); geData.Profile = isInDesignMode ? geData.GetDesignTimeProfile(geData) : geData.GetDefaultProfile(geData); return(geData); }
private void AddRedoUndo(IGenCommand undoCommand, IGenCommand redoCommand) { var undoRedo = new GenUndoRedo(undoCommand, redoCommand); GeData.AddRedoUndo(undoRedo); }
public GeProfile(GeData geData) { GeData = geData; }
private IGenDataProfile GetDesignTimeProfile(GeData geData) { return(new GeProfile(geData)); }
private IGenDataProfile GetDefaultProfile(GeData geData) { return(new GeProfile(geData)); }