Example #1
0
        public MotionItem CreateMotionEmpty(MotionFolderItem parentFolder = null, string name = null)
        {
            if (parentFolder == null)
            {
                parentFolder = rootFolder;
            }
            if (string.IsNullOrEmpty(name))
            {
                name = GetNewName(MotionItemType.Motion);
            }

            MotionItem motion = new MotionItem(this);

            ItemCreated?.Invoke(motion, parentFolder);

            parentFolder.AddChild(motion);
            motion.SetName(name);

            return(motion);
        }
Example #2
0
        public MotionFolderItem CreateFolder(MotionFolderItem parentFolder = null, string name = null)
        {
            if (parentFolder == null)
            {
                parentFolder = rootFolder;
            }
            if (string.IsNullOrEmpty(name))
            {
                name = GetNewName(MotionItemType.Folder);
            }

            MotionFolderItem folder = new MotionFolderItem(this);

            ItemCreated?.Invoke(folder, parentFolder);

            if (parentFolder != null)
            {
                parentFolder.AddChild(folder);
            }
            folder.SetName(name);

            return(folder);
        }