//Protected methods protected override void DisposeManagedState() { base.DisposeManagedState(); ClockCon?.Dispose(); JsonCon?.Dispose(); WorldForm?.Dispose(); }
private WorldCon GetNewWorldCon() { if (AppCon.Options.OpenInNewWindow) { return(AppCon.AddNewWorldCon()); } if (!JsonCon.SaveIfModified()) { return(null); } JsonCon.Clear(); SetDefaultCamera(); return(WorldCon); }
private void EditPaste_Click(object sender, EventArgs e) { var shapes = JsonCon.ClipboardPaste().ToList(); if (!shapes.Any()) { return; } var index = Scene.Shapes.Count; foreach (var shape in shapes) { shape.Scene = Scene; Run(new ShapeInsertCommand(index++, shape)); } ShapeSelection.Set(shapes); }
private bool SaveFileAs() => JsonCon.SaveAs();
private bool SaveFile() => JsonCon.Save();
private WorldCon OpenFile(FilterIndex filterIndex = FilterIndex.File) => OpenFile(JsonCon.SelectFilePath(filterIndex));
private void WorldForm_FormClosing(object sender, FormClosingEventArgs e) => e.Cancel = !JsonCon.SaveIfModified();
private void CopyToClipboard() => JsonCon.ClipboardCopy(ShapeSelection.Shapes);
public void LoadFromFile(string filePath) => JsonCon.LoadFromFile(filePath);