Пример #1
0
        //Protected methods

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