public bool OpenFile(bool checkSaved = true)
        {
            if (checkSaved && !ShowSaveQuestion())
            {
                return(false);
            }

            string filePath = GetOpenFilename();

            if (string.IsNullOrEmpty(filePath))
            {
                return(false);
            }

            CloseFile(false);
            EditingFile = new MotionFile(false);

            RegisterFileEvents(EditingFile);

            EditingFile.Load(filePath);

            MotionTab.UpdateItemPreviews();

            return(true);
        }
        private void UnregisterFileEvents(MotionFile file)
        {
            file.ItemCreated -= MotionTab.EditingFile_ItemCreated;
            file.ItemRemoved -= MotionTab.EditingFile_ItemRemoved;

            MotionTab.EditingFile_ItemRemoved(EditingFile.rootFolder, null);
        }
        public bool CloseFile(bool checkSaved = true)
        {
            if (!OnEditing)
            {
                return(true);
            }
            if (checkSaved && !ShowSaveQuestion())
            {
                return(false);
            }

            UnregisterFileEvents(EditingFile);

            MotionTab.ClearItems();
            GraphEditorTab.DetachMotion();
            EditingFile = null;

            return(true);
        }
 private void InitTabs()
 {
     MotionTab.Init(this);
     GraphEditorTab.Init(this);
     PreviewTab.Init(this);
 }