Example #1
0
        //Protected methods

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