Beispiel #1
0
        //Protected methods

        protected override void DisposeManagedState()
        {
            base.DisposeManagedState();
            ClockCon?.Dispose();
            JsonCon?.Dispose();
            WorldForm?.Dispose();
        }
Beispiel #2
0
 private WorldCon GetNewWorldCon()
 {
     if (AppCon.Options.OpenInNewWindow)
     {
         return(AppCon.AddNewWorldCon());
     }
     if (!JsonCon.SaveIfModified())
     {
         return(null);
     }
     JsonCon.Clear();
     SetDefaultCamera();
     return(WorldCon);
 }
Beispiel #3
0
        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);
        }
Beispiel #4
0
 private bool SaveFileAs() => JsonCon.SaveAs();
Beispiel #5
0
 private bool SaveFile() => JsonCon.Save();
Beispiel #6
0
 private WorldCon OpenFile(FilterIndex filterIndex = FilterIndex.File) => OpenFile(JsonCon.SelectFilePath(filterIndex));
Beispiel #7
0
 private void WorldForm_FormClosing(object sender, FormClosingEventArgs e) => e.Cancel = !JsonCon.SaveIfModified();
Beispiel #8
0
 private void CopyToClipboard() => JsonCon.ClipboardCopy(ShapeSelection.Shapes);
Beispiel #9
0
 public void LoadFromFile(string filePath) => JsonCon.LoadFromFile(filePath);