public static void PasteDemo() { #region radspreadsheet-clipboard-support_1 Workbook workbook = new Workbook(); Worksheet worksheet = workbook.Worksheets.Add(); worksheet.Cells[0, 0].SetValue("=CONCATENATE(\"Rad\", \"Spreadsheet\")"); worksheet.Cells[0, 0].SetForeColor(new ThemableColor(Colors.Green)); WorksheetFragment worksheetFragment = worksheet.Cells[0, 0].Copy(); PasteOptions pasteOptions = new PasteOptions(PasteType.All); worksheet.Cells[1, 0].Paste(worksheetFragment, pasteOptions); #endregion #region radspreadsheet-clipboard-support_2 PasteOptions pasteOptionsValues = new PasteOptions(PasteType.Values); worksheet.Cells[2, 0].Paste(worksheetFragment, pasteOptionsValues); #endregion #region radspreadsheet-clipboard-support_3 PasteOptions valuesAndFormatting = new PasteOptions(PasteType.Formulas | PasteType.Formats); worksheet.Cells[3, 0].Paste(worksheetFragment, valuesAndFormatting); #endregion }
// Geometry pasted public override void OnPasteEnd(PasteOptions options) { if (tagExplorer != null) { tagExplorer.UpdateTreeSoon(); } }
// Geometry pasted public override void OnPasteEnd(PasteOptions options) { if (dockerpanel != null) { dockerpanel.UpdateListSoon(); } }
// This pastes a prefab. Returns false when paste was cancelled. public void InsertPrefabStream(Stream stream, PasteOptions options) { // Cancel volatile mode General.Editing.DisengageVolatileMode(); // Let the plugins know if (General.Plugins.OnPasteBegin(options)) { // Ask the editing mode to prepare selection for pasting. if (General.Editing.Mode.OnPasteBegin(options)) { Cursor oldcursor = Cursor.Current; Cursor.Current = Cursors.WaitCursor; if (stream != null) { PastePrefab(stream, options); } General.MainWindow.UpdateInterface(); Cursor.Current = oldcursor; } } }
public void OnPasteEnd(PasteOptions options) { foreach (Plugin p in plugins) { p.Plug.OnPasteEnd(options.Copy()); } }
// Constructor public PasteOptionsForm() { InitializeComponent(); // Get defaults options = General.Settings.PasteOptions.Copy(); pasteoptions.Setup(options); }
// This sets the options from the given PasteOptions public void Setup(PasteOptions options) { // Setup controls keeptags.Checked = (options.ChangeTags == 0); renumbertags.Checked = (options.ChangeTags == 1); removetags.Checked = (options.ChangeTags == 2); removeactions.Checked = options.RemoveActions; }
// This sets the options from the given PasteOptions public void Setup(PasteOptions options) { // Setup controls keeptags.Checked = (options.ChangeTags == 0); renumbertags.Checked = (options.ChangeTags == 1); removetags.Checked = (options.ChangeTags == 2); adjustheights.Checked = options.AdjustHeights; }
public void InsertPreviousPrefab() { PasteOptions options = General.Settings.PasteOptions.Copy(); // Is there a previously inserted prefab? if (IsPreviousPrefabAvailable) { // Does the file still exist? if (File.Exists(lastprefabfile)) { // Cancel volatile mode General.Editing.DisengageVolatileMode(); // Let the plugins know if (General.Plugins.OnPasteBegin(options)) { // Ask the editing mode to prepare selection for pasting. if (General.Editing.Mode.OnPasteBegin(options)) { Cursor oldcursor = Cursor.Current; FileStream stream = null; try { Cursor.Current = Cursors.WaitCursor; stream = File.OpenRead(lastprefabfile); } catch (Exception e) { Cursor.Current = oldcursor; General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while reading prefab from file: " + e.Message); General.WriteLog(e.StackTrace); General.ShowErrorMessage("Error while reading prefab from file! See log file for error details.", MessageBoxButtons.OK); } if (stream != null) { PastePrefab(stream, options); } stream.Dispose(); General.MainWindow.UpdateInterface(); Cursor.Current = oldcursor; } } } else { General.MessageBeep(MessageBeepType.Warning); lastprefabfile = null; General.MainWindow.UpdateInterface(); } } else { General.MessageBeep(MessageBeepType.Warning); } }
// This pastes a prefab. Returns false when paste was cancelled. internal void PastePrefab(Stream filedata, PasteOptions options) { // Create undo General.MainWindow.DisplayStatus(StatusType.Action, "Inserted prefab."); General.Map.UndoRedo.CreateUndo("Insert prefab"); // Decompress stream MemoryStream decompressed = new MemoryStream((int)filedata.Length * 3); filedata.Seek(0, SeekOrigin.Begin); BZip2.Decompress(filedata, decompressed); MemoryStream memstream = new MemoryStream(decompressed.ToArray()); decompressed.Dispose(); // Mark all current geometry General.Map.Map.ClearAllMarks(true); // Read data stream UniversalStreamReader reader = new UniversalStreamReader(); reader.StrictChecking = false; General.Map.Map.BeginAddRemove(); reader.Read(General.Map.Map, memstream); General.Map.Map.EndAddRemove(); // The new geometry is not marked, so invert the marks to get it marked General.Map.Map.InvertAllMarks(); // Convert UDMF fields back to flags and activations, if needed if (!(General.Map.FormatInterface is UniversalMapSetIO)) { General.Map.Map.TranslateFromUDMF(); } // Modify tags and actions if preferred if (options.ChangeTags == PasteOptions.TAGS_REMOVE) { Tools.RemoveMarkedTags(); } if (options.ChangeTags == PasteOptions.TAGS_RENUMBER) { Tools.RenumberMarkedTags(); } if (options.RemoveActions) { Tools.RemoveMarkedActions(); } // Done memstream.Dispose(); General.Map.Map.UpdateConfiguration(); General.Map.ThingsFilter.Update(); General.Editing.Mode.OnPasteEnd(options); General.Plugins.OnPasteEnd(options); }
public bool OnPasteBegin(PasteOptions options) { bool result = true; foreach (Plugin p in plugins) { result &= p.Plug.OnPasteBegin(options.Copy(), result); } return(result); }
// This is called when something was pasted. public override void OnPasteEnd(PasteOptions options) { General.Map.Map.ClearAllSelected(); General.Map.Map.SelectMarkedGeometry(true, true); // Switch to EditSelectionMode //EditSelectionMode editmode = new EditSelectionMode(); //editmode.Pasting = true; //editmode.PasteOptions = options; General.Editing.ChangeMode("EditSelectionMode"); }
public void InsertPrefabFile() { PasteOptions options = General.Settings.PasteOptions.Copy(); // Cancel volatile mode General.Editing.DisengageVolatileMode(); // Let the plugins know if (General.Plugins.OnPasteBegin(options)) { // Ask the editing mode to prepare selection for pasting. if (General.Editing.Mode.OnPasteBegin(options)) { Cursor oldcursor = Cursor.Current; OpenFileDialog openfile = new OpenFileDialog(); openfile.Filter = "Doom Builder Prefabs (*.dbprefab)|*.dbprefab"; openfile.Title = "Open Prefab"; openfile.AddExtension = false; openfile.CheckFileExists = true; openfile.Multiselect = false; openfile.ValidateNames = true; if (openfile.ShowDialog(General.MainWindow) == DialogResult.OK) { FileStream stream = null; try { Cursor.Current = Cursors.WaitCursor; stream = File.OpenRead(openfile.FileName); } catch (Exception e) { Cursor.Current = oldcursor; General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while reading prefab from file: " + e.Message); General.WriteLog(e.StackTrace); General.ShowErrorMessage("Error while reading prefab from file! See log file for error details.", MessageBoxButtons.OK); } if (stream != null) { PastePrefab(stream, options); lastprefabfile = openfile.FileName; } General.MainWindow.UpdateInterface(); stream.Dispose(); } Cursor.Current = oldcursor; } } }
public void PasteCode(EditPoint objEditPt, string code, PasteOptions pasteOption) { switch (pasteOption) { case PasteOptions.Overwrite: objEditPt.Delete(code.Length); break; case PasteOptions.Append: objEditPt.EndOfDocument(); break; } objEditPt.Insert(code); }
// This is called when something was pasted. public override void OnPasteEnd(PasteOptions options) { General.Map.Map.ClearAllSelected(); General.Map.Map.SelectMarkedGeometry(true, true); General.Map.Renderer2D.UpdateExtraFloorFlag(); //mxd // Switch to EditSelectionMode EditSelectionMode editmode = new EditSelectionMode(); editmode.Pasting = true; editmode.PasteOptions = options; General.Editing.ChangeMode(editmode); }
public void Paste(int line, string text, PasteOptions option) { var objEditPt = TextDocument.CreateEditPoint(); objEditPt.MoveToLineAndOffset(line, 1); objEditPt.Insert(text); switch (option) { case PasteOptions.Overwrite: var textLines = text.Split('\n').Count(textline => textline != ""); var textSelection = TextDocument.Selection; textSelection.MoveTo(line + textLines, 1); textSelection.LineDown(true, textLines); textSelection.Delete(); break; } }
// This returns the options as set by the user public PasteOptions GetOptions() { PasteOptions options = new PasteOptions(); // Collect settings if (keeptags.Checked) { options.ChangeTags = 0; } else if (renumbertags.Checked) { options.ChangeTags = 1; } else if (removetags.Checked) { options.ChangeTags = 2; } options.RemoveActions = removeactions.Checked; return(options); }
// This returns the options as set by the user public PasteOptions GetOptions() { PasteOptions options = new PasteOptions(); // Collect settings if (keeptags.Checked) { options.ChangeTags = 0; } else if (renumbertags.Checked) { options.ChangeTags = 1; } else if (removetags.Checked) { options.ChangeTags = 2; } options.AdjustHeights = adjustheights.Checked; return(options); }
public static void Main() { // For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET // The path to the documents directory. //Source directory string sourceDir = RunExamples.Get_SourceDirectory(); //Output directory string outputDir = RunExamples.Get_OutputDirectory(); // Load sample excel file Workbook wb = new Workbook(sourceDir + "SamplePasteOptions.xlsx"); // Access the first sheet which contains chart Worksheet source = wb.Worksheets[0]; // Add another sheet named DestSheet Worksheet destination = wb.Worksheets.Add("DestSheet"); // Set CopyOptions.ReferToDestinationSheet to true CopyOptions options = new CopyOptions(); options.ReferToDestinationSheet = true; // Set PasteOptions PasteOptions pasteOptions = new PasteOptions(); pasteOptions.PasteType = PasteType.Values; pasteOptions.OnlyVisibleCells = true; // Copy all the rows of source worksheet to destination worksheet which includes chart as well // The chart data source will now refer to DestSheet destination.Cells.CopyRows(source.Cells, 0, 0, source.Cells.MaxDisplayRange.RowCount, options, pasteOptions); // Save workbook in xlsx format wb.Save(outputDir + "outputSamplePasteOptions.xlsx", SaveFormat.Xlsx); Console.WriteLine("PastingRowsColumnsWithPasteOptions executed successfully.\r\n"); }
public static void Run() { // ExStart:GetRowHeightsOfSourceRangeToDestinationRange // The path to the documents directory. string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); // Create workbook object Workbook workbook = new Workbook(); // Source worksheet Worksheet srcSheet = workbook.Worksheets[0]; // Add destination worksheet Worksheet dstSheet = workbook.Worksheets.Add("Destination Sheet"); // Set the row height of the 4th row. This row height will be copied to destination range srcSheet.Cells.SetRowHeight(3, 50); // Create source range to be copied Range srcRange = srcSheet.Cells.CreateRange("A1:D10"); // Create destination range in destination worksheet Range dstRange = dstSheet.Cells.CreateRange("A1:D10"); // PasteOptions, we want to copy row heights of source range to destination range PasteOptions opts = new PasteOptions(); opts.PasteType = PasteType.RowHeights; // Copy source range to destination range with paste options dstRange.Copy(srcRange, opts); // Write informative message in cell D4 of destination worksheet dstSheet.Cells["D4"].PutValue("Row heights of source range copied to destination range"); // Save the workbook in xlsx format workbook.Save(dataDir + "output_out.xlsx", SaveFormat.Xlsx); // ExEnd:GetRowHeightsOfSourceRangeToDestinationRange }
// Geometry pasted public override void OnPasteEnd(PasteOptions options) { if (portalexplorer != null) portalexplorer.UpdateTreeSoon(); }
// This is called when pasting begins public override bool OnPasteBegin(PasteOptions options) { // These modes support pasting return(true); }
// This performs the paste. Returns false when paste was cancelled. private bool DoPasteSelection(PasteOptions options) { // Check if possible to copy/paste if (General.Editing.Mode.Attributes.AllowCopyPaste) { // Anything to paste? if (Clipboard.ContainsData(CLIPBOARD_DATA_FORMAT)) { // Cancel volatile mode General.Editing.DisengageVolatileMode(); // Let the plugins know if (General.Plugins.OnPasteBegin(options)) { // Ask the editing mode to prepare selection for pasting. if (General.Editing.Mode.OnPasteBegin(options.Copy())) { // Create undo General.MainWindow.DisplayStatus(StatusType.Action, "Pasted selected elements."); General.Map.UndoRedo.CreateUndo("Paste"); // Read from clipboard Stream memstream = (Stream)Clipboard.GetData(CLIPBOARD_DATA_FORMAT); memstream.Seek(0, SeekOrigin.Begin); // Mark all current geometry General.Map.Map.ClearAllMarks(true); // Read data stream UniversalStreamReader reader = new UniversalStreamReader(); reader.StrictChecking = false; General.Map.Map.BeginAddRemove(); reader.Read(General.Map.Map, memstream); General.Map.Map.EndAddRemove(); // The new geometry is not marked, so invert the marks to get it marked General.Map.Map.InvertAllMarks(); // Convert UDMF fields back to flags and activations, if needed if (!(General.Map.FormatInterface is UniversalMapSetIO)) { General.Map.Map.TranslateFromUDMF(); } // Modify tags and actions if preferred if (options.ChangeTags == PasteOptions.TAGS_REMOVE) { Tools.RemoveMarkedTags(); } if (options.ChangeTags == PasteOptions.TAGS_RENUMBER) { Tools.RenumberMarkedTags(); } if (options.RemoveActions) { Tools.RemoveMarkedActions(); } // Clean up memstream.Dispose(); // Check if anything was pasted int totalpasted = General.Map.Map.GetMarkedThings(true).Count; totalpasted += General.Map.Map.GetMarkedVertices(true).Count; totalpasted += General.Map.Map.GetMarkedLinedefs(true).Count; totalpasted += General.Map.Map.GetMarkedSidedefs(true).Count; totalpasted += General.Map.Map.GetMarkedSectors(true).Count; if (totalpasted > 0) { General.Map.Map.UpdateConfiguration(); General.Map.ThingsFilter.Update(); General.Editing.Mode.OnPasteEnd(options.Copy()); General.Plugins.OnPasteEnd(options); } return(true); } } // Aborted return(false); } else { // Nothing usefull on the clipboard General.MessageBeep(MessageBeepType.Warning); return(false); } } else { // Paste not allowed General.MessageBeep(MessageBeepType.Warning); return(false); } }
public void Paste(int line, PasteOptions option) { Paste(line, Selection.Text, option); }
async Task ExecutePasteAsync(PasteOptions opts) { var data = await GetDataAsync(opts.Format); Console.Write(data); }
// Called after new geometry has been pasted in. The new geometry is marked. public virtual void OnPasteEnd(PasteOptions options) { }
// Called before pasting. Override this and return true to indicate that paste is allowed to contiue. public virtual bool OnPasteBegin(PasteOptions options) { return(false); }
// Paste clicked private void paste_Click(object sender, EventArgs e) { options = pasteoptions.GetOptions(); this.DialogResult = DialogResult.OK; this.Close(); }
public override bool OnPasteBegin(PasteOptions options) { if (copyslopevertexgroups == null || copyslopevertexgroups.Count == 0) { return(false); } // Unselect all slope vertices, so the pasted vertices can be selected foreach (SlopeVertexGroup svg in BuilderPlug.Me.SlopeVertexGroups) { svg.SelectVertices(false); } float l = copyslopevertexgroups[0].Vertices[0].Pos.x; float r = copyslopevertexgroups[0].Vertices[0].Pos.x; float t = copyslopevertexgroups[0].Vertices[0].Pos.y; float b = copyslopevertexgroups[0].Vertices[0].Pos.y; // Find the outer dimensions of all SVGs to paste foreach (SlopeVertexGroup svg in copyslopevertexgroups) { foreach (SlopeVertex sv in svg.Vertices) { if (sv.Pos.x < l) { l = sv.Pos.x; } if (sv.Pos.x > r) { r = sv.Pos.x; } if (sv.Pos.y > t) { t = sv.Pos.y; } if (sv.Pos.y < b) { b = sv.Pos.y; } } } Vector2D center = new Vector2D(l + ((r - l) / 2), b + ((t - b) / 2)); Vector2D diff = center - General.Map.Grid.SnappedToGrid(mousemappos); foreach (SlopeVertexGroup svg in copyslopevertexgroups) { int id; List <SlopeVertex> newsv = new List <SlopeVertex>(); foreach (SlopeVertex sv in svg.Vertices) { newsv.Add(new SlopeVertex(new Vector2D(sv.Pos.x - diff.x, sv.Pos.y - diff.y), sv.Z)); } SlopeVertexGroup newsvg = BuilderPlug.Me.AddSlopeVertexGroup(newsv, out id); newsvg.SelectVertices(true); } // Redraw the display, so that pasted SVGs are shown immediately General.Interface.RedrawDisplay(); // Don't go into the standard process for pasting, so tell the core that // pasting should not proceed return(false); }
public void InsertPrefabFile() { // Check if possible to copy/paste if (General.Editing.Mode.Attributes.AllowCopyPaste) { PasteOptions options = General.Settings.PasteOptions.Copy(); // Cancel volatile mode General.Editing.DisengageVolatileMode(); // Let the plugins know if (General.Plugins.OnPasteBegin(options)) { // Ask the editing mode to prepare selection for pasting. if (General.Editing.Mode.OnPasteBegin(options)) { Cursor oldcursor = Cursor.Current; OpenFileDialog openfile = new OpenFileDialog(); // ano - we remember locations for different things separately // so we have to keep track of it ourselves string initial_directory = General.Settings.ReadSetting("prefabinitialdirectory", ""); if (Directory.Exists(initial_directory)) { openfile.InitialDirectory = initial_directory; } openfile.Filter = "Doom Builder Prefabs (*.dbprefab)|*.dbprefab"; openfile.Title = "Open Prefab"; openfile.AddExtension = false; openfile.CheckFileExists = true; openfile.Multiselect = false; openfile.ValidateNames = true; if (openfile.ShowDialog(General.MainWindow) == DialogResult.OK) { FileStream stream = null; try { Cursor.Current = Cursors.WaitCursor; stream = File.OpenRead(openfile.FileName); // ano - save initial directory ourselves General.Settings.WriteSetting("prefabinitialdirectory", Path.GetDirectoryName(openfile.FileName)); } catch (Exception e) { Cursor.Current = oldcursor; General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while reading prefab from file: " + e.Message); Logger.WriteLogLine(e.StackTrace); General.ShowErrorMessage("Error while reading prefab from file! See log file for error details.", MessageBoxButtons.OK); } if (stream != null) { PastePrefab(stream, options); lastprefabfile = openfile.FileName; } General.MainWindow.UpdateInterface(); stream.Dispose(); } Cursor.Current = oldcursor; } } } else { // Insert not allowed General.MessageBeep(MessageBeepType.Warning); } }
// This pastes a prefab. Returns false when paste was cancelled. internal void PastePrefab(Stream filedata, PasteOptions options) { // Create undo General.MainWindow.DisplayStatus(StatusType.Action, "Inserted prefab."); General.Map.UndoRedo.CreateUndo("Insert prefab"); // Decompress stream MemoryStream memstream; //mxd try { memstream = Data.SharpCompressHelper.DecompressStream(filedata); //mxd memstream.Seek(0, SeekOrigin.Begin); } catch (Exception e) { General.ErrorLogger.Add(ErrorType.Error, e.GetType().Name + " while reading prefab from file: " + e.Message); Logger.WriteLogLine(e.StackTrace); General.ShowErrorMessage("Unable to load prefab. See log file for error details.", MessageBoxButtons.OK); return; } // Mark all current geometry General.Map.Map.ClearAllMarks(true); // Read data stream UniversalStreamReader reader = new UniversalStreamReader(); reader.StrictChecking = false; General.Map.Map.BeginAddRemove(); reader.Read(General.Map.Map, memstream); General.Map.Map.EndAddRemove(); // The new geometry is not marked, so invert the marks to get it marked General.Map.Map.InvertAllMarks(); // Convert UDMF fields back to flags and activations, if needed if (!(General.Map.FormatInterface is UniversalMapSetIO)) { General.Map.Map.TranslateFromUDMF(); } // Modify tags and actions if preferred if (options.ChangeTags == PasteOptions.TAGS_REMOVE) { Tools.RemoveMarkedTags(); } if (options.ChangeTags == PasteOptions.TAGS_RENUMBER) { Tools.RenumberMarkedTags(); } if (options.RemoveActions) { Tools.RemoveMarkedActions(); } // Done memstream.Dispose(); General.Map.Map.UpdateConfiguration(); General.Map.ThingsFilter.Update(); General.Editing.Mode.OnPasteEnd(options); General.Plugins.OnPasteEnd(options); }
// This performs the paste. Returns false when paste was cancelled. private static void DoPasteSelection(PasteOptions options) { // Check if possible to copy/paste if (General.Editing.Mode.Attributes.AllowCopyPaste) { bool havepastedata = Clipboard.ContainsData(CLIPBOARD_DATA_FORMAT); //mxd bool havedb2pastedata = Clipboard.ContainsData(CLIPBOARD_DATA_FORMAT_DB2); //mxd // Anything to paste? if (havepastedata || havedb2pastedata) { // Cancel volatile mode General.Editing.DisengageVolatileMode(); // Let the plugins know if (General.Plugins.OnPasteBegin(options)) { // Ask the editing mode to prepare selection for pasting. if (General.Editing.Mode.OnPasteBegin(options.Copy())) { // Create undo General.MainWindow.DisplayStatus(StatusType.Action, "Pasted selected elements."); General.Map.UndoRedo.CreateUndo("Paste"); // Mark all current geometry General.Map.Map.ClearAllMarks(true); // Read from clipboard if (havepastedata) { using (Stream memstream = (Stream)Clipboard.GetData(CLIPBOARD_DATA_FORMAT)) { // Rewind before use memstream.Seek(0, SeekOrigin.Begin); // Read data stream ClipboardStreamReader reader = new ClipboardStreamReader(); //mxd General.Map.Map.BeginAddRemove(); bool success = reader.Read(General.Map.Map, memstream); General.Map.Map.EndAddRemove(); if (!success) //mxd { General.Map.UndoRedo.WithdrawUndo(); // This will also mess with the marks... General.Map.Map.ClearAllMarks(true); // So re-mark all current geometry... } } } // mxd. DB2/DB64 interop else if (havedb2pastedata) { using (Stream memstream = (Stream)Clipboard.GetData(CLIPBOARD_DATA_FORMAT_DB2)) { // Read data stream UniversalStreamReader reader = new UniversalStreamReader(new Dictionary <MapElementType, Dictionary <string, UniversalType> >()); reader.StrictChecking = false; General.Map.Map.BeginAddRemove(); reader.Read(General.Map.Map, memstream); General.Map.Map.EndAddRemove(); } } else { throw new NotImplementedException("Unknown clipboard data format!"); } // The new geometry is not marked, so invert the marks to get it marked General.Map.Map.InvertAllMarks(); // Check if anything was pasted List <Thing> things = General.Map.Map.GetMarkedThings(true); //mxd int totalpasted = things.Count; totalpasted += General.Map.Map.GetMarkedVertices(true).Count; totalpasted += General.Map.Map.GetMarkedLinedefs(true).Count; totalpasted += General.Map.Map.GetMarkedSidedefs(true).Count; totalpasted += General.Map.Map.GetMarkedSectors(true).Count; if (totalpasted > 0) { // Convert UDMF fields back to flags and activations, if needed if (!(General.Map.FormatInterface is UniversalMapSetIO)) { General.Map.Map.TranslateFromUDMF(); } // Modify tags and actions if preferred if (options.ChangeTags == PasteOptions.TAGS_REMOVE) { Tools.RemoveMarkedTags(); } if (options.ChangeTags == PasteOptions.TAGS_RENUMBER) { Tools.RenumberMarkedTags(); } if (options.RemoveActions) { Tools.RemoveMarkedActions(); } foreach (Thing t in things) { t.UpdateConfiguration(); //mxd } General.Map.ThingsFilter.Update(); General.Editing.Mode.OnPasteEnd(options.Copy()); General.Plugins.OnPasteEnd(options); } } } } else { // Nothing useful on the clipboard // [ZZ] don't beep if 3D mode is currently engaged. the 3D mode allows you to copy/paste non-geometry stuff. // note that this is a hack and probably needs to be fixed properly by making it beep elsewhere so that the current active mode can decide this. if (!(General.Editing.Mode is VisualMode)) { General.MessageBeep(MessageBeepType.Warning); } } } else { // Paste not allowed General.MessageBeep(MessageBeepType.Warning); } }
/// <summary> /// Called by the Doom Builder core when the user wants to paste geometry into the map. /// Return false to abort the paste operation. /// The result parameter is false when the operation was already aborted by another plugin. /// </summary> public virtual bool OnPasteBegin(PasteOptions options, bool result) { return(true); }