Exemple #1
0
        //Protected methods

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